forked from ECP-WarpX/WarpX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
199 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# Configuration ############################################################### | ||
# | ||
if(WarpX_MPI) | ||
# OpenMPI root guard: https://github.com/open-mpi/ompi/issues/4451 | ||
if("$ENV{USER}" STREQUAL "root") | ||
# calling even --help as root will abort and warn on stderr | ||
execute_process( | ||
COMMAND ${MPIEXEC_EXECUTABLE} --help | ||
ERROR_VARIABLE MPIEXEC_HELP_TEXT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(${MPIEXEC_HELP_TEXT} MATCHES "^.*allow-run-as-root.*$") | ||
set(MPI_ALLOW_ROOT --allow-run-as-root) | ||
endif() | ||
endif() | ||
set(MPI_TEST_EXE | ||
${MPIEXEC_EXECUTABLE} | ||
${MPI_ALLOW_ROOT} | ||
${MPIEXEC_NUMPROC_FLAG} 2 | ||
${MPIEXEC_POSTFLAGS} | ||
${MPIEXEC_PREFLAGS} | ||
) | ||
endif() | ||
|
||
# Add a WarpX test set (with sub-tests) | ||
# | ||
function(add_warpx_test | ||
name | ||
mpi | ||
dims | ||
inputs_base | ||
inputs_test | ||
analysis | ||
output | ||
) | ||
# cannot run MPI tests w/o MPI support | ||
if(mpi AND NOT WarpX_MPI) | ||
return() | ||
endif() | ||
|
||
# make a unique run directory | ||
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}) | ||
set(THIS_WORKING_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}) | ||
|
||
set(THIS_MPI_TEST_EXE) | ||
if(mpi) | ||
set(THIS_MPI_TEST_EXE ${MPI_TEST_EXE}) | ||
endif() | ||
|
||
# test run | ||
add_test( | ||
NAME ${name}.run | ||
COMMAND | ||
${THIS_MPI_TEST_EXE} | ||
$<TARGET_FILE:app_${dims}d> | ||
${WarpX_SOURCE_DIR}/${inputs_base} | ||
amrex.abort_on_unused_inputs = 1 | ||
amrex.fpe_trap_invalid = 1 | ||
amrex.fpe_trap_overflow = 1 | ||
amrex.fpe_trap_zero = 1 | ||
amrex.throw_exception = 1 | ||
warpx.always_warn_immediately = 1 | ||
warpx.abort_on_warning_threshold = low | ||
warpx.do_dynamic_scheduling = 0 | ||
warpx.serialize_initial_conditions = 1 | ||
# FILE parameter must be at the end, | ||
# to possibly overwrite previous inputs | ||
FILE = ${WarpX_SOURCE_DIR}/${inputs_test} | ||
WORKING_DIRECTORY ${THIS_WORKING_DIR} | ||
) | ||
|
||
if(mpi) | ||
set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=1") | ||
endif() | ||
|
||
# test analysis | ||
if(analysis) | ||
add_test( | ||
NAME ${name}.analysis | ||
COMMAND | ||
${WarpX_SOURCE_DIR}/${analysis} | ||
${output} | ||
WORKING_DIRECTORY ${THIS_WORKING_DIR} | ||
) | ||
set_property(TEST ${name}.analysis APPEND PROPERTY DEPENDS "${name}.run") | ||
endif() | ||
|
||
endfunction() | ||
|
||
# Add tests (alphabetical order) ############################################## | ||
# | ||
|
||
# Langmuir_multi_2d_MR ######################################################## | ||
# | ||
if(2 IN_LIST WarpX_DIMS) | ||
add_warpx_test( | ||
Langmuir_multi_2d_MR | ||
ON | ||
2 | ||
Examples/Tests/langmuir/inputs_2d_base | ||
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR | ||
Examples/Tests/langmuir/analysis_2d.py | ||
diags/diag1000080 | ||
) | ||
endif() | ||
|
||
# Langmuir_multi_2d_MR_anisotropic ############################################ | ||
# | ||
if(2 IN_LIST WarpX_DIMS) | ||
add_warpx_test( | ||
Langmuir_multi_2d_MR_anisotropic | ||
ON | ||
2 | ||
Examples/Tests/langmuir/inputs_2d_base | ||
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_anisotropic | ||
Examples/Tests/langmuir/analysis_2d.py | ||
diags/diag1000080 | ||
) | ||
endif() | ||
|
||
# Langmuir_multi_2d_nodal ##################################################### | ||
# | ||
if(2 IN_LIST WarpX_DIMS) | ||
add_warpx_test( | ||
Langmuir_multi_2d_nodal | ||
ON | ||
2 | ||
Examples/Tests/langmuir/inputs_2d_base | ||
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_nodal | ||
Examples/Tests/langmuir/analysis_2d.py | ||
diags/diag1000080 | ||
) | ||
endif() | ||
|
||
# Langmuir_multi_2d_psatd ##################################################### | ||
# | ||
if(2 IN_LIST WarpX_DIMS AND WarpX_FFT) | ||
add_warpx_test( | ||
Langmuir_multi_2d_psatd | ||
ON | ||
2 | ||
Examples/Tests/langmuir/inputs_2d_base | ||
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd | ||
Examples/Tests/langmuir/analysis_2d.py | ||
diags/diag1000080 | ||
) | ||
endif() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# additional runtime parameters | ||
algo.maxwell_solver = ckc | ||
amr.max_level = 1 | ||
amr.ref_ratio = 4 | ||
diag1.electrons.variables = x z w ux uy uz | ||
diag1.positrons.variables = x z w ux uy uz | ||
warpx.fine_tag_hi = 10.e-6 10.e-6 | ||
warpx.fine_tag_lo = -10.e-6 -10.e-6 | ||
warpx.use_filter = 1 |
9 changes: 9 additions & 0 deletions
9
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_anisotropic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# additional runtime parameters | ||
algo.maxwell_solver = ckc | ||
amr.max_level = 1 | ||
amr.ref_ratio_vect = 4 2 | ||
diag1.electrons.variables = x z w ux uy uz | ||
diag1.positrons.variables = x z w ux uy uz | ||
warpx.fine_tag_hi = 10.e-6 10.e-6 | ||
warpx.fine_tag_lo = -10.e-6 -10.e-6 | ||
warpx.use_filter = 1 |
5 changes: 5 additions & 0 deletions
5
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_nodal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# additional runtime parameters | ||
algo.current_deposition = direct | ||
diag1.electrons.variables = x z w ux uy uz | ||
diag1.positrons.variables = x z w ux uy uz | ||
warpx.grid_type = collocated |
8 changes: 8 additions & 0 deletions
8
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# additional runtime parameters | ||
algo.maxwell_solver = psatd | ||
diag1.electrons.variables = x z w ux uy uz | ||
diag1.positrons.variables = x z w ux uy uz | ||
diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell | ||
psatd.current_correction = 0 | ||
warpx.abort_on_warning_threshold = medium | ||
warpx.cfl = 0.7071067811865475 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters