Skip to content

common/ompio: implement pipelined file_iwrite and iread #11225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ompi/mca/common/ompio/common_ompio.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
* Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -101,6 +102,8 @@
#define OMPIO_PERM_NULL -1
#define OMPIO_IOVEC_INITIAL_SIZE 100

extern opal_mutex_t mca_common_ompio_mutex;

enum ompio_fs_type
{
NONE = 0,
Expand Down Expand Up @@ -274,7 +277,7 @@ OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MP

OMPI_DECLSPEC int mca_common_ompio_build_io_array ( ompio_file_t *fh, int index, int cycles,
size_t bytes_per_cycle, size_t max_data, uint32_t iov_count,
struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw,
struct iovec *decoded_iov, int *ii, size_t *tbw,
size_t *spc, mca_common_ompio_io_array_t **io_array,
int *num_io_entries );

Expand Down
24 changes: 8 additions & 16 deletions ompi/mca/common/ompio/common_ompio_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@
opal_output(1, "common_ompio: error allocating memory\n"); \
return OMPI_ERR_OUT_OF_RESOURCE; \
} \
_decoded_iov = (struct iovec *) malloc ( sizeof ( struct iovec )); \
if ( NULL == _decoded_iov ) { \
opal_output(1, "common_ompio: could not allocate memory.\n"); \
return OMPI_ERR_OUT_OF_RESOURCE; \
} \
_decoded_iov->iov_base = _tbuf; \
_decoded_iov->iov_len = _max_data; \
_iov_count=1;}
if (NULL != _decoded_iov) { \
((struct iovec*)_decoded_iov)->iov_base = _tbuf; \
((struct iovec*)_decoded_iov)->iov_len = _max_data; \
_iov_count=1;}}

#define OMPIO_PREPARE_READ_BUF(_fh,_buf,_count,_datatype,_tbuf,_convertor,_max_data,_tmp_buf_size,_decoded_iov,_iov_count){ \
OBJ_CONSTRUCT( _convertor, opal_convertor_t); \
Expand All @@ -49,14 +45,10 @@
opal_output(1, "common_ompio: error allocating memory\n"); \
return OMPI_ERR_OUT_OF_RESOURCE; \
} \
_decoded_iov = (struct iovec *) malloc ( sizeof ( struct iovec )); \
if ( NULL == _decoded_iov ) { \
opal_output(1, "common_ompio: could not allocate memory.\n"); \
return OMPI_ERR_OUT_OF_RESOURCE; \
} \
_decoded_iov->iov_base = _tbuf; \
_decoded_iov->iov_len = _max_data; \
_iov_count=1;}
if (NULL != _decoded_iov) { \
((struct iovec*)_decoded_iov)->iov_base = _tbuf; \
((struct iovec*)_decoded_iov)->iov_len = _max_data; \
_iov_count=1;}}

void mca_common_ompio_check_gpu_buf ( ompio_file_t *fh, const void *buf,
int *is_gpu, int *is_managed);
Expand Down
6 changes: 6 additions & 0 deletions ompi/mca/common/ompio/common_ompio_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
static mca_common_ompio_generate_current_file_view_fn_t generate_current_file_view_fn;
static mca_common_ompio_get_mca_parameter_value_fn_t get_mca_parameter_value_fn;

/*
* Global, component-wide OMPIO mutex
*/
opal_mutex_t mca_common_ompio_mutex = {{0}};


int mca_common_ompio_file_open (ompi_communicator_t *comm,
const char *filename,
int amode,
Expand Down
Loading