Skip to content
104 changes: 104 additions & 0 deletions .github/workflows/TestSuites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,110 @@ jobs:
- name: Build
run: cmake --build AutoPasDM/build-ci --parallel 2

- name: Build original md-flexible reference
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
CC=gcc CXX=g++ cmake -S AutoPas -B AutoPas/build-reference -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DAUTOPAS_BUILD_EXAMPLES=ON \
-DAUTOPAS_BUILD_TESTS=OFF \
-DAUTOPAS_BUILD_MD_LIBRARY=ON \
-DAUTOPAS_BUILD_SPH_LIBRARY=ON \
-DAUTOPAS_OPENMP=ON \
-DAUTOPAS_ENABLE_ENERGY_MEASUREMENTS=OFF \
-DAUTOPAS_INTERNODE_TUNING=ON \
-DMD_FLEXIBLE_FUNCTOR_AUTOVEC=ON \
-DMD_FLEXIBLE_MODE=SINGLESITE \
-DMD_FLEXIBLE_USE_MPI=ON
cmake --build AutoPas/build-reference --target md-flexible --parallel 2

- name: Compare AutoPas and AutoPasDM simulations
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
python3 AutoPasDM/examples/md-flexible/tests/scripts/run_load_balancing_regression.py \
--reference AutoPas/build-reference/examples/md-flexible/md-flexible \
--distributed AutoPasDM/build-ci/examples/md-flexible/md-flexible \
--config AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_load_balancing_compare.yaml \
--ranks 8

- name: Compare 3D forces between AutoPas and AutoPasDM
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
python3 AutoPasDM/examples/md-flexible/tests/scripts/run_md_flexible_comparison.py \
--reference AutoPas/build-reference/examples/md-flexible/md-flexible \
--distributed AutoPasDM/build-ci/examples/md-flexible/md-flexible \
--config AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_force_compare_3d.yaml \
--ranks 8

- name: Compare dynamic simulations between AutoPas and AutoPasDM
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
python3 AutoPasDM/examples/md-flexible/tests/scripts/run_md_flexible_comparison.py \
--reference AutoPas/build-reference/examples/md-flexible/md-flexible \
--distributed AutoPasDM/build-ci/examples/md-flexible/md-flexible \
--config AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_dynamic_compare.yaml \
--ranks 8

- name: Compare thermostat between AutoPas and AutoPasDM
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
output_dir="${RUNNER_TEMP}/thermostat-comparison"
python3 AutoPasDM/examples/md-flexible/tests/scripts/run_md_flexible_comparison.py \
--reference AutoPas/build-reference/examples/md-flexible/md-flexible \
--distributed AutoPasDM/build-ci/examples/md-flexible/md-flexible \
--config AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_thermostat_compare.yaml \
--reference-ranks 1 \
--distributed-ranks 4 \
--keep-output "$output_dir"
python3 AutoPasDM/examples/md-flexible/tests/scripts/compare_vtk_thermostat.py \
"$output_dir/reference" "$output_dir/distributed"

- name: Check reflective boundaries and wall forces
if: matrix.config.name == 'GCC-Release-OMP-SingleSite'
run: |
set -euo pipefail
executable="${GITHUB_WORKSPACE}/AutoPasDM/build-ci/examples/md-flexible/md-flexible"
config="${GITHUB_WORKSPACE}/AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_reflective_compare.yaml"
output_dir="${RUNNER_TEMP}/reflective-comparison"
mkdir -p "$output_dir/np1" "$output_dir/np8"
mpirun -np 1 "$executable" --yaml-filename "$config" \
--vtk-output-folder "$output_dir/np1"
mpirun -np 8 "$executable" --yaml-filename "$config" \
--vtk-output-folder "$output_dir/np8"
python3 AutoPasDM/examples/md-flexible/tests/scripts/compare_vtk_forces.py \
"$output_dir/np1" "$output_dir/np8"
python3 AutoPasDM/examples/md-flexible/tests/scripts/check_reflective_forces.py \
"$output_dir/np8"

