Used the absolute path for the lammps binary, no need for symbolic links
This commit is contained in:
@ -22,4 +22,3 @@
|
|||||||
rel: 1e-7
|
rel: 1e-7
|
||||||
nugget: 1.0
|
nugget: 1.0
|
||||||
epsilon: 1e-16
|
epsilon: 1e-16
|
||||||
|
|
||||||
|
|||||||
@ -320,7 +320,7 @@ def iterate(input_list, config, removeAnnotatedInput=False):
|
|||||||
|
|
||||||
num_runs = len(thermo)
|
num_runs = len(thermo)
|
||||||
if num_runs == 0:
|
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
|
continue
|
||||||
|
|
||||||
print(f"Comparing thermo output from log.lammps with the reference log {thermo_ref_file}")
|
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"
|
rel_diff_check = "PASSED"
|
||||||
|
|
||||||
if quantity in config['tolerance']:
|
if quantity in config['tolerance']:
|
||||||
if abs_diff > float(config['tolerance'][quantity]['abs']):
|
abs_tol = float(config['tolerance'][quantity]['abs'])
|
||||||
abs_diff_check = "FAILED"
|
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
|
num_abs_failed = num_abs_failed + 1
|
||||||
if rel_diff > float(config['tolerance'][quantity]['rel']):
|
if rel_diff > rel_tol:
|
||||||
rel_diff_check = "FAILED"
|
rel_diff_check = f"actual ({rel_diff:0.2e}) > expected ({rel_tol:0.2e})"
|
||||||
num_rel_failed = num_rel_failed + 1
|
num_rel_failed = num_rel_failed + 1
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -425,7 +427,7 @@ if __name__ == "__main__":
|
|||||||
print("Needs a valid LAMMPS binary")
|
print("Needs a valid LAMMPS binary")
|
||||||
quit()
|
quit()
|
||||||
else:
|
else:
|
||||||
lmp_binary = config['lmp_binary']
|
lmp_binary = os.path.abspath(config['lmp_binary'])
|
||||||
|
|
||||||
# print out the binary info
|
# print out the binary info
|
||||||
packages, operating_system, GitInfo, compile_flags = get_lammps_build_configuration(lmp_binary)
|
packages, operating_system, GitInfo, compile_flags = get_lammps_build_configuration(lmp_binary)
|
||||||
@ -492,11 +494,6 @@ if __name__ == "__main__":
|
|||||||
print("\nEntering " + directory)
|
print("\nEntering " + directory)
|
||||||
os.chdir(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.*"
|
cmd_str = "ls in.*"
|
||||||
p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True)
|
p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True)
|
||||||
input_list = p.stdout.split('\n')
|
input_list = p.stdout.split('\n')
|
||||||
@ -509,10 +506,6 @@ if __name__ == "__main__":
|
|||||||
num_passed = iterate(input_list, config)
|
num_passed = iterate(input_list, config)
|
||||||
passed_tests += num_passed
|
passed_tests += num_passed
|
||||||
|
|
||||||
# unlink the symbolic link
|
|
||||||
cmd_str = "unlink lmp"
|
|
||||||
os.system(cmd_str)
|
|
||||||
|
|
||||||
# get back to the working dir
|
# get back to the working dir
|
||||||
os.chdir(pwd)
|
os.chdir(pwd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user