Re-enable the contiguous buffer optimization to the read_all and the write_all routines.
After long debugging, I found last week the reason this optimization originally broke some hdf5 tests. We now pass the hdf5 test suite with the optimization being actively used.
Этот коммит содержится в:
родитель
c2c44b11dc
Коммит
a1778406d6
@ -94,6 +94,10 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
|
|||||||
ompi_datatype_t **sendtype = NULL;
|
ompi_datatype_t **sendtype = NULL;
|
||||||
MPI_Request *send_req=NULL, recv_req=NULL;
|
MPI_Request *send_req=NULL, recv_req=NULL;
|
||||||
int my_aggregator =-1;
|
int my_aggregator =-1;
|
||||||
|
bool recvbuf_is_contiguous=false;
|
||||||
|
size_t ftype_size;
|
||||||
|
OPAL_PTRDIFF_TYPE ftype_extent, lb;
|
||||||
|
|
||||||
|
|
||||||
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
|
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
|
||||||
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
|
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
|
||||||
@ -106,10 +110,17 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
|
|||||||
** 1. In case the data is not contigous in memory, decode it into an iovec
|
** 1. In case the data is not contigous in memory, decode it into an iovec
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
// if (opal_datatype_is_contiguous_memory_layout(&datatype->super,1)) {
|
opal_datatype_type_size ( &datatype->super, &ftype_size );
|
||||||
// fh->f_flags |= OMPIO_CONTIGUOUS_MEMORY;
|
opal_datatype_get_extent ( &datatype->super, &lb, &ftype_extent );
|
||||||
// }
|
|
||||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if ( (ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) &&
|
||||||
|
opal_datatype_is_contiguous_memory_layout(&datatype->super,1) &&
|
||||||
|
0 == lb ) {
|
||||||
|
recvbuf_is_contiguous = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (! recvbuf_is_contiguous ) {
|
||||||
ret = fh->f_decode_datatype ((struct mca_io_ompio_file_t *)fh,
|
ret = fh->f_decode_datatype ((struct mca_io_ompio_file_t *)fh,
|
||||||
datatype,
|
datatype,
|
||||||
count,
|
count,
|
||||||
@ -760,7 +771,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
|
|||||||
/**********************************************************
|
/**********************************************************
|
||||||
*** 7f. Scatter the Data from the readers
|
*** 7f. Scatter the Data from the readers
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
if (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY) {
|
if ( recvbuf_is_contiguous ) {
|
||||||
receive_buf = &((char*)buf)[position];
|
receive_buf = &((char*)buf)[position];
|
||||||
}
|
}
|
||||||
else if (bytes_received) {
|
else if (bytes_received) {
|
||||||
@ -807,7 +818,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/* If data is not contigous in memory, copy the data from the
|
/* If data is not contigous in memory, copy the data from the
|
||||||
receive buffer into the buffer passed in */
|
receive buffer into the buffer passed in */
|
||||||
if (!(fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if (!recvbuf_is_contiguous ) {
|
||||||
OPAL_PTRDIFF_TYPE mem_address;
|
OPAL_PTRDIFF_TYPE mem_address;
|
||||||
size_t remaining = 0;
|
size_t remaining = 0;
|
||||||
size_t temp_position = 0;
|
size_t temp_position = 0;
|
||||||
@ -868,7 +879,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (!(fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if (!recvbuf_is_contiguous) {
|
||||||
if (NULL != receive_buf) {
|
if (NULL != receive_buf) {
|
||||||
free (receive_buf);
|
free (receive_buf);
|
||||||
receive_buf = NULL;
|
receive_buf = NULL;
|
||||||
|
@ -96,6 +96,10 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
MPI_Aint *total_bytes_per_process = NULL;
|
MPI_Aint *total_bytes_per_process = NULL;
|
||||||
MPI_Request send_req=NULL, *recv_req=NULL;
|
MPI_Request send_req=NULL, *recv_req=NULL;
|
||||||
int my_aggregator=-1;
|
int my_aggregator=-1;
|
||||||
|
bool sendbuf_is_contiguous = false;
|
||||||
|
size_t ftype_size;
|
||||||
|
OPAL_PTRDIFF_TYPE ftype_extent, lb;
|
||||||
|
|
||||||
|
|
||||||
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
|
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
|
||||||
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
|
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
|
||||||
@ -104,15 +108,21 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
mca_io_ompio_print_entry nentry;
|
mca_io_ompio_print_entry nentry;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
opal_datatype_type_size ( &datatype->super, &ftype_size );
|
||||||
// if (opal_datatype_is_contiguous_memory_layout(&datatype->super,1)) {
|
opal_datatype_get_extent ( &datatype->super, &lb, &ftype_extent );
|
||||||
// fh->f_flags |= OMPIO_CONTIGUOUS_MEMORY;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
** 1. In case the data is not contigous in memory, decode it into an iovec
|
** 1. In case the data is not contigous in memory, decode it into an iovec
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if ( ( ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) &&
|
||||||
|
opal_datatype_is_contiguous_memory_layout(&datatype->super,1) &&
|
||||||
|
0 == lb ) {
|
||||||
|
sendbuf_is_contiguous = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (! sendbuf_is_contiguous ) {
|
||||||
ret = fh->f_decode_datatype ((struct mca_io_ompio_file_t *) fh,
|
ret = fh->f_decode_datatype ((struct mca_io_ompio_file_t *) fh,
|
||||||
datatype,
|
datatype,
|
||||||
count,
|
count,
|
||||||
@ -791,7 +801,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
} /* end if (my_aggregator == fh->f_rank ) */
|
} /* end if (my_aggregator == fh->f_rank ) */
|
||||||
|
|
||||||
|
|
||||||
if (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY) {
|
if ( sendbuf_is_contiguous ) {
|
||||||
send_buf = &((char*)buf)[total_bytes_written];
|
send_buf = &((char*)buf)[total_bytes_written];
|
||||||
}
|
}
|
||||||
else if (bytes_sent) {
|
else if (bytes_sent) {
|
||||||
@ -880,7 +890,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if (! sendbuf_is_contiguous) {
|
||||||
if (NULL != send_buf) {
|
if (NULL != send_buf) {
|
||||||
free (send_buf);
|
free (send_buf);
|
||||||
send_buf = NULL;
|
send_buf = NULL;
|
||||||
@ -1050,7 +1060,7 @@ exit :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
if (! sendbuf_is_contiguous) {
|
||||||
if (NULL != send_buf) {
|
if (NULL != send_buf) {
|
||||||
free (send_buf);
|
free (send_buf);
|
||||||
send_buf = NULL;
|
send_buf = NULL;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user