summaryrefslogtreecommitdiffstats
path: root/testpar/t_mpi.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2011-01-16 09:44:22 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2011-01-16 09:44:22 (GMT)
commite6622c86a87c58e9158b512d6d6e873d8f85ea5f (patch)
treee110aa563f7e16d1f5fc57182bf488ce62e51727 /testpar/t_mpi.c
parent1ed956f2cbabeea56d286089cd06f0697050ab1a (diff)
downloadhdf5-e6622c86a87c58e9158b512d6d6e873d8f85ea5f.zip
hdf5-e6622c86a87c58e9158b512d6d6e873d8f85ea5f.tar.gz
hdf5-e6622c86a87c58e9158b512d6d6e873d8f85ea5f.tar.bz2
[svn-r19959] Bug: the VRFY macro, for some reason, called MPI_Finalize() when it encountered
error and wanted to exit the test program. This was not good since if only a subset of processes called MPI_Finalize(), the other processes will likely hang. That happened in AIX that it would waited till the alarm signal to kill the processes. Definitely a waste of time. Solution: Changed it to call MPI_Abort. That showed another problem. HDF5 has setup atexit post-process to try to close unclose objects, release resources, etc. But if the MPI processes have encountered an error and has been aborted, it is not likely any more MPI calls can function properly. E.g., it would attempt to free some communicators in the HDF5 MPIO file handle. It would again hang. Solution: need to call H5dont_atexit() to disable any atexit post-processing. This must be done early, like before calling H5open. This is added to each parallel test main program. testphdf5.h: Changed macros VRFY and MESG. Added comments too. testphdf5.c: t_mpi.c: t_cache.c: t_shapesame.c: Added H5dont_atexit. Tested: h5committest.
Diffstat (limited to 'testpar/t_mpi.c')
-rw-r--r--testpar/t_mpi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 9033e70..c3e04de 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -1137,6 +1137,14 @@ main(int argc, char **argv)
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ /* Attempt to turn off atexit post processing so that in case errors
+ * happen during the test and the process is aborted, it will not get
+ * hang in the atexit post processing in which it may try to make MPI
+ * calls. By then, MPI calls may not work.
+ */
+ if (H5dont_atexit() < 0){
+ printf("Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ };
H5open();
if (parse_options(argc, argv) != 0){
if (MAINPROCESS)