common/ompio: fix zero size fview issue
handle the situation where the user requests a non-zero amount of data but has a zero-size fileview. My instrinct would have been to return an error code, but according to the test that I used it should be MPI_SUCCESS and zero bytes. It is definitely better than segfaulting :-) THis makes another test from the IBM testsuite pass. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
Этот коммит содержится в:
родитель
7643ccfbcf
Коммит
743e0dff5a
@ -118,6 +118,12 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
|
|||||||
&decoded_iov,
|
&decoded_iov,
|
||||||
&iov_count);
|
&iov_count);
|
||||||
#endif
|
#endif
|
||||||
|
if ( 0 < max_data && 0 == fh->f_iov_count ) {
|
||||||
|
if ( MPI_STATUS_IGNORE != status ) {
|
||||||
|
status->_ucount = 0;
|
||||||
|
}
|
||||||
|
return OMPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if ( -1 == OMPIO_MCA_GET(fh, cycle_buffer_size )) {
|
if ( -1 == OMPIO_MCA_GET(fh, cycle_buffer_size )) {
|
||||||
bytes_per_cycle = max_data;
|
bytes_per_cycle = max_data;
|
||||||
@ -271,6 +277,14 @@ int mca_common_ompio_file_iread (ompio_file_t *fh,
|
|||||||
&decoded_iov,
|
&decoded_iov,
|
||||||
&iov_count);
|
&iov_count);
|
||||||
#endif
|
#endif
|
||||||
|
if ( 0 < max_data && 0 == fh->f_iov_count ) {
|
||||||
|
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||||
|
ompio_req->req_ompi.req_status._ucount = 0;
|
||||||
|
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||||
|
*request = (ompi_request_t *) ompio_req;
|
||||||
|
return OMPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
// Non-blocking operations have to occur in a single cycle
|
// Non-blocking operations have to occur in a single cycle
|
||||||
j = fh->f_index_in_file_view;
|
j = fh->f_index_in_file_view;
|
||||||
|
|
||||||
|
@ -96,6 +96,13 @@ int mca_common_ompio_file_write (ompio_file_t *fh,
|
|||||||
&decoded_iov,
|
&decoded_iov,
|
||||||
&iov_count);
|
&iov_count);
|
||||||
#endif
|
#endif
|
||||||
|
if ( 0 < max_data && 0 == fh->f_iov_count ) {
|
||||||
|
if ( MPI_STATUS_IGNORE != status ) {
|
||||||
|
status->_ucount = 0;
|
||||||
|
}
|
||||||
|
return OMPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if ( -1 == OMPIO_MCA_GET(fh, cycle_buffer_size )) {
|
if ( -1 == OMPIO_MCA_GET(fh, cycle_buffer_size )) {
|
||||||
bytes_per_cycle = max_data;
|
bytes_per_cycle = max_data;
|
||||||
}
|
}
|
||||||
@ -242,6 +249,14 @@ int mca_common_ompio_file_iwrite (ompio_file_t *fh,
|
|||||||
&decoded_iov,
|
&decoded_iov,
|
||||||
&iov_count);
|
&iov_count);
|
||||||
#endif
|
#endif
|
||||||
|
if ( 0 < max_data && 0 == fh->f_iov_count ) {
|
||||||
|
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||||
|
ompio_req->req_ompi.req_status._ucount = 0;
|
||||||
|
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||||
|
*request = (ompi_request_t *) ompio_req;
|
||||||
|
return OMPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
j = fh->f_index_in_file_view;
|
j = fh->f_index_in_file_view;
|
||||||
|
|
||||||
/* Non blocking operations have to occur in a single cycle */
|
/* Non blocking operations have to occur in a single cycle */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user