Skip to content

Commit

Permalink
Fix broken tests, add restart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Aug 15, 2024
1 parent 932ffa6 commit 02bc245
Show file tree
Hide file tree
Showing 15 changed files with 128 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ jobs:
# external repositories required for test analysis
cd ..
git clone --depth 1 https://github.com/ECP-WarpX/warpx-data.git
# FIXME do we want to select only specific datasets?
git clone --depth 1 https://github.com/openPMD/openPMD-example-datasets.git
cd -
rm -rf ${CEI_TMP}
df -h
Expand Down
64 changes: 43 additions & 21 deletions Examples/Tests/load_external_field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,50 @@ add_warpx_test(
diags/diag1000300 # output
)

# FIXME
# load_external_field_rz_grid #################################################
#
#add_warpx_test(
# load_external_field_rz_grid # name
# RZ # dims
# 1 # nprocs
# OFF # eb
# Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_grid # inputs
# Examples/Tests/load_external_field/analysis_rz.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
load_external_field_rz_grid # name
RZ # dims
1 # nprocs
OFF # eb
Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_grid # inputs
Examples/Tests/load_external_field/analysis_rz.py # analysis
diags/diag1000300 # output
)

# load_external_field_rz_grid_restart #########################################
#
add_warpx_test(
load_external_field_rz_grid_restart # name
RZ # dims
1 # nprocs
OFF # eb
Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_grid_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)

# FIXME
# load_external_field_rz_particle #############################################
# load_external_field_rz_particles ############################################
#
#add_warpx_test(
# load_external_field_rz_particle # name
# RZ # dims
# 1 # nprocs
# OFF # eb
# Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_particle # inputs
# Examples/Tests/load_external_field/analysis_rz.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
load_external_field_rz_particles # name
RZ # dims
1 # nprocs
OFF # eb
Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_particles # inputs
Examples/Tests/load_external_field/analysis_rz.py # analysis
diags/diag1000300 # output
)

# load_external_field_rz_particles_restart ####################################
#
add_warpx_test(
load_external_field_rz_particles_restart # name
RZ # dims
1 # nprocs
OFF # eb
Examples/Tests/load_external_field/inputs_rz_test_load_external_field_rz_particles_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
warpx.abort_on_warning_threshold = medium
warpx.serialize_initial_conditions = 0
warpx.do_dynamic_scheduling = 0
particles.do_tiling = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_rz_test_load_external_field_rz_grid

# test input parameters
amr.restart = ../load_external_field_rz_grid/diags/chk000150
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
warpx.abort_on_warning_threshold = medium
warpx.serialize_initial_conditions = 0
warpx.do_dynamic_scheduling = 0
particles.do_tiling = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_rz_test_load_external_field_rz_particles

# test input parameters
amr.restart = ../load_external_field_rz_particles/diags/chk000150
71 changes: 40 additions & 31 deletions Examples/Tests/pml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,50 @@ add_warpx_test(
diags/diag1000300 # output
)

# FIXME
# pml_x_psatd #################################################################
#
#add_warpx_test(
# pml_x_psatd # name
# 2 # dims
# 2 # nprocs
# OFF # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_psatd # inputs
# Examples/Tests/pml/analysis_pml_psatd.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_psatd # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_psatd # inputs
Examples/Tests/pml/analysis_pml_psatd.py # analysis
diags/diag1000300 # output
)

# pml_x_psatd_restart #########################################################
#
add_warpx_test(
pml_x_psatd_restart # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_psatd_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)

# FIXME
# pml_x_yee ###################################################################
#
#add_warpx_test(
# pml_x_yee # name
# 2 # dims
# 2 # nprocs
# OFF # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_yee # inputs
# Examples/Tests/pml/analysis_pml_yee.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_yee # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_yee # inputs
Examples/Tests/pml/analysis_pml_yee.py # analysis
diags/diag1000300 # output
)

# FIXME
# pml_x_yee_eb ################################################################
# pml_x_yee_restart ###########################################################
#
#add_warpx_test(
# pml_x_yee_eb # name
# 2 # dims
# 2 # nprocs
# ON # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_yee_eb # inputs
# Examples/Tests/pml/analysis_pml_yee.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_yee_restart # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_yee_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)
12 changes: 6 additions & 6 deletions Examples/Tests/pml/analysis_pml_psatd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@

assert(reflectivity < reflectivity_max)

# Check restart data v. original data
sys.path.insert(0, '../../../../warpx/Examples/')
from analysis_default_restart import check_restart

if not galilean:
check_restart(filename)
## Check restart data v. original data
#sys.path.insert(0, '../../../../warpx/Examples/')
#from analysis_default_restart import check_restart
#
#if not galilean:
# check_restart(filename)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)
10 changes: 5 additions & 5 deletions Examples/Tests/pml/analysis_pml_yee.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@

assert( error_rel < tolerance_rel )

# Check restart data v. original data
sys.path.insert(0, '../../../../warpx/Examples/')
from analysis_default_restart import check_restart

check_restart(filename)
## Check restart data v. original data
#sys.path.insert(0, '../../../../warpx/Examples/')
#from analysis_default_restart import check_restart
#
#check_restart(filename)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)
2 changes: 0 additions & 2 deletions Examples/Tests/pml/inputs_2d_test_pml_x_psatd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FILE = inputs_2d_base

# test input parameters
algo.maxwell_solver = psatd
chk.file_prefix = pml_x_psatd_chk
chk.file_min_digits = 5
diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho divE
warpx.abort_on_warning_threshold = medium
warpx.cfl = 0.7071067811865475
Expand Down
5 changes: 5 additions & 0 deletions Examples/Tests/pml/inputs_2d_test_pml_x_psatd_restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_2d_test_pml_x_psatd

# test input parameters
amr.restart = ../pml_x_psatd/diags/chk000150
2 changes: 0 additions & 2 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ FILE = inputs_2d_base

# test input parameters
algo.maxwell_solver = yee
chk.file_prefix = pml_x_yee_chk
chk.file_min_digits = 5
7 changes: 0 additions & 7 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee_eb

This file was deleted.

5 changes: 5 additions & 0 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee_restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_2d_test_pml_x_yee

# test input parameters
amr.restart = ../pml_x_yee/diags/chk000150
11 changes: 10 additions & 1 deletion Examples/analysis_default_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@
# Get name of the test
test_name = os.path.split(os.getcwd())[1]

restart = "restart" in test_name

if restart:
test_name = test_name.replace("_restart", "")

# Run checksum regression test
if re.search( 'single_precision', fn ):
checksumAPI.evaluate_checksum(test_name, fn, rtol=2.e-6)
else:
checksumAPI.evaluate_checksum(test_name, fn)
if restart:
checksumAPI.evaluate_checksum(test_name, fn, rtol=1e-12)
else:
# using default relative tolerance
checksumAPI.evaluate_checksum(test_name, fn)

0 comments on commit 02bc245

Please sign in to comment.