Fixes a few minor parallel warnings (#1832)

This commit is contained in:
Dana Robinson 2022-06-29 13:02:38 -07:00 committed by GitHub
parent cb424b2c45
commit 03ed7a3d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 14 deletions

View File

@ -4068,10 +4068,18 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk
else {
int all_sends_completed;
/* Determine if all send requests have completed */
/* Determine if all send requests have completed
*
* gcc 11 complains about passing MPI_STATUSES_IGNORE as an MPI_Status
* array. See the discussion here:
*
* https://github.com/pmodels/mpich/issues/5687
*/
H5_GCC_DIAG_OFF("stringop-overflow")
if (MPI_SUCCESS != (mpi_code = MPI_Testall((int)num_send_requests, send_requests,
&all_sends_completed, MPI_STATUSES_IGNORE)))
HMPI_GOTO_ERROR(FAIL, "MPI_Testall failed", mpi_code)
H5_GCC_DIAG_ON("stringop-overflow")
if (all_sends_completed) {
/* Post non-blocking barrier */
@ -4105,9 +4113,16 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk
* in the order that chunks are processed. So, the safest way to
* support both I/O modes is to simply make sure all messages
* are available.
*
* gcc 11 complains about passing MPI_STATUSES_IGNORE as an MPI_Status
* array. See the discussion here:
*
* https://github.com/pmodels/mpich/issues/5687
*/
H5_GCC_DIAG_OFF("stringop-overflow")
if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int)num_recv_requests, recv_requests, MPI_STATUSES_IGNORE)))
HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code)
H5_GCC_DIAG_ON("stringop-overflow")
/* Set the new number of locally-selected chunks */
*chunk_list_num_entries = last_assigned_idx;

View File

@ -69,14 +69,22 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc)
HDfree(rbuf);
} /* end if */
if (0 == mpi_rank)
if (0 == mpi_rank) {
/* gcc 11 complains about passing MPI_STATUSES_IGNORE as an MPI_Status
* array. See the discussion here:
*
* https://github.com/pmodels/mpich/issues/5687
*/
H5_GCC_DIAG_OFF("stringop-overflow")
MPI_Waitall(2, req, MPI_STATUSES_IGNORE);
H5_GCC_DIAG_ON("stringop-overflow")
}
if (NULL != sbuf)
HDfree(sbuf);
MPI_Barrier(MPI_COMM_WORLD);
return (0);
return 0;
}
void

View File

@ -457,7 +457,7 @@ parse_args(int argc, char **argv)
}
}
return (0);
return 0;
}
/*-------------------------------------------------------------------------
* Function: getenv_all
@ -478,14 +478,9 @@ parse_args(int argc, char **argv)
* Programmer: Leon Arber
* 4/4/05
*
* Modifications:
* Use original getenv if MPI is not initialized. This happens
* one uses the PHDF5 library to build a serial nature code.
* Albert 2006/04/07
*
*-------------------------------------------------------------------------
*/
char *
static char *
getenv_all(MPI_Comm comm, int root, const char *name)
{
int mpi_size, mpi_rank, mpi_initialized, mpi_finalized;
@ -539,7 +534,9 @@ getenv_all(MPI_Comm comm, int root, const char *name)
#endif
}
else {
/* use original getenv */
/* Use the original getenv if MPI is not initialized. This happens
* if you use the parallel HDF5 library to build a serial program.
*/
if (env)
HDfree(env);
env = HDgetenv(name);

View File

@ -146,7 +146,7 @@ do_pio(parameters param)
file_descr fd;
iotype iot;
char fname[FILENAME_MAX];
char *fname = NULL;
long nf;
long ndsets;
off_t nbytes; /*number of bytes per dataset */
@ -168,6 +168,9 @@ do_pio(parameters param)
/* IO type */
iot = param.io_type;
if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char))))
GOTOERROR(FAIL);
switch (iot) {
case MPIO:
fd.mpifd = MPI_FILE_NULL;
@ -365,8 +368,8 @@ done:
}
/* release generic resources */
if (buffer)
HDfree(buffer);
HDfree(buffer);
HDfree(fname);
res.ret_code = ret_code;
return res;
}