summaryrefslogtreecommitdiffstats
path: root/testpar/t_shapesame.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2011-01-16 09:53:22 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2011-01-16 09:53:22 (GMT)
commit473b1ac882816e971950d9889d03d3b453b56d52 (patch)
treee573062396e1add98aa2650e30c5c75ce33354c2 /testpar/t_shapesame.c
parente684679ccd1cfc9b1f9c1134d03d6f7ee044a072 (diff)
downloadhdf5-473b1ac882816e971950d9889d03d3b453b56d52.zip
hdf5-473b1ac882816e971950d9889d03d3b453b56d52.tar.gz
hdf5-473b1ac882816e971950d9889d03d3b453b56d52.tar.bz2
[svn-r19960] 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_shapesame.c')
-rw-r--r--testpar/t_shapesame.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 00b6ee5..8f89f9f 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -4753,6 +4753,15 @@ int main(int argc, char **argv)
printf("PHDF5 TESTS START\n");
printf("===================================\n");
}
+
+ /* 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();
h5_show_hostname();