Merge pull request #4362 from ndtrung81/regression-test-update

Improve the Kokkos regression test workflow
This commit is contained in:
Axel Kohlmeyer
2024-11-12 18:06:48 -05:00
committed by GitHub
2 changed files with 31 additions and 11 deletions

View File

@ -2,7 +2,7 @@
name: "Kokkos OpenMP Regression Test" name: "Kokkos OpenMP Regression Test"
on: on:
pull_request: push:
branches: branches:
- develop - develop
@ -17,9 +17,9 @@ jobs:
env: env:
CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy: strategy:
max-parallel: 4 max-parallel: 6
matrix: matrix:
idx: [ 'pair', 'fix', 'compute', 'misc' ] idx: [ 'pair-0', 'pair-1', 'fix-0', 'fix-1', 'compute', 'misc' ]
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -83,6 +83,7 @@ jobs:
-D PKG_REAXFF=on \ -D PKG_REAXFF=on \
-D PKG_REPLICA=on \ -D PKG_REPLICA=on \
-D PKG_SRD=on \ -D PKG_SRD=on \
-D PKG_SPH=on \
-D PKG_VORONOI=on \ -D PKG_VORONOI=on \
-G Ninja -G Ninja
cmake --build build cmake --build build
@ -93,9 +94,10 @@ jobs:
run: | run: |
source linuxenv/bin/activate source linuxenv/bin/activate
python3 tools/regression-tests/get_kokkos_input.py \ python3 tools/regression-tests/get_kokkos_input.py \
--examples-top-level=examples \ --examples-top-level=examples --batch-size=50 \
--filter-out="balance;fire;gcmc;granregion;mdi;mliap;neb;pace;prd;pour;python;snap" --filter-out="balance;fire;gcmc;granregion;hyper;mc;mdi;mliap;neb;pace;prd;pour;python;rigid;snap;streitz;shear;ttm"
export OMP_PROC_BIND=false
python3 tools/regression-tests/run_tests.py \ python3 tools/regression-tests/run_tests.py \
--lmp-bin=build/lmp \ --lmp-bin=build/lmp \
--config-file=tools/regression-tests/config_kokkos_openmp.yaml \ --config-file=tools/regression-tests/config_kokkos_openmp.yaml \
@ -103,7 +105,7 @@ jobs:
--output-file=output-${{ matrix.idx }}.xml \ --output-file=output-${{ matrix.idx }}.xml \
--progress-file=progress-${{ matrix.idx }}.yaml \ --progress-file=progress-${{ matrix.idx }}.yaml \
--log-file=run-${{ matrix.idx }}.log \ --log-file=run-${{ matrix.idx }}.log \
--quick-max=100 --verbose --quick-max=100
tar -cvf kokkos-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml tar -cvf kokkos-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml

View File

@ -7,6 +7,7 @@
# These 4 files will be read in by the regression tester run_tests.py # These 4 files will be read in by the regression tester run_tests.py
from argparse import ArgumentParser from argparse import ArgumentParser
import random
import subprocess import subprocess
import sys import sys
@ -55,20 +56,37 @@ if __name__ == "__main__":
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument("--examples-top-level", dest="example_toplevel", default="", help="Examples top-level") parser.add_argument("--examples-top-level", dest="example_toplevel", default="", help="Examples top-level")
parser.add_argument("--filter-out", dest="filter_out", default="", help="Filter out input scripts that contain strings") parser.add_argument("--filter-out", dest="filter_out", default="", help="Filter out input scripts that contain strings")
parser.add_argument("--batch-size", dest="batch_size", default=50, help="Batch size of scripts per input list")
args = parser.parse_args() args = parser.parse_args()
example_toplevel = args.example_toplevel example_toplevel = args.example_toplevel
filter_out = args.filter_out.split(";") filter_out = args.filter_out.split(";")
batch_size = int(args.batch_size)
# print the list of the input scripts that has each feature to a separate file # print the list of the input scripts that has each feature to a separate file
features = [ 'pair', 'fix', 'compute' ] features = [ 'pair', 'fix', 'compute' ]
for feature in features: for feature in features:
input_list = [] input_list = []
generate_list(feature, example_toplevel, filter_out, input_list) generate_list(feature, example_toplevel, filter_out, input_list)
num_batches = int(len(input_list) / batch_size)
if num_batches < 2:
with open(f"input-list-{feature}-kk.txt", "w") as f: with open(f"input-list-{feature}-kk.txt", "w") as f:
for input in input_list: for input in input_list:
if input != "": if input != "":
f.write(f"{input}\n") f.write(f"{input}\n")
else:
for idx in range(num_batches):
with open(f"input-list-{feature}-{idx}-kk.txt", "w") as f:
if len(input_list) > batch_size:
sampled = random.sample(input_list, batch_size)
else:
sampled = input_list
for input in sampled:
if input != "":
if input in input_list:
input_list.remove(input)
f.write(f"{input}\n")
# combine the list of the input scripts that have these feature to a single file input-list-misc-kk.txt # combine the list of the input scripts that have these feature to a single file input-list-misc-kk.txt
features = [ 'angle', 'bond', 'dihedral', 'improper', 'min' ] features = [ 'angle', 'bond', 'dihedral', 'improper', 'min' ]