1
1

common/ompio: add comm_ompio_read_all/write_all functions

in preparation for adding support for the external32 data
representation.

Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
Этот коммит содержится в:
Edgar Gabriel 2019-04-22 16:21:55 -05:00
родитель d65fae11bd
Коммит a96efb7620
5 изменённых файлов: 133 добавлений и 79 удалений

Просмотреть файл

@ -253,10 +253,16 @@ OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at (ompio_file_t *fh, OMPI_MPI_O
const void *buf, int count, struct ompi_datatype_t *datatype, const void *buf, int count, struct ompi_datatype_t *datatype,
ompi_request_t **request); ompi_request_t **request);
OMPI_DECLSPEC int mca_common_ompio_file_write_all (ompio_file_t *fh, const void *buf,
int count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);
OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf, OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
int count, struct ompi_datatype_t *datatype, int count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status); ompi_status_public_t *status);
OMPI_DECLSPEC int mca_common_ompio_file_iwrite_all (ompio_file_t *fp, const void *buf,
int count, struct ompi_datatype_t *datatype, ompi_request_t **request);
OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf, OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
int count, struct ompi_datatype_t *datatype, ompi_request_t **request); int count, struct ompi_datatype_t *datatype, ompi_request_t **request);
@ -282,10 +288,16 @@ OMPI_DECLSPEC int mca_common_ompio_file_iread_at (ompio_file_t *fh, OMPI_MPI_OFF
void *buf, int count, struct ompi_datatype_t *datatype, void *buf, int count, struct ompi_datatype_t *datatype,
ompi_request_t **request); ompi_request_t **request);
OMPI_DECLSPEC int mca_common_ompio_file_read_all (ompio_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype,
ompi_status_public_t * status);
OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
void *buf, int count, struct ompi_datatype_t *datatype, void *buf, int count, struct ompi_datatype_t *datatype,
ompi_status_public_t * status); ompi_status_public_t * status);
OMPI_DECLSPEC int mca_common_ompio_file_iread_all (ompio_file_t *fp, void *buf, int count, struct ompi_datatype_t *datatype,
ompi_request_t **request);
OMPI_DECLSPEC int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, OMPI_DECLSPEC int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset,
void *buf, int count, struct ompi_datatype_t *datatype, void *buf, int count, struct ompi_datatype_t *datatype,
ompi_request_t **request); ompi_request_t **request);

Просмотреть файл

