Skip to content

Commit

Permalink
Use mpirun for fcompare. (Exawind#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Dec 24, 2020
1 parent bfbbc9e commit b1f1b63
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ function(add_test_r TEST_NAME)
file(COPY ${TEST_FILES} DESTINATION "${CURRENT_TEST_BINARY_DIR}/")
# Set some default runtime options for all tests in this category
set(RUNTIME_OPTIONS "time.max_step=10 amr.plot_file=plt time.plot_interval=10 amrex.throw_exception=1 amrex.signal_handling=0")
if(AMR_WIND_ENABLE_CUDA)
set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12")
endif()
# Use fcompare to test diffs in plots against gold files
if(AMR_WIND_TEST_WITH_FCOMPARE)
set(FCOMPARE_COMMAND "&& ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}")
endif()
if(AMR_WIND_ENABLE_MPI)
set(NP 4)
set(MPI_COMMANDS "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NP} ${MPIEXEC_PREFLAGS}")
else()
set(NP 1)
unset(MPI_COMMANDS)
endif()
# Use fcompare to test diffs in plots against gold files
if(AMR_WIND_ENABLE_CUDA)
set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12")
endif()
if(AMR_WIND_TEST_WITH_FCOMPARE)
set(FCOMPARE_COMMAND "&& ${MPI_COMMANDS} ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}")
endif()
# Add test and actual test commands to CTest database
add_test(${TEST_NAME} sh -c "${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${amr_wind_exe_name} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.i ${RUNTIME_OPTIONS} > ${TEST_NAME}.log ${FCOMPARE_COMMAND}")
# Set properties for test
Expand Down

0 comments on commit b1f1b63

Please sign in to comment.