Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a different output directory for each tests #1775

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions alien/ArcaneInterface/cmake/LoadAlienTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endmacro()

macro(alien_test)

set(options PARALLEL_ONLY)
set(options PARALLEL_ONLY UNIQUE_OUTPUT_DIR)
set(oneValueArgs BENCH NAME COMMAND WORKING_DIRECTORY)
set(multiValueArgs OPTIONS PROCS)

Expand Down Expand Up @@ -65,9 +65,16 @@ macro(alien_test)
${ARGS_OPTIONS}
)
else ()
if(ARGS_UNIQUE_OUTPUT_DIR)
set(ALIEN_TEST_OUTDIR ${CMAKE_BINARY_DIR}/${ARGS_WORKING_DIRECTORY}/alien.${ARGS_BENCH}.${ARGS_NAME})
set(ALIEN_TEST_PARAM_OUTDIR -A,OutputDirectory=${ALIEN_TEST_OUTDIR})
file(MAKE_DIRECTORY ${ALIEN_TEST_OUTDIR})
else ()
set(ALIEN_TEST_PARAM_OUTDIR "")
endif()
add_test(
NAME alien.${ARGS_BENCH}.${ARGS_NAME}
COMMAND ${ARGS_COMMAND}
COMMAND ${ARGS_COMMAND} ${ALIEN_TEST_PARAM_OUTDIR}
${ARGS_OPTIONS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${ARGS_WORKING_DIRECTORY}
)
Expand Down Expand Up @@ -105,9 +112,16 @@ macro(alien_test)
${ARGS_OPTIONS}
)
else ()
if(ARGS_UNIQUE_OUTPUT_DIR)
set(ALIEN_TEST_OUTDIR ${CMAKE_BINARY_DIR}/${ARGS_WORKING_DIRECTORY}/alien.${ARGS_BENCH}.${ARGS_NAME}.mpi-${mpi})
set(ALIEN_TEST_PARAM_OUTDIR -A,OutputDirectory=${ALIEN_TEST_OUTDIR})
file(MAKE_DIRECTORY ${ALIEN_TEST_OUTDIR})
else ()
set(ALIEN_TEST_PARAM_OUTDIR "")
endif ()
add_test(
NAME alien.${ARGS_BENCH}.${ARGS_NAME}.mpi-${mpi}
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${mpi} ${MPIEXEC_PREFLAGS}$<TARGET_FILE:${ARGS_COMMAND}> ${MPIEXEC_POSTFLAGS}
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${mpi} ${MPIEXEC_PREFLAGS}$<TARGET_FILE:${ARGS_COMMAND}> ${MPIEXEC_POSTFLAGS} ${ALIEN_TEST_PARAM_OUTDIR}
${ARGS_OPTIONS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${ARGS_WORKING_DIRECTORY}
)
Expand Down
15 changes: 15 additions & 0 deletions alien/ArcaneInterface/test/AlienBench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ alien_test(
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-aliensolver.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

if (TARGET petsc)
Expand All @@ -258,6 +259,7 @@ if (TARGET petsc)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -266,6 +268,7 @@ if (TARGET petsc)
PROCS 4
COMMAND alien_bench.exe
OPTIONS AlienBench-4P.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

if(TARGET petsc::spai)
Expand All @@ -275,6 +278,7 @@ if (TARGET petsc)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-petsc-spai.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -283,6 +287,7 @@ if (TARGET petsc)
PROCS 4
COMMAND alien_bench.exe
OPTIONS AlienBench-petsc-spai-4P.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)
endif()

Expand All @@ -296,6 +301,7 @@ if (TARGET hypre)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-hypre.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -304,6 +310,7 @@ if (TARGET hypre)
PROCS 2
COMMAND alien_bench.exe
OPTIONS AlienBench-hypre-2P.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

if(ALIEN_USE_SYCL)
Expand All @@ -313,6 +320,7 @@ if(ALIEN_USE_SYCL)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-hypreilu.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -321,6 +329,7 @@ if(ALIEN_USE_SYCL)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-hyprefsai.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

if(TARGET CUDA::cudart)
Expand All @@ -330,6 +339,7 @@ if(ALIEN_USE_SYCL)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-hypreilu-sycl.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -338,6 +348,7 @@ if(ALIEN_USE_SYCL)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-hyprefsai-sycl.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)
endif()
endif(ALIEN_USE_SYCL)
Expand All @@ -352,6 +363,7 @@ if (TARGET trilinos)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-trilinos.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -360,6 +372,7 @@ if (TARGET trilinos)
PROCS 1
COMMAND alien_bench.exe
OPTIONS AlienBench-trilinosmuelu.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -368,6 +381,7 @@ if (TARGET trilinos)
PROCS 2
COMMAND alien_bench.exe
OPTIONS AlienBench-trilinos-2P.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)

alien_test(
Expand All @@ -376,5 +390,6 @@ if (TARGET trilinos)
PROCS 4
COMMAND alien_bench.exe
OPTIONS AlienBench-trilinosmuelu-4P.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienBench)
endif ()
3 changes: 3 additions & 0 deletions alien/ArcaneInterface/test/AlienTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ if (TARGET petsc)
PROCS 4
COMMAND alien_arcane_test.exe
OPTIONS AlienTest.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienTest)

alien_test(
Expand All @@ -108,6 +109,7 @@ if (TARGET petsc)
PROCS 4
COMMAND alien_arcane_test.exe
OPTIONS AlienTest-FBS.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienTest)

alien_test(
Expand All @@ -116,6 +118,7 @@ if (TARGET petsc)
PROCS 4
COMMAND alien_arcane_test.exe
OPTIONS AlienTest-VBS.arc
UNIQUE_OUTPUT_DIR
WORKING_DIRECTORY ${ALIEN_ARCANE_INTERFACE_DIR}/test/AlienTest)

endif ()
Loading