Fix ph5diff tests for MPIEXEC_MAX_NUMPROCS=1 (#3407)

This commit is contained in:
jhendersonHDF 2023-08-22 11:03:04 -05:00 committed by GitHub
parent a7c095d5be
commit f61522ec4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View File

@ -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}) add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${parallel_example}> ${MPIEXEC_POSTFLAGS})
else () else ()
add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND "${CMAKE_COMMAND}" 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_PROGRAM=${MPIEXEC_EXECUTABLE}"
-D "TEST_ARGS:STRING=" -D "TEST_ARGS:STRING=${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:${parallel_example}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_EXPECT=0" -D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE" -D "TEST_SKIP_COMPARE=TRUE"
-D "TEST_OUTPUT=${parallel_example}.out" -D "TEST_OUTPUT=${parallel_example}.out"

View File

@ -63,7 +63,7 @@ main(int argc, char *argv[])
MPI_Comm_size(MPI_COMM_WORLD, &g_nTasks); MPI_Comm_size(MPI_COMM_WORLD, &g_nTasks);
if (g_nTasks == 1) { 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; g_Parallel = 0;
@ -279,11 +279,13 @@ h5diff_exit(int status)
phdiff_dismiss_workers(); phdiff_dismiss_workers();
MPI_Barrier(MPI_COMM_WORLD); 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(); h5tools_close();
/* Always exit(0), since MPI implementations do weird stuff when they /* Always exit(0), since MPI implementations do weird stuff when they

View File

@ -432,11 +432,13 @@
add_test ( add_test (
NAME MPI_TEST_H5DIFF-${resultfile} NAME MPI_TEST_H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}" 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_PROGRAM=${MPIEXEC_EXECUTABLE}"
-D "TEST_ARGS:STRING=${ARGN}" -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_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles"
-D "TEST_OUTPUT=${resultfile}.out" -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_REFERENCE=${resultfile}.txt"
-D "TEST_APPEND=EXIT CODE:" -D "TEST_APPEND=EXIT CODE:"
-D "TEST_REF_APPEND=EXIT CODE: [0-9]" -D "TEST_REF_APPEND=EXIT CODE: [0-9]"