diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05049ba7..e7141dd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,6 @@ jobs: build/tst/regression/outputs/aniso_therm_cond_gauss_conv/cond.png build/tst/regression/outputs/field_loop/field_loop.png build/tst/regression/outputs/riemann_hydro/shock_tube.png - build/tst/regression/outputs/turbulence/parthenon.hst + build/tst/regression/outputs/turbulence/parthenon.out1.hst retention-days: 3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d865dc7..9259a727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ ### Fixed (not changing behavior/API/variables/...) ### Infrastructure -- [[PR 114]](https://github.com/parthenon-hpc-lab/athenapk/pull/109) Bump Parthenon to latest develop (2024-05-29) +- [[PR 114]](https://github.com/parthenon-hpc-lab/athenapk/pull/114) Bump Parthenon 24.08 and Kokkos to 4.4.00 - [[PR 112]](https://github.com/parthenon-hpc-lab/athenapk/pull/112) Add dev container configuration - [[PR 105]](https://github.com/parthenon-hpc-lab/athenapk/pull/105) Bump Parthenon to latest develop (2024-03-13) - [[PR 84]](https://github.com/parthenon-hpc-lab/athenapk/pull/84) Added `CHANGELOG.md` @@ -20,10 +20,12 @@ ### Removed (removing behavior/API/varaibles/...) ### Incompatibilities (i.e. breaking changes) -- [[PR 114]](https://github.com/parthenon-hpc-lab/athenapk/pull/109) Bump Parthenon to latest develop (2024-05-29) +- [[PR 114]](https://github.com/parthenon-hpc-lab/athenapk/pull/114) Bump Parthenon 24.08 and Kokkos to 4.4.00 - Changed signature of `UserWorkBeforeOutput` to include `SimTime` as last paramter - Fixes bitwise idential restarts for AMR simulations (the derefinement counter is now included) - Order of operations in flux-correction has changed (expect round-off error differences to previous results for AMR sims) + - History outputs now carry the output block number, i.e., a file previously called parthenon.hst might now be called parthenon.out1.hst + - History outputs now contain two additional columns (cycle number and meshblock counts), which changes/shifts the column indices (hint: use the column headers to parse the contents and do not rely on fixed indices as they may also vary between different pgen due to custom/pgen-dependent content in the history file) - [[PR 97]](https://github.com/parthenon-hpc-lab/athenapk/pull/97) - Removes original `schure.cooling` cooling curve as it had unknown origin. - To avoid confusion, only cooling table for a single solar metallicity are supported diff --git a/tst/regression/test_suites/aniso_therm_cond_gauss_conv/aniso_therm_cond_gauss_conv.py b/tst/regression/test_suites/aniso_therm_cond_gauss_conv/aniso_therm_cond_gauss_conv.py index 9f002723..8e873d17 100644 --- a/tst/regression/test_suites/aniso_therm_cond_gauss_conv/aniso_therm_cond_gauss_conv.py +++ b/tst/regression/test_suites/aniso_therm_cond_gauss_conv/aniso_therm_cond_gauss_conv.py @@ -137,10 +137,15 @@ def get_ref(x, Bx, field_cfg): outname = get_outname(all_cfgs[step]) data_filename = f"{parameters.output_path}/parthenon.{outname}.final.phdf" data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") zz, yy, xx = data_file.GetVolumeLocations() mask = yy == yy[0] - temp = prim[4][mask] + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) + temp = components["prim_pressure"].ravel()[ + mask + ] # because of gamma = 2.0 and rho = 1 -> p = e = T x = xx[mask] res, field_cfg, int_cfg = all_cfgs[step] row = res_cfgs.index(res) diff --git a/tst/regression/test_suites/aniso_therm_cond_ring_conv/aniso_therm_cond_ring_conv.py b/tst/regression/test_suites/aniso_therm_cond_ring_conv/aniso_therm_cond_ring_conv.py index db2ae4e4..ba13129e 100644 --- a/tst/regression/test_suites/aniso_therm_cond_ring_conv/aniso_therm_cond_ring_conv.py +++ b/tst/regression/test_suites/aniso_therm_cond_ring_conv/aniso_therm_cond_ring_conv.py @@ -35,7 +35,6 @@ class TestCase(utils.test_case.TestCaseAbs): def Prepare(self, parameters, step): - assert parameters.num_ranks <= 4, "Use <= 4 ranks for diffusion test." res = res_cfgs[step - 1] @@ -78,8 +77,14 @@ def Analyse(self, parameters): for res in res_cfgs: data_filename = f"{parameters.output_path}/parthenon.{res}.final.phdf" data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") - T = prim[4] # because of gamma = 2.0 and rho = 1 -> p = e = T + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) + T = components[ + "prim_pressure" + ].ravel() # because of gamma = 2.0 and rho = 1 -> p = e = T + zz, yy, xx = data_file.GetVolumeLocations() r = np.sqrt(xx**2 + yy**2) diff --git a/tst/regression/test_suites/aniso_therm_cond_ring_multid/aniso_therm_cond_ring_multid.py b/tst/regression/test_suites/aniso_therm_cond_ring_multid/aniso_therm_cond_ring_multid.py index bf1e0416..3f933507 100644 --- a/tst/regression/test_suites/aniso_therm_cond_ring_multid/aniso_therm_cond_ring_multid.py +++ b/tst/regression/test_suites/aniso_therm_cond_ring_multid/aniso_therm_cond_ring_multid.py @@ -35,7 +35,6 @@ class TestCase(utils.test_case.TestCaseAbs): def Prepare(self, parameters, step): - assert parameters.num_ranks <= 4, "Use <= 4 ranks for diffusion test." # 2D reference case again @@ -110,8 +109,13 @@ def Analyse(self, parameters): for step in range(1, 5): data_filename = f"{parameters.output_path}/parthenon.{step}.final.phdf" data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") - T = prim[4] # because of gamma = 2.0 and rho = 1 -> p = e = T + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) + T = components[ + "prim_pressure" + ].ravel() # because of gamma = 2.0 and rho = 1 -> p = e = T zz, yy, xx = data_file.GetVolumeLocations() if step == 1 or step == 2: r = np.sqrt(xx**2 + yy**2) diff --git a/tst/regression/test_suites/cluster_hse/cluster_hse.py b/tst/regression/test_suites/cluster_hse/cluster_hse.py index 0f567e4f..1a26af4c 100644 --- a/tst/regression/test_suites/cluster_hse/cluster_hse.py +++ b/tst/regression/test_suites/cluster_hse/cluster_hse.py @@ -211,21 +211,15 @@ def AnalyseInitPert(self, parameters): # flatten array as prim var are also flattended cell_vol = cell_vol.ravel() - prim = data_file.Get("prim") - - # FIXME: For now this is hard coded - a component mapping should be done by phdf - prim_col_dict = { - "velocity_1": 1, - "velocity_2": 2, - "velocity_3": 3, - "magnetic_field_1": 5, - "magnetic_field_2": 6, - "magnetic_field_3": 7, - } - - vx = prim[prim_col_dict["velocity_1"]] - vy = prim[prim_col_dict["velocity_2"]] - vz = prim[prim_col_dict["velocity_3"]] + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) + rho = components["prim_density"].ravel() + vx = components["prim_velocity_1"].ravel() + vy = components["prim_velocity_2"].ravel() + vz = components["prim_velocity_3"].ravel() + pres = components["prim_pressure"].ravel() # volume weighted rms velocity rms_v = np.sqrt( @@ -243,9 +237,9 @@ def AnalyseInitPert(self, parameters): f"Expected {self.sigma_v.in_units('code_velocity')} but got {rms_v}\n" ) - bx = prim[prim_col_dict["magnetic_field_1"]] - by = prim[prim_col_dict["magnetic_field_2"]] - bz = prim[prim_col_dict["magnetic_field_3"]] + bx = components["prim_magnetic_field_1"].ravel() + by = components["prim_magnetic_field_2"].ravel() + bz = components["prim_magnetic_field_3"].ravel() # volume weighted rms magnetic field rms_b = np.sqrt( diff --git a/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py b/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py index 1b4b0077..77a8cfeb 100644 --- a/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py +++ b/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py @@ -310,19 +310,16 @@ def zero_corrected_linf_err(gold, test): analyze_status = False data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") - - # FIXME: TODO(forrestglines) For now this is hard coded - a component mapping should be done by phdf - prim_col_dict = { - "density": 0, - "pressure": 4, - } + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) rho = unyt.unyt_array( - prim[prim_col_dict["density"], :], "code_mass*code_length**-3" + components["prim_density"].ravel(), "code_mass*code_length**-3" ) pres = unyt.unyt_array( - prim[prim_col_dict["pressure"], :], + components["prim_pressure"].ravel(), "code_mass*code_length**-1*code_time**-2", ) @@ -364,19 +361,16 @@ def zero_corrected_linf_err(gold, test): analyze_status = False data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") - - # FIXME: TODO(forrestglines) For now this is hard coded - a component mapping should be done by phdf - prim_col_dict = { - "density": 0, - "pressure": 4, - } + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) rho = unyt.unyt_array( - prim[prim_col_dict["density"]], "code_mass*code_length**-3" + components["prim_density"].ravel(), "code_mass*code_length**-3" ) pres = unyt.unyt_array( - prim[prim_col_dict["pressure"]], + components["prim_pressure"].ravel(), "code_mass*code_length**-1*code_time**-2", ) diff --git a/tst/regression/test_suites/field_loop/field_loop.py b/tst/regression/test_suites/field_loop/field_loop.py index b752f535..07e032b0 100644 --- a/tst/regression/test_suites/field_loop/field_loop.py +++ b/tst/regression/test_suites/field_loop/field_loop.py @@ -135,13 +135,13 @@ def Analyse(self, parameters): for step in range(len(all_cfgs)): outname = get_outname(all_cfgs[step]) - data_filename = f"{parameters.output_path}/{outname}.hst" + data_filename = f"{parameters.output_path}/{outname}.out1.hst" data = np.genfromtxt(data_filename) res, method = all_cfgs[step] row = method_cfgs.index(method) - p[row, 0].plot(data[:, 0], data[:, 8] / data[0, 8], label=outname) - p[row, 1].plot(data[:, 0], data[:, 10], label=outname) + p[row, 0].plot(data[:, 0], data[:, 10] / data[0, 10], label=outname) + p[row, 1].plot(data[:, 0], data[:, 12], label=outname) p[0, 0].set_title("Emag(t)/Emag(0)") p[0, 1].set_title("rel DivB") diff --git a/tst/regression/test_suites/riemann_hydro/riemann_hydro.py b/tst/regression/test_suites/riemann_hydro/riemann_hydro.py index 9d0fc1f4..1a926371 100644 --- a/tst/regression/test_suites/riemann_hydro/riemann_hydro.py +++ b/tst/regression/test_suites/riemann_hydro/riemann_hydro.py @@ -58,7 +58,6 @@ class TestCase(utils.test_case.TestCaseAbs): def Prepare(self, parameters, step): - method, init_cond = all_cfgs[step - 1] nx1 = method["nx1"] @@ -126,10 +125,13 @@ def Analyse(self, parameters): data_filename = f"{parameters.output_path}/parthenon.{step + 1}.final.phdf" data_file = phdf.phdf(data_filename) - prim = data_file.Get("prim") - rho = prim[0] - vx = prim[1] - pres = prim[4] + # Flatten=true (default) is currently (Sep 24) broken so we manually flatten + components = data_file.GetComponents( + data_file.Info["ComponentNames"], flatten=False + ) + rho = components["prim_density"].ravel() + vx = components["prim_velocity_1"].ravel() + pres = components["prim_pressure"].ravel() zz, yy, xx = data_file.GetVolumeLocations() label = ( diff --git a/tst/regression/test_suites/turbulence/turbulence.py b/tst/regression/test_suites/turbulence/turbulence.py index eddbd38e..c5a492a1 100644 --- a/tst/regression/test_suites/turbulence/turbulence.py +++ b/tst/regression/test_suites/turbulence/turbulence.py @@ -22,7 +22,6 @@ class TestCase(utils.test_case.TestCaseAbs): def Prepare(self, parameters, step): - parameters.driver_cmd_line_args = [ "parthenon/output2/dt=-1", "parthenon/output3/dt=-1", @@ -31,7 +30,6 @@ def Prepare(self, parameters, step): return parameters def Analyse(self, parameters): - sys.path.insert( 1, parameters.parthenon_path @@ -40,17 +38,17 @@ def Analyse(self, parameters): success = True - data_filename = f"{parameters.output_path}/parthenon.hst" + data_filename = f"{parameters.output_path}/parthenon.out1.hst" data = np.genfromtxt(data_filename) # Check Ms if not (data[-1, -3] > 0.45 and data[-1, -3] < 0.50): - print("ERROR: Mismatch in Ms") + print(f"ERROR: Mismatch in Ms={data[-1, -3]}") success = False # Check Ma if not (data[-1, -2] > 12.8 and data[-1, -2] < 13.6): - print("ERROR: Mismatch in Ma") + print(f"ERROR: Mismatch in Ma={data[-1, -2]}") success = False return success