split pair list into 2 separate lists and use 5 jobs for more even time balancing

This commit is contained in:
Trung Nguyen
2024-10-25 23:22:25 -05:00
parent f09a9c1c2a
commit b725c01c0d
2 changed files with 25 additions and 8 deletions

View File

@ -17,9 +17,9 @@ jobs:
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy:
max-parallel: 4
max-parallel: 5
matrix:
idx: [ 'pair', 'fix', 'compute', 'misc' ]
idx: [ 'pair-0', 'pair-1', 'fix', 'compute', 'misc' ]
steps:
- name: Checkout repository
@ -93,8 +93,10 @@ jobs:
run: |
source linuxenv/bin/activate
python3 tools/regression-tests/get_kokkos_input.py \
--examples-top-level=examples \
--examples-top-level=examples --batch-size=100 \
--filter-out="balance;fire;gcmc;granregion;mdi;mliap;neb;pace;prd;pour;python;snap"
cat input-list-fix-1-kk.txt >> input-list-fix-0-kk.txt
mv input-list-fix-0-kk.txt input-list-fix-kk.txt
python3 tools/regression-tests/run_tests.py \
--lmp-bin=build/lmp \

View File

@ -55,20 +55,35 @@ if __name__ == "__main__":
parser = ArgumentParser()
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("--batch-size", dest="batch_size", default=50, help="Batch size of scripts per input list")
args = parser.parse_args()
example_toplevel = args.example_toplevel
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
features = [ 'pair', 'fix', 'compute' ]
for feature in features:
input_list = []
generate_list(feature, example_toplevel, filter_out, input_list)
with open(f"input-list-{feature}-kk.txt", "w") as f:
for input in input_list:
if input != "":
f.write(f"{input}\n")
num_batches = int((len(input_list) + batch_size - 1) / batch_size)
if num_batches < 2:
with open(f"input-list-{feature}-kk.txt", "w") as f:
for input in input_list:
if input != "":
f.write(f"{input}\n")
else:
for idx in range(num_batches):
with open(f"input-list-{feature}-{idx}-kk.txt", "w") as f:
start = idx * batch_size
for i in range(batch_size):
if start + i < len(input_list):
input = input_list[start + i]
if 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
features = [ 'angle', 'bond', 'dihedral', 'improper', 'min' ]