Skip to content

Commit

Permalink
Revert changes to Azure DevOps CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Mar 6, 2025
1 parent 89c2af4 commit e3d274d
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 95 deletions.
6 changes: 1 addition & 5 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: yaml -*-

pool:
vmImage: 'ubuntu-24.04'
vmImage: 'ubuntu-20.04'

trigger:
branches:
Expand Down Expand Up @@ -112,10 +112,6 @@ jobs:
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
fi
# Python modules required for test analysis
# (remove system copy of Matplotlib to avoid conflict
# with version set in the requirements file - see, e.g.,
# https://github.com/matplotlib/matplotlib/issues/28768)
sudo apt remove python3-matplotlib
python3 -m pip install --upgrade -r Regression/requirements.txt
python3 -m pip cache purge
# external repositories required for test analysis
Expand Down
10 changes: 4 additions & 6 deletions Examples/Tests/boundaries/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ def do_periodic(x):
assert len(a_id) == 1, "Absorbing particles not absorbed"
assert np.all(vx == -vx0), "Reflecting particle velocity not correct"
assert np.all(vz == +vz0), "Periodic particle velocity not correct"
rel_err_xx = np.abs((xx - xxa) / xx)
assert np.all(rel_err_xx < 1e-9), (
f"Reflecting particle position along x not correct. Maximum relative error: {np.max(rel_err_xx)}"
assert np.all(np.abs((xx - xxa) / xx) < 1.0e-15), (
"Reflecting particle position not correct"
)
rel_err_zz = np.abs((zz - zza) / zz)
assert np.all(rel_err_zz < 1e-9), (
f"Periodic particle position along z not correct. Maximum relative error: {np.max(rel_err_zz)}"
assert np.all(np.abs((zz - zza) / zz) < 1.0e-15), (
"Periodic particle position not correct"
)
10 changes: 5 additions & 5 deletions Examples/Tests/collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_warpx_test(
2 # nprocs
inputs_test_1d_collision_z # inputs
"analysis_collision_1d.py diags/diag1000600" # analysis
"analysis_default_regression.py --path diags/diag1000600 --rtol 1e-2" # checksum
"analysis_default_regression.py --path diags/diag1000600" # checksum
OFF # dependency
)

Expand All @@ -17,7 +17,7 @@ add_warpx_test(
1 # nprocs
inputs_test_2d_collision_xz # inputs
"analysis_collision_2d.py diags/diag1000150" # analysis
"analysis_default_regression.py --path diags/diag1000150 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000150" # checksum
OFF # dependency
)

Expand All @@ -27,7 +27,7 @@ add_warpx_test(
1 # nprocs
inputs_test_2d_collision_xz_picmi.py # inputs
"analysis_collision_2d.py diags/diag1000150" # analysis
"analysis_default_regression.py --path diags/diag1000150 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000150" # checksum
OFF # dependency
)

Expand All @@ -37,7 +37,7 @@ add_warpx_test(
1 # nprocs
inputs_test_3d_collision_iso # inputs
"analysis_collision_3d_isotropization.py diags/diag1000100" # analysis
"analysis_default_regression.py --path diags/diag1000100 --rtol 1e-2" # checksum
"analysis_default_regression.py --path diags/diag1000100" # checksum
OFF # dependency
)

Expand All @@ -47,7 +47,7 @@ add_warpx_test(
1 # nprocs
inputs_test_3d_collision_xyz # inputs
"analysis_collision_3d.py diags/diag1000150" # analysis
"analysis_default_regression.py --path diags/diag1000150 --rtol 1e-2" # checksum
"analysis_default_regression.py --path diags/diag1000150" # checksum
OFF # dependency
)

Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/implicit/analysis_vandb_jfnk_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# This case should have near machine precision conservation of energy
tolerance_rel_energy = 2.0e-14
tolerance_rel_charge = 2.0e-11
tolerance_rel_charge = 2.0e-15

print(f"max change in energy: {max_delta_E}")
print(f"tolerance: {tolerance_rel_energy}")
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FILE = inputs_base_rz
algo.current_deposition = direct
algo.maxwell_solver = psatd
diag1.dump_rz_modes = 0
diag1.electrons.variables = x y z w uy uz
diag1.ions.variables = x y z w uy uz
diag1.electrons.variables = x y z w ux uy uz
diag1.ions.variables = x y z w ux uy uz
electrons.random_theta = 0
ions.random_theta = 0
psatd.current_correction = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ algo.current_deposition = direct
algo.maxwell_solver = psatd
amr.max_grid_size = 128
diag1.dump_rz_modes = 0
diag1.electrons.variables = x y z w uy uz
diag1.electrons.variables = x y z w ux uy uz
diag1.fields_to_plot = jr jz Er Ez Bt rho divE
diag1.ions.variables = x y z w uy uz
diag1.ions.variables = x y z w ux uy uz
electrons.random_theta = 0
ions.random_theta = 0
psatd.current_correction = 1
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/laser_injection_from_file/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ add_warpx_test(
1 # nprocs
inputs_test_rz_laser_injection_from_lasy_file # inputs
"analysis_rz.py diags/diag1000252" # analysis
"analysis_default_regression.py --path diags/diag1000252 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000252" # checksum
test_rz_laser_injection_from_lasy_file_prepare # dependency
)

Expand All @@ -137,6 +137,6 @@ add_warpx_test(
1 # nprocs
inputs_test_rz_laser_injection_from_RZ_lasy_file # inputs
"analysis_from_RZ_file.py diags/diag1000612" # analysis
"analysis_default_regression.py --path diags/diag1000612 --rtol 1e-2" # checksum
"analysis_default_regression.py --path diags/diag1000612" # checksum
test_rz_laser_injection_from_RZ_lasy_file_prepare # dependency
)
13 changes: 6 additions & 7 deletions Examples/Tests/nci_psatd_stability/analysis_galilean.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
periodic_single_box = False
with open("./warpx_used_inputs", "r") as f:
warpx_used_inputs = f.read()
if re.search("geometry.dims = 2", warpx_used_inputs):
if re.search("geometry.dims\s*=\s*2", warpx_used_inputs):
dims = "2D"
elif re.search("geometry.dims = RZ", warpx_used_inputs):
elif re.search("geometry.dims\s*=\s*RZ", warpx_used_inputs):
dims = "RZ"
elif re.search("geometry.dims = 3", warpx_used_inputs):
elif re.search("geometry.dims\s*=\s*3", warpx_used_inputs):
dims = "3D"
if re.search("psatd.current_correction = 1", warpx_used_inputs):
if re.search("psatd.current_correction\s*=\s*1", warpx_used_inputs):
current_correction = True
if re.search("psatd.do_time_averaging = 1", warpx_used_inputs):
if re.search("psatd.do_time_averaging\s*=\s*1", warpx_used_inputs):
time_averaging = True
if re.search("psatd.periodic_single_box_fft = 1", warpx_used_inputs):
if re.search("psatd.periodic_single_box_fft\s*=\s*1", warpx_used_inputs):
periodic_single_box = True

ds = yt.load(filename)
Expand Down Expand Up @@ -82,7 +82,6 @@
energy_ref = 191002.6526271543
if current_correction and periodic_single_box:
energy_ref = 472779.70801323955
tol_charge = 1e-8
if current_correction and not periodic_single_box:
energy_ref = 511671.4108624746
tol_charge = 3e-4
Expand Down
12 changes: 6 additions & 6 deletions Examples/Tests/nuclear_fusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_warpx_test(
2 # nprocs
inputs_test_2d_proton_boron_fusion # inputs
"analysis_proton_boron_fusion.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000001" # checksum
OFF # dependency
)

Expand All @@ -17,7 +17,7 @@ add_warpx_test(
2 # nprocs
inputs_test_3d_deuterium_deuterium_fusion # inputs
"analysis_two_product_fusion.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000001" # checksum
OFF # dependency
)

Expand All @@ -27,7 +27,7 @@ add_warpx_test(
1 # nprocs
inputs_test_3d_deuterium_deuterium_fusion_intraspecies # inputs
"analysis_deuterium_deuterium_3d_intraspecies.py" # analysis
"analysis_default_regression.py --path diags/diag1000010 --rtol 1e-2" # checksum
"analysis_default_regression.py --path diags/diag1000010" # checksum
OFF # dependency
)

Expand All @@ -37,7 +37,7 @@ add_warpx_test(
2 # nprocs
inputs_test_3d_deuterium_tritium_fusion # inputs
"analysis_two_product_fusion.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000001" # checksum
OFF # dependency
)

Expand All @@ -47,7 +47,7 @@ add_warpx_test(
2 # nprocs
inputs_test_3d_proton_boron_fusion # inputs
"analysis_proton_boron_fusion.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --rtol 1e-3" # checksum
"analysis_default_regression.py --path diags/diag1000001" # checksum
OFF # dependency
)

Expand All @@ -57,6 +57,6 @@ add_warpx_test(
2 # nprocs
inputs_test_rz_deuterium_tritium_fusion # inputs
"analysis_two_product_fusion.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --rtol 1e-1" # checksum
"analysis_default_regression.py --path diags/diag1000001" # checksum
OFF # dependency
)
4 changes: 2 additions & 2 deletions Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

## Checks whether this is the 2D or the 3D test
with open("./warpx_used_inputs") as warpx_used_inputs:
is_2D = re.search("geometry.dims = 2", warpx_used_inputs.read())
is_2D = re.search("geometry.dims\s*=\s*2", warpx_used_inputs.read())
warpx_used_inputs.close()

## Some numerical parameters for this test
Expand Down Expand Up @@ -698,7 +698,7 @@ def check_initial_energy2(data):
## statistics and an event like alpha1 emitted exactly in direction of proton & alpha2
## emitted exactly in direction opposite to Beryllium is somewhat rare.
assert is_close(
np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=1e-1
np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=5e-2
)
assert is_close(
np.amin(energy_alpha2_simulation), min_energy_alpha23, atol=3.218e-14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"helium4": 4.00260325413 * scc.m_u,
"neutron": 1.0013784193052508 * scc.m_p,
}
m_reduced = np.prod([mass[s] for s in reactant_species]) / np.sum(
m_reduced = np.product([mass[s] for s in reactant_species]) / np.sum(
[mass[s] for s in reactant_species]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ diagnostics.diags_names = diag1 diag2

diag1.intervals = 1
diag1.diag_type = Full
diag1.fields_to_plot = Ex Ey Ez Bx By rho
diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho
diag1.format = plotfile

diag2.intervals = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def do_analysis(single_precision=False):

error_plt = dict()
error_opmd = dict()
tolerance = 5e-3 if single_precision else 1e-8
tolerance = 5e-3 if single_precision else 1e-12

for k in values_yt.keys():
# check that the zeros line up, since we'll be ignoring them in the error calculation
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/pml/analysis_pml_psatd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
energyB = np.sum(0.5 / scc.mu_0 * (Bx**2 + By**2 + Bz**2))
energy_start_diags = energyE + energyB
error = abs(energy_start - energy_start_diags) / energy_start
tolerance = 1e-9
tolerance = 1e-14
print("energy_start expected = " + str(energy_start))
print("energy_start_diags = " + str(energy_start_diags))
print("relative error = " + str(error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def do_analysis(single_precision=False):
# --------------------------------------------------------------------------------------------------

error = dict()
tolerance = 5e-3 if single_precision else 1e-8
tolerance = 5e-3 if single_precision else 1e-12
field_energy_tolerance = 0.3

# The comparison of field energies requires a large tolerance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,5 @@ def remove_rigid_lines(plotfile, nlines_if_rigid):
z = ad_start["beam", "particle_position_y"]
orig_z = ad_start["beam", "particle_orig_z"]
center = ad_start["beam", "particle_center"]
print(z)
print(orig_z)
assert np.isclose(z, orig_z, rtol=1e-15, atol=1e-15).all()
assert np.array_equal(z, orig_z)
assert np.array_equal(1 * (np.abs(x) < 5.0e-7), center)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"lev=0": {
"Bx": 100915933.44604117,
"By": 157610622.18548763,
"Bz": 9.614441087794229e-14,
"Ex": 4.725065270619209e+16,
"Ey": 3.025394898938681e+16,
"Ez": 3276573.9514776673,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"lev=0": {
"Bx": 100915933.44551668,
"By": 157610622.18551716,
"Bz": 2.598515299403035e-15,
"Ex": 4.725065270620093e+16,
"Ey": 3.0253948989229424e+16,
"Ez": 2787743.3330717986,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"electrons": {
"particle_momentum_x": 3.676049145834066e-36,
"particle_momentum_y": 1.9957106001035657e-20,
"particle_momentum_z": 2.781227135136398e-20,
"particle_position_x": 0.5289997910724913,
Expand All @@ -8,6 +9,7 @@
"particle_weight": 81147583679.15044
},
"ions": {
"particle_momentum_x": 2.2630624271917214e-36,
"particle_momentum_y": 1.5421720860618741e-21,
"particle_momentum_z": 1.991711267334514e-21,
"particle_position_x": 0.529000009838682,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"rho": 3855770.585538005
},
"ions": {
"particle_momentum_x": 9.303284812749536e-37,
"particle_momentum_y": 1.475435436402189e-21,
"particle_momentum_z": 1.9507023826482256e-21,
"particle_position_x": 0.5290000097194892,
Expand All @@ -17,6 +18,7 @@
"particle_weight": 81147583679.15044
},
"electrons": {
"particle_momentum_x": 2.5301631422412464e-36,
"particle_momentum_y": 2.0033141618079855e-20,
"particle_momentum_z": 2.785324108949854e-20,
"particle_position_x": 0.5290000111160095,
Expand Down
Loading

0 comments on commit e3d274d

Please sign in to comment.