Skip to content

Commit

Permalink
Make additional runtime params input file optional
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Jul 26, 2024
1 parent 84b9e00 commit feecc4f
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 36 deletions.
118 changes: 84 additions & 34 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function(add_warpx_test
mpi
mpi_np
inputs_base
inputs_test
analysis
output
#inputs_test (optional)
)
# cannot run MPI tests w/o MPI support
if(mpi AND NOT WarpX_MPI)
Expand All @@ -36,6 +36,9 @@ function(add_warpx_test
return()
endif()

# set dimension suffix
warpx_set_suffix_dims(SD ${dims})

# make a unique run directory
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
set(THIS_WORKING_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
Expand All @@ -51,25 +54,33 @@ function(add_warpx_test
)
endif()

set(runtime_params
"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
# FIXME Avoid magic numbers
if(${ARGC} GREATER 7)
list(APPEND runtime_params "FILE = ${WarpX_SOURCE_DIR}/${ARGV7}")
endif()

# test run
add_test(
NAME ${name}.run
COMMAND
${THIS_MPI_TEST_EXE}
$<TARGET_FILE:app_${dims}d>
$<TARGET_FILE:app_${SD}>
${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}
${runtime_params}
WORKING_DIRECTORY ${THIS_WORKING_DIR}
)

Expand Down Expand Up @@ -103,9 +114,9 @@ if(WarpX_FFT)
ON # mpi
1 # mpi_np
Examples/Tests/nci_psatd_stability/inputs_avg_2d_base # inputs_base
Examples/Tests/nci_psatd_stability/inputs_avg_2d_test_averaged_galilean_2d_psatd # inputs_test
Examples/Tests/nci_psatd_stability/analysis_galilean.py # analysis
diags/diag1000400 # output
Examples/Tests/nci_psatd_stability/inputs_avg_2d_test_averaged_galilean_2d_psatd # inputs_test
)
endif()

Expand All @@ -118,9 +129,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/nci_psatd_stability/inputs_avg_2d_base # inputs_base
Examples/Tests/nci_psatd_stability/inputs_avg_2d_test_averaged_galilean_2d_psatd_hybrid # inputs_test
Examples/Tests/nci_psatd_stability/analysis_galilean.py # analysis
diags/diag1000400 # output
Examples/Tests/nci_psatd_stability/inputs_avg_2d_test_averaged_galilean_2d_psatd_hybrid # inputs_test
)
endif()

Expand All @@ -133,9 +144,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/nci_psatd_stability/inputs_avg_3d_base # inputs_base
Examples/Tests/nci_psatd_stability/inputs_avg_3d_test_averaged_galilean_3d_psatd # inputs_test
Examples/Tests/nci_psatd_stability/analysis_galilean.py # analysis
diags/diag1000160 # output
Examples/Tests/nci_psatd_stability/inputs_avg_3d_test_averaged_galilean_3d_psatd # inputs_test
)
endif()

Expand All @@ -148,9 +159,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/nci_psatd_stability/inputs_avg_3d_base # inputs_base
Examples/Tests/nci_psatd_stability/inputs_avg_3d_test_averaged_galilean_3d_psatd_hybrid # inputs_test
Examples/Tests/nci_psatd_stability/analysis_galilean.py # analysis
diags/diag1000160 # output
Examples/Tests/nci_psatd_stability/inputs_avg_3d_test_averaged_galilean_3d_psatd_hybrid # inputs_test
)
endif()

Expand All @@ -162,9 +173,48 @@ add_warpx_test(
ON # mpi
2 # mpi_np
Examples/Physics_applications/capacitive_discharge/inputs_2d_base # inputs_base
Examples/Physics_applications/capacitive_discharge/inputs_2d_test_background_mcc # inputs_test
Examples/analysis_default_regression.py # analysis
diags/diag1000050 # output
Examples/Physics_applications/capacitive_discharge/inputs_2d_test_background_mcc # inputs_test
)

# background_mcc_dp_psp #######################################################
#
# FIXME
#add_warpx_test(
# background_mcc_dp_psp # name
# 2 # dims
# ON # mpi
# 2 # mpi_np
# Examples/Physics_applications/capacitive_discharge/inputs_2d_base # inputs_base
# Examples/analysis_default_regression.py # analysis
# diags/diag1000050 # output
# Examples/Physics_applications/capacitive_discharge/inputs_2d_test_background_mcc_dp_psp # inputs_test
#)