- name: Build original multi-site md-flexible reference
if: matrix.config.name == 'GCC-Release-OMP-MultiSite'
run: |
CC=gcc CXX=g++ cmake -S AutoPas -B AutoPas/build-reference-multisite -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DAUTOPAS_BUILD_EXAMPLES=ON \
-DAUTOPAS_BUILD_TESTS=OFF \
-DAUTOPAS_BUILD_MD_LIBRARY=ON \
-DAUTOPAS_BUILD_SPH_LIBRARY=ON \
-DAUTOPAS_OPENMP=ON \
-DAUTOPAS_ENABLE_ENERGY_MEASUREMENTS=OFF \
-DAUTOPAS_INTERNODE_TUNING=ON \
-DMD_FLEXIBLE_FUNCTOR_AUTOVEC=ON \
-DMD_FLEXIBLE_FUNCTOR_AVX=OFF \
-DMD_FLEXIBLE_FUNCTOR_HWY=OFF \
-DMD_FLEXIBLE_FUNCTOR_SVE=OFF \
-DMD_FLEXIBLE_MODE=MULTISITE \
-DMD_FLEXIBLE_USE_MPI=ON
cmake --build AutoPas/build-reference-multisite --target md-flexible --parallel 2

- name: Compare multi-site simulations between AutoPas and AutoPasDM
if: matrix.config.name == 'GCC-Release-OMP-MultiSite'
run: |
python3 AutoPasDM/examples/md-flexible/tests/scripts/run_md_flexible_comparison.py \
--reference AutoPas/build-reference-multisite/examples/md-flexible/md-flexible \
--distributed AutoPasDM/build-ci/examples/md-flexible/md-flexible \
--config AutoPasDM/examples/md-flexible/tests/yamlTestFiles/autopasdm_multisite_compare.yaml \
--ranks 8

- name: Run full CTest suite
if: matrix.config.test_scope == 'full'
run: |
Expand Down
79 changes: 62 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ ctest --test-dir build --output-on-failure
### md-flexible 3D force regression

A small end-to-end regression input is available at
`examples/md-flexible/input/autopasdm_force_compare_3d.yaml`. It compares a single-rank
reference run with an eight-rank `2 x 2 x 2` decomposition and exercises internal
`examples/md-flexible/tests/yamlTestFiles/autopasdm_force_compare_3d.yaml`. It exercises internal
face, edge, and corner interactions as well as periodic boundaries in all three
dimensions.
dimensions. The force output can be compared across AutoPasDM decompositions as shown
below. The same input is also used in CI to compare original md-flexible and AutoPasDM
with eight MPI ranks.

From `build/examples/md-flexible`:

Expand All @@ -147,25 +148,37 @@ rm -rf force_compare_3d/np1 force_compare_3d/np8
mkdir -p force_compare_3d/np1 force_compare_3d/np8

./md-flexible \
--yaml-filename input/autopasdm_force_compare_3d.yaml \
--yaml-filename ../../../examples/md-flexible/tests/yamlTestFiles/autopasdm_force_compare_3d.yaml \
--vtk-output-folder force_compare_3d/np1

mpirun -np 8 ./md-flexible \
--yaml-filename input/autopasdm_force_compare_3d.yaml \
--yaml-filename ../../../examples/md-flexible/tests/yamlTestFiles/autopasdm_force_compare_3d.yaml \
--vtk-output-folder force_compare_3d/np8

