Used the absolute path for the lammps binary, no need for symbolic links

This commit is contained in:
Trung Nguyen
2024-01-31 11:03:23 -06:00
parent 91d292fb7c
commit cfe6afe665
2 changed files with 8 additions and 16 deletions

View File

@ -22,4 +22,3 @@
rel: 1e-7
nugget: 1.0
epsilon: 1e-16

View File

@ -320,7 +320,7 @@ def iterate(input_list, config, removeAnnotatedInput=False):
num_runs = len(thermo)
if num_runs == 0:
print(f"Failed with the unning with {input_test}. Check if the run with this input script completed normally.\n")
print(f"Failed with the running with {input_test}. Check if the run with this input script completed normally.\n")
continue
print(f"Comparing thermo output from log.lammps with the reference log {thermo_ref_file}")
@ -357,11 +357,13 @@ def iterate(input_list, config, removeAnnotatedInput=False):
rel_diff_check = "PASSED"
if quantity in config['tolerance']:
if abs_diff > float(config['tolerance'][quantity]['abs']):
abs_diff_check = "FAILED"
abs_tol = float(config['tolerance'][quantity]['abs'])
rel_tol = float(config['tolerance'][quantity]['rel'])
if abs_diff > abs_tol:
abs_diff_check = f"actual ({abs_diff:0.2e}) > expected ({abs_tol:0.2e})"
num_abs_failed = num_abs_failed + 1
if rel_diff > float(config['tolerance'][quantity]['rel']):
rel_diff_check = "FAILED"
if rel_diff > rel_tol:
rel_diff_check = f"actual ({rel_diff:0.2e}) > expected ({rel_tol:0.2e})"
num_rel_failed = num_rel_failed + 1
else:
@ -425,7 +427,7 @@ if __name__ == "__main__":
print("Needs a valid LAMMPS binary")
quit()
else:
lmp_binary = config['lmp_binary']
lmp_binary = os.path.abspath(config['lmp_binary'])
# print out the binary info
packages, operating_system, GitInfo, compile_flags = get_lammps_build_configuration(lmp_binary)
@ -492,11 +494,6 @@ if __name__ == "__main__":
print("\nEntering " + directory)
os.chdir(directory)
# create a symbolic link to the lammps binary at the present directory
if os.path.isfile("lmp") == False:
cmd_str = "ln -s " + lmp_binary + " lmp"
os.system(cmd_str)
cmd_str = "ls in.*"
p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True)
input_list = p.stdout.split('\n')
@ -509,10 +506,6 @@ if __name__ == "__main__":
num_passed = iterate(input_list, config)
passed_tests += num_passed
# unlink the symbolic link
cmd_str = "unlink lmp"
os.system(cmd_str)
# get back to the working dir
os.chdir(pwd)