split randomly the pair input list by batch size
This commit is contained in:
5
.github/workflows/kokkos-regression.yaml
vendored
5
.github/workflows/kokkos-regression.yaml
vendored
@ -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,8 +94,8 @@ 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 --batch-size=100 \
|
--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"
|
||||||
cat input-list-fix-*-kk.txt > input-list-fix-kk.txt
|
cat input-list-fix-*-kk.txt > input-list-fix-kk.txt
|
||||||
|
|
||||||
export OMP_PROC_BIND=false
|
export OMP_PROC_BIND=false
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ if __name__ == "__main__":
|
|||||||
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 - 1) / batch_size)
|
num_batches = int(len(input_list) / batch_size)
|
||||||
if num_batches < 2:
|
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:
|
||||||
@ -77,13 +78,15 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
for idx in range(num_batches):
|
for idx in range(num_batches):
|
||||||
with open(f"input-list-{feature}-{idx}-kk.txt", "w") as f:
|
with open(f"input-list-{feature}-{idx}-kk.txt", "w") as f:
|
||||||
start = idx * batch_size
|
if len(input_list) > batch_size:
|
||||||
for i in range(batch_size):
|
sampled = random.sample(input_list, batch_size)
|
||||||
if start + i < len(input_list):
|
else:
|
||||||
input = input_list[start + i]
|
sampled = input_list
|
||||||
if input != "":
|
for input in sampled:
|
||||||
f.write(f"{input}\n")
|
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' ]
|
||||||
|
|||||||
Reference in New Issue
Block a user