python3 scripts/compare_vtk_forces.py \
python3 ../../../examples/md-flexible/tests/scripts/compare_vtk_forces.py \
force_compare_3d/np1 \
force_compare_3d/np8
```

The comparison should report the same owned-particle IDs and forces within the
configured tolerance.
The decomposition comparison should report the same owned-particle IDs and forces
within the configured tolerance. For an original-AutoPas-vs-AutoPasDM comparison, run
from the repository root after building both MPI-enabled md-flexible executables:

```bash
python3 examples/md-flexible/tests/scripts/run_md_flexible_comparison.py \
--reference /path/to/AutoPas/build/examples/md-flexible/md-flexible \
--distributed /path/to/AutoPasDM/build/examples/md-flexible/md-flexible \
--config examples/md-flexible/tests/yamlTestFiles/autopasdm_force_compare_3d.yaml \
--ranks 8
```

The comparison checks IDs, types, positions, velocities, and forces in the final
output, without requiring the same owner rank.

### md-flexible load-balancing regression

`examples/md-flexible/input/autopasdm_load_balancing_compare.yaml` and
`scripts/run_load_balancing_regression.py` compare the bundled AutoPasDM
`examples/md-flexible/tests/yamlTestFiles/autopasdm_load_balancing_compare.yaml` and
`examples/md-flexible/tests/scripts/run_load_balancing_regression.py` compare the bundled AutoPasDM
integration against an MPI-enabled original md-flexible build. Both decompositions
must adapt and the final global particle state is compared independently of the exact
owner rank, because runtime-based work measurements can produce different adaptive
Expand All @@ -174,17 +187,35 @@ split positions.
For example:

```bash
python3 scripts/run_load_balancing_regression.py \
python3 examples/md-flexible/tests/scripts/run_load_balancing_regression.py \
--reference /path/to/AutoPas/build/examples/md-flexible/md-flexible \
--distributed ./md-flexible \
--config input/autopasdm_load_balancing_compare.yaml \
--config examples/md-flexible/tests/yamlTestFiles/autopasdm_load_balancing_compare.yaml \
--ranks 8
```

The regression uses the general `run_md_flexible_comparison.py` runner and additionally
requires both load balancers to move at least one subdomain boundary.

### md-flexible thermostat comparison

CI compares the original one-rank thermostat run with a four-rank AutoPasDM run using
`examples/md-flexible/tests/yamlTestFiles/autopasdm_thermostat_compare.yaml`. It compares particle velocities and checks that
both results reach the expected global temperature. The runner accepts different rank
counts with `--reference-ranks` and `--distributed-ranks`.

### md-flexible dynamic simulation comparison

`examples/md-flexible/tests/yamlTestFiles/autopasdm_dynamic_compare.yaml` advances a small 3D system
for 100 steps with a non-zero time step. Three particles cross internal MPI boundaries
in x, y, and z, while another pair exercises Lennard-Jones force evaluation. CI runs
this input with eight ranks in both implementations and compares the final global
particle states by ID.

### md-flexible reflective-boundary regression

The single-site md-flexible example contains a reflective-wall regression input at
`examples/md-flexible/input/autopasdm_reflective_compare.yaml`. It places particles near
`examples/md-flexible/tests/yamlTestFiles/autopasdm_reflective_compare.yaml`. It places particles near
all six global faces and two opposite corners. With sigma = epsilon = 1 and a wall
distance of 0.5, the expected force component from each reflective wall is exactly
24. The same setup can be compared between one rank and an eight-rank `2 x 2 x 2`
Expand All @@ -197,23 +228,37 @@ rm -rf reflective_compare/np1 reflective_compare/np8
mkdir -p reflective_compare/np1 reflective_compare/np8

./md-flexible \
--yaml-filename input/autopasdm_reflective_compare.yaml \
--yaml-filename ../../../examples/md-flexible/tests/yamlTestFiles/autopasdm_reflective_compare.yaml \
--vtk-output-folder reflective_compare/np1

mpirun -np 8 ./md-flexible \
--yaml-filename input/autopasdm_reflective_compare.yaml \
--yaml-filename ../../../examples/md-flexible/tests/yamlTestFiles/autopasdm_reflective_compare.yaml \
--vtk-output-folder reflective_compare/np8

python3 scripts/compare_vtk_forces.py \
python3 ../../../examples/md-flexible/tests/scripts/compare_vtk_forces.py \
reflective_compare/np1 \
reflective_compare/np8

python3 scripts/check_reflective_forces.py reflective_compare/np8
python3 ../../../examples/md-flexible/tests/scripts/check_reflective_forces.py reflective_compare/np8
```

The first script checks decomposition independence. The second checks the forces
against the analytical values of the reflective regression setup.

The reflective Lennard-Jones wall force is an AutoPasDM application feature and is not
implemented by the original md-flexible reference. CI therefore checks this path within
AutoPasDM: it compares one-rank and eight-rank forces and checks the eight-rank result
against the analytical wall forces.

### md-flexible multi-site comparison