# bilinear_filter #############################################################
#
add_warpx_test(
bilinear_filter # name
2 # dims
ON # mpi
2 # mpi_np
Examples/Tests/single_particle/inputs_2d_base # inputs_base
Examples/Tests/single_particle/analysis_bilinear_filter.py # analysis
diags/diag1000001 # output
Examples/Tests/single_particle/inputs_2d_test_bilinear_filter # inputs_test
)

# BTD_rz ######################################################################
#
add_warpx_test(
BTD_rz # name
RZ # dims
ON # mpi
2 # mpi_np
Examples/Tests/btd_rz/inputs_rz_z_boosted_BTD # inputs_base
Examples/Tests/btd_rz/analysis_BTD_laser_antenna.py # analysis
diags/diag1000289 # output
)

# Langmuir_multi_2d_MR ########################################################
Expand All @@ -175,9 +225,9 @@ add_warpx_test(
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR # inputs_test
)

# Langmuir_multi_2d_MR_anisotropic ############################################
Expand All @@ -188,9 +238,9 @@ add_warpx_test(
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_anisotropic # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_anisotropic # inputs_test
)

# Langmuir_multi_2d_MR_momentum_conserving ####################################
Expand All @@ -201,9 +251,9 @@ add_warpx_test(
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_momentum_conserving # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_momentum_conserving # inputs_test
)

# Langmuir_multi_2d_MR_psatd ##################################################
Expand All @@ -215,9 +265,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_psatd # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_MR_psatd # inputs_test
)
endif()

Expand All @@ -229,9 +279,9 @@ add_warpx_test(
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_nodal # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_nodal # inputs_test
)

# Langmuir_multi_2d_psatd #####################################################
Expand All @@ -243,9 +293,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd # inputs_test
)
endif()

Expand All @@ -258,9 +308,9 @@ if(WarpX_FFT)
ON # mpi
1 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_current_correction # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_current_correction # inputs_test
)
endif()

Expand All @@ -273,9 +323,9 @@ if(WarpX_FFT)
ON # mpi
1 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_current_correction_nodal # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_current_correction_nodal # inputs_test
)
endif()

Expand All @@ -288,9 +338,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_momentum_conserving # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_momentum_conserving # inputs_test
)
endif()

Expand All @@ -303,9 +353,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_multiJ # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_multiJ # inputs_test
)
endif()

Expand All @@ -318,9 +368,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_multiJ_nodal # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_multiJ_nodal # inputs_test
)
endif()

Expand All @@ -333,9 +383,9 @@ if(WarpX_FFT)
ON # mpi
2 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_nodal # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_nodal # inputs_test
)
endif()

Expand All @@ -348,9 +398,9 @@ if(WarpX_FFT)
ON # mpi
1 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition # inputs_test
)
endif()

Expand All @@ -364,9 +414,9 @@ endif()
# ON # mpi
# 1 # mpi_np
# Examples/Tests/langmuir/inputs_2d_base # inputs_base
# Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition_particle_shape_4 # inputs_test
# Examples/Tests/langmuir/analysis_2d.py # analysis
# diags/diag1000080 # output
# Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition_particle_shape_4 # inputs_test
# )
#endif()

Expand All @@ -379,8 +429,8 @@ if(WarpX_FFT)
ON # mpi
1 # mpi_np
Examples/Tests/langmuir/inputs_2d_base # inputs_base
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition_nodal # inputs_test
Examples/Tests/langmuir/analysis_2d.py # analysis
diags/diag1000080 # output
Examples/Tests/langmuir/inputs_2d_test_Langmuir_multi_2d_psatd_Vay_deposition_nodal # inputs_test
)
endif()
File renamed without changes.
3 changes: 3 additions & 0 deletions Examples/Tests/single_particle/inputs_2d_test_bilinear_filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# additional runtime parameters
warpx.filter_npass_each_dir = 1 5
warpx.use_filter = 1
5 changes: 3 additions & 2 deletions Regression/WarpX-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ analysisRoutine = Examples/analysis_default_regression.py

[bilinear_filter]
buildDir = .
inputFile = Examples/Tests/single_particle/inputs_2d
runtime_params = warpx.use_filter=1 warpx.filter_npass_each_dir=1 5
inputFile = Examples/Tests/single_particle/inputs_2d_base
aux1File = Examples/Tests/single_particle/inputs_2d_test_bilinear_filter
runtime_params = FILE=inputs_2d_test_bilinear_filter
dim = 2
addToCompileString =
cmakeSetupOpts = -DWarpX_DIMS=2
Expand Down

0 comments on commit feecc4f

Please sign in to comment.