Skip to content

Commit ff7458a

Browse files
committed
common/ompio: implement pipelined file_iwrite and iread
Pipelined iread/iwrite operations require the notion of subrequests, i.e. a user level request can contain multiple internal subrequests that all have to complete before the user level operation is considered finished. This requires adjustments to the internal ompio progress engine and data structures. Note: this is purely just a pipelined algorithm, no overlap between different iterations. Signed-off-by: Edgar Gabriel <edgar.gabriel@amd.com>
1 parent 57ca47a commit ff7458a

File tree

8 files changed

+352
-276
lines changed

8 files changed

+352
-276
lines changed

ompi/mca/common/ompio/common_ompio.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Copyright (c) 2018 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
17+
* Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
1718
* $COPYRIGHT$
1819
*
1920
* Additional copyrights may follow
@@ -101,6 +102,8 @@
101102
#define OMPIO_PERM_NULL -1
102103
#define OMPIO_IOVEC_INITIAL_SIZE 100
103104

105+
extern opal_mutex_t mca_common_ompio_mutex;
106+
104107
enum ompio_fs_type
105108
{
106109
NONE = 0,
@@ -274,7 +277,7 @@ OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MP
274277

275278
OMPI_DECLSPEC int mca_common_ompio_build_io_array ( ompio_file_t *fh, int index, int cycles,
276279
size_t bytes_per_cycle, size_t max_data, uint32_t iov_count,
277-
struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw,
280+
struct iovec *decoded_iov, int *ii, size_t *tbw,
278281
size_t *spc, mca_common_ompio_io_array_t **io_array,
279282
int *num_io_entries );
280283

ompi/mca/common/ompio/common_ompio_buffer.h

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,10 @@
3131
opal_output(1, "common_ompio: error allocating memory\n"); \
3232
return OMPI_ERR_OUT_OF_RESOURCE; \
3333
} \
34-
_decoded_iov = (struct iovec *) malloc ( sizeof ( struct iovec )); \
35-
if ( NULL == _decoded_iov ) { \
36-
opal_output(1, "common_ompio: could not allocate memory.\n"); \
37-
return OMPI_ERR_OUT_OF_RESOURCE; \
38-
} \
39-
_decoded_iov->iov_base = _tbuf; \
40-
_decoded_iov->iov_len = _max_data; \
41-
_iov_count=1;}
34+
if (NULL != _decoded_iov) { \
35+
((struct iovec*)_decoded_iov)->iov_base = _tbuf; \
36+
((struct iovec*)_decoded_iov)->iov_len = _max_data; \
37+
_iov_count=1;}}
4238

4339
#define OMPIO_PREPARE_READ_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_tmp_buf_size,_decoded_iov,_iov_count){ \
4440
OBJ_CONSTRUCT( _convertor, opal_convertor_t); \
@@ -49,14 +45,10 @@
4945
opal_output(1, "common_ompio: error allocating memory\n"); \
5046
return OMPI_ERR_OUT_OF_RESOURCE; \
5147
} \
52-
_decoded_iov = (struct iovec *) malloc ( sizeof ( struct iovec )); \
53-
if ( NULL == _decoded_iov ) { \
54-
opal_output(1, "common_ompio: could not allocate memory.\n"); \
55-
return OMPI_ERR_OUT_OF_RESOURCE; \
56-
} \
57-
_decoded_iov->iov_base = _tbuf; \
58-
_decoded_iov->iov_len = _max_data; \
59-
_iov_count=1;}
48+
if (NULL != _decoded_iov) { \
49+
((struct iovec*)_decoded_iov)->iov_base = _tbuf; \
50+
((struct iovec*)_decoded_iov)->iov_len = _max_data; \
51+
_iov_count=1;}}
6052

6153
void mca_common_ompio_check_gpu_buf ( ompio_file_t *fh, const void *buf,
6254
int *is_gpu, int *is_managed);

ompi/mca/common/ompio/common_ompio_file_open.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
static mca_common_ompio_generate_current_file_view_fn_t generate_current_file_view_fn;
4949
static mca_common_ompio_get_mca_parameter_value_fn_t get_mca_parameter_value_fn;
5050

51+
/*
52+
* Global, component-wide OMPIO mutex
53+
*/
54+
opal_mutex_t mca_common_ompio_mutex = {{0}};
55+
56+
5157
int mca_common_ompio_file_open (ompi_communicator_t *comm,
5258
const char *filename,
5359
int amode,

0 commit comments

Comments
 (0)