From e9ff0d34023505a7458b7d1499a68fdb46c1f141 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Fri, 11 Oct 2024 14:42:45 -0500 Subject: [PATCH] modify the kokkos workflow file --- .github/workflows/kokkos-regression.yaml | 19 +++++++-------- tools/regression-tests/get_kokkos_input.py | 27 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/kokkos-regression.yaml b/.github/workflows/kokkos-regression.yaml index 950c10b90f..57e5323b24 100644 --- a/.github/workflows/kokkos-regression.yaml +++ b/.github/workflows/kokkos-regression.yaml @@ -16,17 +16,16 @@ jobs: runs-on: ubuntu-latest env: CCACHE_DIR: ${{ github.workspace }}/.ccache - strategy: max-parallel: 4 matrix: style: [ 'pair', 'fix', 'compute', 'misc' ] - + steps: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 2 show-progress: false - name: Install extra packages @@ -43,8 +42,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} - key: linux-quick-ccache-${{ github.sha }} - restore-keys: linux-quick-ccache- + key: linux-kokkos-ccache-${{ github.sha }} + restore-keys: linux-kokkos-ccache- - name: Building LAMMPS via CMake shell: bash @@ -56,7 +55,7 @@ jobs: python3 -m pip install numpy pyyaml junit_xml cmake -S cmake -B build \ -C cmake/presets/gcc.cmake \ - -C cmake/presets/basic.cmake \ + -C cmake/presets/most.cmake \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_C_COMPILER_LAUNCHER=ccache \ -D BUILD_SHARED_LIBS=off \ @@ -67,6 +66,7 @@ jobs: -D Kokkos_ENABLE_CUDA=off \ -D PKG_COLLOID=on \ -D PKG_GRANULAR=on \ + -D PKG_PYTHON=on \ -D BUILD_OMP=yes \ -G Ninja cmake --build build @@ -83,7 +83,8 @@ jobs: --config-file=tools/regression-tests/config_kokkos_openmp.yaml \ --list-input=input-list-${{ matrix.style }}-kk.txt \ --output-file=output-${{ matrix.style }}.xml \ - --progress-file=progress-${{ matrix.style }}.yaml --log-file=run-${{ matrix.style }}.log \ + --progress-file=progress-${{ matrix.style }}.yaml \ + --log-file=run-${{ matrix.style }}.log \ --verbose tar -cvf kokkos-regression-test-${{ matrix.style }}.tar run-${{ matrix.style }}.log progress-${{ matrix.style }}.yaml output-${{ matrix.style }}.xml @@ -93,7 +94,7 @@ jobs: with: name: kokkos-regression-test-artifact-${{ matrix.style }} path: kokkos-regression-test-${{ matrix.style }}.tar - + merge: runs-on: ubuntu-latest needs: build @@ -102,5 +103,5 @@ jobs: uses: actions/upload-artifact/merge@v4 with: name: merged-kokkos-regresssion-artifact - pattern: kokkos-regression-test-artifact-* + pattern: kokkos-regression-test-artifact-* diff --git a/tools/regression-tests/get_kokkos_input.py b/tools/regression-tests/get_kokkos_input.py index 3f004bbcba..6131ef395d 100644 --- a/tools/regression-tests/get_kokkos_input.py +++ b/tools/regression-tests/get_kokkos_input.py @@ -10,6 +10,33 @@ from argparse import ArgumentParser import subprocess import sys +# in_style = fix, pair, compute, angle, bond, min +def get_list(in_style, example_toplevel): + + with open(f"input-list-{in_style}-kk.txt", "w") as f: + # find all the pair styles with the kokkos suffix + cmd_str = f"ls {example_toplevel}/../src/KOKKOS | grep -v npair | grep {in_style} | grep .cpp" + p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True) + kokkos_styles = p.stdout.split('\n') + style_names = [] + for style in kokkos_styles: + if style != "": + # replace "{in_style}_[name]_kokkos.cpp" into "[name]" + style = style.replace(f"{in_style}_","") + style = style.replace("_kokkos.cpp","") + style = style.replace("_","/") + style_names.append(style) + + for style in style_names: + cmd_str = f"grep -rl '{in_style}_style.*{style}' {example_toplevel}/*/in.* " + p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True) + input_list = p.stdout.split('\n') + input_list = ' '.join(input_list).split() + #print(f"There are {len(input_list)} input files that contains {in_style} {style}") + for input in input_list: + if input != "": + f.write(f"{input}\n") + if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("--examples-top-level", dest="example_toplevel", default="", help="Examples top-level")