`examples/md-flexible/tests/yamlTestFiles/autopasdm_multisite_compare.yaml` contains two tri-site
molecules interacting across an internal rank corner. The short run exercises the
multi-site force calculation, torque generation, and rotational integration. CI builds
the original md-flexible reference in multi-site mode and compares the final molecular
state with an eight-rank AutoPasDM run, including quaternions, angular velocities, and
torques.

The test build can be disabled with `-DAUTOPASDM_BUILD_TESTS=OFF`.

See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the current architecture,
Expand Down
10 changes: 5 additions & 5 deletions examples/md-flexible/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ if(AUTOPASDM_BUILD_TESTS)
${MPIEXEC_NUMPROC_FLAG} 2
${MPIEXEC_PREFLAGS}
$<TARGET_FILE:md-flexible>
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/input/autopasdm_all_load_balancer.yaml"
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/tests/yamlTestFiles/autopasdm_all_load_balancer.yaml"
${MPIEXEC_POSTFLAGS}
CONFIGURATIONS checkExamples
)
Expand All @@ -249,7 +249,7 @@ if(AUTOPASDM_BUILD_TESTS)
${MPIEXEC_NUMPROC_FLAG} 2
${MPIEXEC_PREFLAGS}
$<TARGET_FILE:md-flexible>
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/input/autopasdm_mpi_tuning.yaml"
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/tests/yamlTestFiles/autopasdm_mpi_tuning.yaml"
${MPIEXEC_POSTFLAGS}
CONFIGURATIONS checkExamples
)
Expand Down Expand Up @@ -278,7 +278,7 @@ if(AUTOPASDM_BUILD_TESTS)
${MPIEXEC_NUMPROC_FLAG} 2
${MPIEXEC_PREFLAGS}
$<TARGET_FILE:md-flexible>
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/input/autopasdm_cli_checkpoint.yaml"
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/tests/yamlTestFiles/autopasdm_cli_checkpoint.yaml"
--vtk-filename autopasdm-cli-checkpoint
--vtk-output-folder "${MDFLEX_CHECKPOINT_TEST_OUTPUT_FOLDER}"
--vtk-write-frequency 1
Expand All @@ -303,7 +303,7 @@ if(AUTOPASDM_BUILD_TESTS)
${MPIEXEC_NUMPROC_FLAG} 2
${MPIEXEC_PREFLAGS}
$<TARGET_FILE:md-flexible>
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/input/autopasdm_cli_checkpoint_restart.yaml"
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/tests/yamlTestFiles/autopasdm_cli_checkpoint_restart.yaml"
--checkpoint "${MDFLEX_CHECKPOINT_TEST_FILE}"
--vtk-filename autopasdm-cli-checkpoint-restart
--vtk-output-folder "${MDFLEX_CHECKPOINT_TEST_OUTPUT_FOLDER}"
Expand Down Expand Up @@ -331,7 +331,7 @@ if(AUTOPASDM_BUILD_TESTS)
${MPIEXEC_NUMPROC_FLAG} 1
${MPIEXEC_PREFLAGS}
$<TARGET_FILE:md-flexible>
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/input/autopasdm_cli_checkpoint_restart.yaml"
--yaml-filename "${CMAKE_CURRENT_SOURCE_DIR}/tests/yamlTestFiles/autopasdm_cli_checkpoint_restart.yaml"
--checkpoint "${MDFLEX_CHECKPOINT_TEST_FILE}"
--vtk-filename autopasdm-cli-checkpoint-restart-one-rank
--vtk-output-folder "${MDFLEX_CHECKPOINT_TEST_OUTPUT_FOLDER}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
2. the final owned-particle state agrees by particle ID within tolerance.

Example:
python3 scripts/run_load_balancing_regression.py \
python3 tests/scripts/run_load_balancing_regression.py \
--reference /path/to/AutoPas/build/examples/md-flexible/md-flexible \
--distributed ./md-flexible \
--config input/autopasdm_load_balancing_compare.yaml \
--config tests/yamlTestFiles/autopasdm_load_balancing_compare.yaml \
--ranks 8

For SLURM, e.g. use:
Expand Down
Loading
Loading