|
DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
|
Functions | |
| _strip_json_comments (text) | |
| _load_json (path) | |
| _write_json (path, obj) | |
| _run_solver (np_count, config_path, work_dir, overrides=None, timeout=300) | |
| _read_h5_u_data (h5_path) | |
| _gather_by_orig_index (orig_idx, data) | |
| work_dir () | |
| _make_step1_config (work_dir, mesh_file=MESH_SMALL) | |
| _make_step2_config (work_dir, restart_h5_path, tag, np_count, reorder_cells=False, mesh_bisect=0, mesh_file=MESH_SMALL) | |
| _find_restart_h5 (search_dir, label="") | |
| _compare_restart_h5 (restart_a, restart_b, tol=1e-10) | |
| _run_step1 (work_dir, np_write, mesh_file=MESH_SMALL) | |
| _run_step2 (work_dir, restart_h5, tag, np_count, overrides=None, mesh_file=MESH_SMALL) | |
| work_dir_large () | |
| test_restart_redistribute_same_np (work_dir) | |
| test_restart_redistribute_different_np (work_dir) | |
| test_restart_redistribute_large_mesh_multi_np (work_dir_large) | |
Variables | |
| SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | |
| PROJECT_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, "..", "..")) | |
| BUILD_DIR = os.path.join(PROJECT_ROOT, "build") | |
| EULER_EXE = os.path.join(BUILD_DIR, "app", "euler.exe") | |
| BASE_CONFIG | |
| MESH_SMALL | |
| MESH_LARGE | |
| prefix | |
Functional test for ArrayPair redistribution via Euler solver restart.
The test verifies that DOF data written in a restart file by one MPI partition
can be correctly read by a different partition (different np), producing
identical solver behaviour.
Steps:
1. Run the Euler IV solver for 20 time steps with np=2, writing an H5 restart.
2. Load that restart and immediately write it back at np=2 (reference).
3. Load that restart and immediately write it back at np=3 (redistributed read).
4. Compare the two restart H5 files: the DOF data must match to machine precision.
The file contains three test variants: same-np reseed, cross-np redistribution,
and a large-mesh multi-np (np=4 → np=4..8) case.
Usage:
pytest test/Euler/test_restart_redistribute.py -s
# or directly:
python test/Euler/test_restart_redistribute.py
|
protected |
Compare two restart H5 files by origIndex. Returns max_diff, rel_norm.
Definition at line 261 of file test_restart_redistribute.py.
|
protected |
Find restart H5 files in directory tree.
Definition at line 248 of file test_restart_redistribute.py.
|
protected |
Reorder data rows by original index so that global ordering is canonical.
Definition at line 120 of file test_restart_redistribute.py.
|
protected |
Definition at line 55 of file test_restart_redistribute.py.
|
protected |
Config for the initial 20-step run (produces the restart).
Definition at line 138 of file test_restart_redistribute.py.
|
protected |
Config for the 1-step restart run.
Definition at line 189 of file test_restart_redistribute.py.
|
protected |
Read the DOF 'u' data from a restart H5 file. Returns (origIndex, data) where: - origIndex: 1-D array of original cell indices (global key) - data: 2-D array of DOF values, shape (nGlobal, nVars)
Definition at line 88 of file test_restart_redistribute.py.
|
protected |
Run the Euler solver via mpirun and return the process result.
Definition at line 65 of file test_restart_redistribute.py.
|
protected |
Run step 1: initial 20-step run producing a restart.
Definition at line 288 of file test_restart_redistribute.py.
|
protected |
Run step 2: load restart and immediately write it back.
Definition at line 298 of file test_restart_redistribute.py.
|
protected |
Remove // comments from JSON-with-comments (DNDS convention).
Definition at line 50 of file test_restart_redistribute.py.
|
protected |
Definition at line 60 of file test_restart_redistribute.py.
| test_restart_redistribute.test_restart_redistribute_different_np | ( | work_dir | ) |
Write restart at np=2, read at np=3 (cross-np redistribution).
Definition at line 357 of file test_restart_redistribute.py.
| test_restart_redistribute.test_restart_redistribute_large_mesh_multi_np | ( | work_dir_large | ) |
Write restart at np=4 with 20x20 mesh, read at np=4..8.
Definition at line 379 of file test_restart_redistribute.py.
| test_restart_redistribute.test_restart_redistribute_same_np | ( | work_dir | ) |
Write restart at np=2, read at np=2 with different Metis seed.
Definition at line 329 of file test_restart_redistribute.py.
| test_restart_redistribute.work_dir | ( | ) |
Create a temporary working directory for the test.
Definition at line 130 of file test_restart_redistribute.py.
| test_restart_redistribute.work_dir_large | ( | ) |
Create a temporary working directory for the large-mesh test.
Definition at line 322 of file test_restart_redistribute.py.
| test_restart_redistribute.BASE_CONFIG |
Definition at line 42 of file test_restart_redistribute.py.
| test_restart_redistribute.BUILD_DIR = os.path.join(PROJECT_ROOT, "build") |
Definition at line 40 of file test_restart_redistribute.py.
| test_restart_redistribute.EULER_EXE = os.path.join(BUILD_DIR, "app", "euler.exe") |
Definition at line 41 of file test_restart_redistribute.py.
| test_restart_redistribute.MESH_LARGE |
Definition at line 46 of file test_restart_redistribute.py.
| test_restart_redistribute.MESH_SMALL |
Definition at line 44 of file test_restart_redistribute.py.
| test_restart_redistribute.prefix |
Definition at line 419 of file test_restart_redistribute.py.
| test_restart_redistribute.PROJECT_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, "..", "..")) |
Definition at line 39 of file test_restart_redistribute.py.
| test_restart_redistribute.SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
Definition at line 38 of file test_restart_redistribute.py.