Skip to content

Commit

Permalink
Fix ph5diff tests for MPIEXEC_MAX_NUMPROCS=1 (#3407)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF authored Aug 22, 2023
1 parent a7c095d commit f61522e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32)
add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${parallel_example}> ${MPIEXEC_POSTFLAGS})
else ()
add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:${parallel_example}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING="
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE}"
-D "TEST_ARGS:STRING=${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:${parallel_example}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
-D "TEST_OUTPUT=${parallel_example}.out"
Expand Down
10 changes: 6 additions & 4 deletions tools/src/h5diff/ph5diff_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ main(int argc, char *argv[])
MPI_Comm_size(MPI_COMM_WORLD, &g_nTasks);

if (g_nTasks == 1) {
printf("Only 1 task available...doing serial diff\n");
fprintf(stderr, "Only 1 task available...doing serial diff\n");

g_Parallel = 0;

Expand Down Expand Up @@ -279,11 +279,13 @@ h5diff_exit(int status)
phdiff_dismiss_workers();
MPI_Barrier(MPI_COMM_WORLD);
}
MPI_Finalize();
status = EXIT_SUCCESS; /* Reset exit status, since some mpiexec commands generate output on failure
status */
}

MPI_Finalize();

status =
EXIT_SUCCESS; /* Reset exit status, since some mpiexec commands generate output on failure status */

h5tools_close();

/* Always exit(0), since MPI implementations do weird stuff when they
Expand Down
8 changes: 5 additions & 3 deletions tools/test/h5diff/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,13 @@
add_test (
NAME MPI_TEST_H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff${tgt_file_ext}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE}"
-D "TEST_ARGS:STRING=${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff${tgt_file_ext}>;${MPIEXEC_POSTFLAGS};${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=0"
#-D "TEST_EXPECT=${resultcode}"
-D "TEST_EXPECT=0" # ph5diff currently always exits with a zero status code due to
# output from some MPI implementations from a non-zero exit code
-D "TEST_REFERENCE=${resultfile}.txt"
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_REF_APPEND=EXIT CODE: [0-9]"
Expand Down

0 comments on commit f61522e

Please sign in to comment.