Skip to content

Commit c50ffa7

Browse files
committed
common/ompio: implement pipelined read and write operation
implement pipelined file_write and file_read operations. This code is being used if a bounce buffer is required,e.g. when using device memory or a non-native data representation. The new code shows significant performance improvements for reading/writing device buffers compared to the previous code version, and reduces the memory footprint of the library by allocating smaller temporary buffers. The current code is only dealing with blocking file_read/write operations, non-blocking operations will follow in a second step. Signed-off-by: Edgar Gabriel <[email protected]>
1 parent 4e4c43e commit c50ffa7

File tree

6 files changed

+459
-198
lines changed

6 files changed

+459
-198
lines changed

ompi/mca/common/ompio/common_ompio_buffer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#define MCA_COMMON_OMPIO_CUDA_H
2323

2424

25-
#define OMPIO_PREPARE_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_decoded_iov,_iov_count){ \
25+
#define OMPIO_PREPARE_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_tmp_buf_size,_decoded_iov,_iov_count){ \
2626
OBJ_CONSTRUCT( _convertor, opal_convertor_t); \
2727
opal_convertor_copy_and_prepare_for_send ( _fh->f_file_convertor, &(_datatype->super), _count, _buf, CONVERTOR_SEND_CONVERSION, _convertor ); \
2828
opal_convertor_get_packed_size( _convertor, &_max_data ); \
29-
_tbuf = mca_common_ompio_alloc_buf (_fh, _max_data); \
29+
_tbuf = mca_common_ompio_alloc_buf (_fh, _tmp_buf_size==0 ? _max_data : _tmp_buf_size); \
3030
if ( NULL == _tbuf ) { \
3131
opal_output(1, "common_ompio: error allocating memory\n"); \
3232
return OMPI_ERR_OUT_OF_RESOURCE; \
@@ -40,11 +40,11 @@
4040
_decoded_iov->iov_len = _max_data; \
4141
_iov_count=1;}
4242

43-
#define OMPIO_PREPARE_READ_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_decoded_iov,_iov_count){ \
43+
#define OMPIO_PREPARE_READ_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_tmp_buf_size,_decoded_iov,_iov_count){ \
4444
OBJ_CONSTRUCT( _convertor, opal_convertor_t); \
4545
opal_convertor_copy_and_prepare_for_recv ( _fh->f_file_convertor, &(_datatype->super), _count, _buf, 0, _convertor ); \
4646
opal_convertor_get_packed_size( _convertor, &_max_data ); \
47-
_tbuf = mca_common_ompio_alloc_buf (_fh, _max_data); \
47+
_tbuf = mca_common_ompio_alloc_buf (_fh, _tmp_buf_size==0 ? _max_data : _tmp_buf_size); \
4848
if ( NULL == _tbuf ) { \
4949
opal_output(1, "common_ompio: error allocating memory\n"); \
5050
return OMPI_ERR_OUT_OF_RESOURCE; \

0 commit comments

Comments
 (0)