@ -376,6 +376,21 @@ int mca_common_ompio_file_iread_at (ompio_file_t *fh,
/* Infrastructure for collective operations */ /* Infrastructure for collective operations */
int mca_common_ompio_file_read_all (ompio_file_t *fh,
void *buf,
int count,
struct ompi_datatype_t *datatype,
ompi_status_public_t * status)
{
int ret = OMPI_SUCCESS;
ret = fh->f_fcoll->fcoll_file_read_all (fh,
buf,
count,
datatype,
status);
return ret;
}
int mca_common_ompio_file_read_at_all (ompio_file_t *fh, int mca_common_ompio_file_read_at_all (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset, OMPI_MPI_OFFSET_TYPE offset,
void *buf, void *buf,
@ -388,16 +403,41 @@ int mca_common_ompio_file_read_at_all (ompio_file_t *fh,
mca_common_ompio_file_get_position (fh, &prev_offset ); mca_common_ompio_file_get_position (fh, &prev_offset );
mca_common_ompio_set_explicit_offset (fh, offset); mca_common_ompio_set_explicit_offset (fh, offset);
ret = fh->f_fcoll->fcoll_file_read_all (fh, ret = mca_common_ompio_file_read_all (fh,
buf, buf,
count, count,
datatype, datatype,
status); status);
mca_common_ompio_set_explicit_offset (fh, prev_offset); mca_common_ompio_set_explicit_offset (fh, prev_offset);
return ret; return ret;
} }
int mca_common_ompio_file_iread_all (ompio_file_t *fp,
void *buf,
int count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
int ret = OMPI_SUCCESS;
if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) {
ret = fp->f_fcoll->fcoll_file_iread_all (fp,
buf,
count,
datatype,
request);
}
else {
/* this fcoll component does not support non-blocking
collective I/O operations. WE fake it with
individual non-blocking I/O operations. */
ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request );
}
return ret;
}
int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, int mca_common_ompio_file_iread_at_all (ompio_file_t *fp,
OMPI_MPI_OFFSET_TYPE offset, OMPI_MPI_OFFSET_TYPE offset,
void *buf, void *buf,
@ -411,25 +451,17 @@ int mca_common_ompio_file_iread_at_all (ompio_file_t *fp,
mca_common_ompio_file_get_position (fp, &prev_offset ); mca_common_ompio_file_get_position (fp, &prev_offset );
mca_common_ompio_set_explicit_offset (fp, offset); mca_common_ompio_set_explicit_offset (fp, offset);
if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) { ret = mca_common_ompio_file_iread_all (fp,
ret = fp->f_fcoll->fcoll_file_iread_all (fp, buf,
buf, count,
count, datatype,
datatype, request);
request);
}
else {
/* this fcoll component does not support non-blocking
collective I/O operations. WE fake it with
individual non-blocking I/O operations. */
ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request );
}
mca_common_ompio_set_explicit_offset (fp, prev_offset); mca_common_ompio_set_explicit_offset (fp, prev_offset);
return ret; return ret;
} }
int mca_common_ompio_set_explicit_offset (ompio_file_t *fh, int mca_common_ompio_set_explicit_offset (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset) OMPI_MPI_OFFSET_TYPE offset)
{ {

Просмотреть файл

@ -352,6 +352,20 @@ int mca_common_ompio_file_iwrite_at (ompio_file_t *fh,
/* Collective operations */ /* Collective operations */
/******************************************************************/ /******************************************************************/
int mca_common_ompio_file_write_all (ompio_file_t *fh,
const void *buf,
int count,
struct ompi_datatype_t *datatype,
ompi_status_public_t *status)
{
int ret = OMPI_SUCCESS;
ret = fh->f_fcoll->fcoll_file_write_all (fh,
buf,
count,
datatype,
status);
return ret;
}
int mca_common_ompio_file_write_at_all (ompio_file_t *fh, int mca_common_ompio_file_write_at_all (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset, OMPI_MPI_OFFSET_TYPE offset,
@ -365,30 +379,23 @@ int mca_common_ompio_file_write_at_all (ompio_file_t *fh,
mca_common_ompio_file_get_position (fh, &prev_offset ); mca_common_ompio_file_get_position (fh, &prev_offset );
mca_common_ompio_set_explicit_offset (fh, offset); mca_common_ompio_set_explicit_offset (fh, offset);
ret = fh->f_fcoll->fcoll_file_write_all (fh, ret = mca_common_ompio_file_write_all (fh,
buf, buf,
count, count,
datatype, datatype,
status); status);
mca_common_ompio_set_explicit_offset (fh, prev_offset); mca_common_ompio_set_explicit_offset (fh, prev_offset);
return ret; return ret;
} }
int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, int mca_common_ompio_file_iwrite_all (ompio_file_t *fp,
OMPI_MPI_OFFSET_TYPE offset, const void *buf,
const void *buf, int count,
int count, struct ompi_datatype_t *datatype,
struct ompi_datatype_t *datatype, ompi_request_t **request)
ompi_request_t **request)
{ {
int ret = OMPI_SUCCESS; int ret = OMPI_SUCCESS;
OMPI_MPI_OFFSET_TYPE prev_offset;
mca_common_ompio_file_get_position (fp, &prev_offset );
mca_common_ompio_set_explicit_offset (fp, offset);
if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) {
ret = fp->f_fcoll->fcoll_file_iwrite_all (fp, ret = fp->f_fcoll->fcoll_file_iwrite_all (fp,
@ -404,11 +411,32 @@ int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp,
ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request ); ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request );
} }
return ret;
}
int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp,
OMPI_MPI_OFFSET_TYPE offset,
const void *buf,
int count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
int ret = OMPI_SUCCESS;
OMPI_MPI_OFFSET_TYPE prev_offset;
mca_common_ompio_file_get_position (fp, &prev_offset );
mca_common_ompio_set_explicit_offset (fp, offset);
ret = mca_common_ompio_file_iwrite_all ( fp, buf, count, datatype, request );
mca_common_ompio_set_explicit_offset (fp, prev_offset); mca_common_ompio_set_explicit_offset (fp, prev_offset);
return ret; return ret;
} }
/* Helper function used by both read and write operations */ /* Helper function used by both read and write operations */
/**************************************************************/ /**************************************************************/

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2008-2018 University of Houston. All rights reserved. * Copyright (c) 2008-2019 University of Houston. All rights reserved.
* Copyright (c) 2017-2018 Research Organization for Information Science * Copyright (c) 2017-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -137,12 +137,11 @@ int mca_io_ompio_file_read_all (ompi_file_t *fh,
data = (mca_common_ompio_data_t *) fh->f_io_selected_data; data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
OPAL_THREAD_LOCK(&fh->f_lock); OPAL_THREAD_LOCK(&fh->f_lock);
ret = data->ompio_fh. ret = mca_common_ompio_file_read_all (&data->ompio_fh,
f_fcoll->fcoll_file_read_all (&data->ompio_fh, buf,
buf, count,
count, datatype,
datatype, status);
status);
OPAL_THREAD_UNLOCK(&fh->f_lock); OPAL_THREAD_UNLOCK(&fh->f_lock);
if ( MPI_STATUS_IGNORE != status ) { if ( MPI_STATUS_IGNORE != status ) {
size_t size; size_t size;
@ -168,19 +167,11 @@ int mca_io_ompio_file_iread_all (ompi_file_t *fh,
fp = &data->ompio_fh; fp = &data->ompio_fh;
OPAL_THREAD_LOCK(&fh->f_lock); OPAL_THREAD_LOCK(&fh->f_lock);
if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) { ret = mca_common_ompio_file_iread_all (&data->ompio_fh,
ret = fp->f_fcoll->fcoll_file_iread_all (&data->ompio_fh, buf,
buf, count,
count, datatype,
datatype, request);
request);
}
else {
/* this fcoll component does not support non-blocking
collective I/O operations. WE fake it with
individual non-blocking I/O operations. */
ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request );
}
OPAL_THREAD_UNLOCK(&fh->f_lock); OPAL_THREAD_UNLOCK(&fh->f_lock);
return ret; return ret;

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2008-2018 University of Houston. All rights reserved. * Copyright (c) 2008-2019 University of Houston. All rights reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science * Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -143,12 +143,11 @@ int mca_io_ompio_file_write_all (ompi_file_t *fh,
data = (mca_common_ompio_data_t *) fh->f_io_selected_data; data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
OPAL_THREAD_LOCK(&fh->f_lock); OPAL_THREAD_LOCK(&fh->f_lock);
ret = data->ompio_fh. ret = mca_common_ompio_file_write_all (&data->ompio_fh,
f_fcoll->fcoll_file_write_all (&data->ompio_fh, buf,
buf, count,
count, datatype,
datatype, status);
status);
OPAL_THREAD_UNLOCK(&fh->f_lock); OPAL_THREAD_UNLOCK(&fh->f_lock);
if ( MPI_STATUS_IGNORE != status ) { if ( MPI_STATUS_IGNORE != status ) {
size_t size; size_t size;
@ -192,19 +191,11 @@ int mca_io_ompio_file_iwrite_all (ompi_file_t *fh,
fp = &data->ompio_fh; fp = &data->ompio_fh;
OPAL_THREAD_LOCK(&fh->f_lock); OPAL_THREAD_LOCK(&fh->f_lock);
if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { ret = mca_common_ompio_file_iwrite_all (&data->ompio_fh,
ret = fp->f_fcoll->fcoll_file_iwrite_all (&data->ompio_fh, buf,
buf, count,
count, datatype,
datatype, request);
request);
}
else {
/* this fcoll component does not support non-blocking
collective I/O operations. WE fake it with
individual non-blocking I/O operations. */
ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request );
}
OPAL_THREAD_UNLOCK(&fh->f_lock); OPAL_THREAD_UNLOCK(&fh->f_lock);
return ret; return ret;