Expanded the tests for more subfolders, need to check if there is an existing log file with matching nprocs
This commit is contained in:
@ -146,6 +146,7 @@ def get_lammps_build_configuration(lmp_binary):
|
|||||||
cmd_str = lmp_binary + " -h"
|
cmd_str = lmp_binary + " -h"
|
||||||
p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True)
|
p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True)
|
||||||
output = p.stdout.split('\n')
|
output = p.stdout.split('\n')
|
||||||
|
packages = ""
|
||||||
reading = False
|
reading = False
|
||||||
row = 0
|
row = 0
|
||||||
for l in output:
|
for l in output:
|
||||||
@ -153,9 +154,11 @@ def get_lammps_build_configuration(lmp_binary):
|
|||||||
if l == "Installed packages:":
|
if l == "Installed packages:":
|
||||||
reading = True
|
reading = True
|
||||||
n = row
|
n = row
|
||||||
|
if "List of individual style options" in l:
|
||||||
|
reading = False
|
||||||
if reading == True and row > n:
|
if reading == True and row > n:
|
||||||
packages = l.strip()
|
packages += l.strip() + " "
|
||||||
break
|
|
||||||
if "OS:" in l:
|
if "OS:" in l:
|
||||||
operating_system = l
|
operating_system = l
|
||||||
if "Git info" in l:
|
if "Git info" in l:
|
||||||
@ -163,6 +166,8 @@ def get_lammps_build_configuration(lmp_binary):
|
|||||||
|
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
|
packages = packages.strip()
|
||||||
|
|
||||||
row = 0
|
row = 0
|
||||||
compile_flags = ""
|
compile_flags = ""
|
||||||
for l in output:
|
for l in output:
|
||||||
@ -292,6 +297,7 @@ def iterate(input_list, config, removeAnnotatedInput=False):
|
|||||||
thermo_ref = extract_data_to_yaml(file)
|
thermo_ref = extract_data_to_yaml(file)
|
||||||
num_runs_ref = len(thermo_ref)
|
num_runs_ref = len(thermo_ref)
|
||||||
else:
|
else:
|
||||||
|
print(f"Cannot find reference log file with {pattern}")
|
||||||
# read in the thermo yaml output from the working directory
|
# read in the thermo yaml output from the working directory
|
||||||
thermo_ref_file = 'thermo.' + input + '.yaml'
|
thermo_ref_file = 'thermo.' + input + '.yaml'
|
||||||
file_exist = os.path.isfile(thermo_ref_file)
|
file_exist = os.path.isfile(thermo_ref_file)
|
||||||
@ -385,7 +391,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
lmp_binary = args.lmp_binary
|
lmp_binary = os.path.abspath(args.lmp_binary)
|
||||||
config_file= args.config_file
|
config_file= args.config_file
|
||||||
genref = args.genref
|
genref = args.genref
|
||||||
|
|
||||||
@ -419,15 +425,26 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# append the example subfolders depending on the installed packages
|
# append the example subfolders depending on the installed packages
|
||||||
if 'MOLECULE' in packages:
|
if 'MOLECULE' in packages:
|
||||||
molecule_package = True
|
|
||||||
example_subfolders.append('../../examples/micelle')
|
example_subfolders.append('../../examples/micelle')
|
||||||
|
|
||||||
|
#if 'ASPHERE' in packages:
|
||||||
|
# example_subfolders.append('../../examples/ASPHERE/ellipsoid')
|
||||||
|
|
||||||
|
if 'COLLOID' in packages:
|
||||||
|
example_subfolders.append('../../examples/colloid')
|
||||||
|
|
||||||
|
if 'DIPOLE' in packages:
|
||||||
|
example_subfolders.append('../../examples/dipole')
|
||||||
|
|
||||||
|
if 'MANYBODY' in packages:
|
||||||
|
example_subfolders.append('../../examples/tersoff')
|
||||||
|
|
||||||
if inplace_input == True:
|
if inplace_input == True:
|
||||||
|
|
||||||
# save current working dir
|
# save current working dir
|
||||||
p = subprocess.run("pwd", shell=True, text=True, capture_output=True)
|
p = subprocess.run("pwd", shell=True, text=True, capture_output=True)
|
||||||
pwd = p.stdout.split('\n')[0]
|
pwd = p.stdout.split('\n')[0]
|
||||||
print("Working dir" + pwd)
|
print("Working directory: " + pwd)
|
||||||
|
|
||||||
# change dir to a folder under examples/
|
# change dir to a folder under examples/
|
||||||
# TODO: loop through the subfolders under examples/, depending on the installed packages
|
# TODO: loop through the subfolders under examples/, depending on the installed packages
|
||||||
|
|||||||
Reference in New Issue
Block a user