handle the cases where num steps do not match with the reference log files

This commit is contained in:
Trung Nguyen
2024-10-14 16:05:21 -05:00
parent b9e4c6e1e7
commit c533ca0af1
4 changed files with 34 additions and 27 deletions

View File

@ -19,7 +19,7 @@ jobs:
strategy: strategy:
max-parallel: 4 max-parallel: 4
matrix: matrix:
idx: [ 'pair', 'fix', 'compute', 'misc' ] idx: [ 'pair', 'compute', 'misc' ]
steps: steps:
- name: Checkout repository - name: Checkout repository

View File

@ -7,32 +7,19 @@
tolerance: tolerance:
PotEng: PotEng:
abs: 1e-4 abs: 1e-4
rel: 1e-7 rel: 1e-6
TotEng: TotEng:
abs: 1e-4 abs: 1e-4
rel: 1e-7 rel: 1e-6
Press: Press:
abs: 1e-4 abs: 1e-4
rel: 1e-7 rel: 1e-6
Temp: Temp:
abs: 1e-4 abs: 1e-4
rel: 1e-7 rel: 1e-6
E_vdwl: E_vdwl:
abs: 1e-3 abs: 1e-3
rel: 1e-7 rel: 1e-6
overrides:
in.rigid.tnr:
Temp:
abs: 1e-3
rel: 1e-5
Press:
abs: 1e-2
rel: 1e-4
skip:
[
in.min.box,
in.icos,
]
timeout: 120 timeout: 120
nugget: 1.0 nugget: 1.0

View File

@ -21,12 +21,6 @@
abs: 1e-3 abs: 1e-3
rel: 1e-7 rel: 1e-7
skip:
[
in.min.box,
in.icos,
]
timeout: 120 timeout: 120
nugget: 1.0 nugget: 1.0
epsilon: 1e-16 epsilon: 1e-16

View File

@ -584,6 +584,7 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file
failed_rel_output = [] failed_rel_output = []
num_checks = 0 num_checks = 0
mismatched_columns = False mismatched_columns = False
mismatched_num_steps = False
for irun in range(num_runs): for irun in range(num_runs):
num_fields = len(thermo[irun]['keywords']) num_fields = len(thermo[irun]['keywords'])
@ -596,6 +597,13 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file
# get the total number of the thermo output lines # get the total number of the thermo output lines
nthermo_steps = len(thermo[irun]['data']) nthermo_steps = len(thermo[irun]['data'])
nthermo_steps_ref = len(thermo_ref[irun]['data'])
if nthermo_steps_ref != nthermo_steps:
logger.info(f" failed: Number of thermo steps in {logfilename} ({nthermo_steps})")
logger.info(f" is different from that in the reference log ({nthermo_steps_ref}) in run {irun}.")
mismatched_num_steps = True
continue
# get the output at the last timestep # get the output at the last timestep
thermo_step = nthermo_steps - 1 thermo_step = nthermo_steps - 1
@ -647,12 +655,30 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file
print(f" {thermo[irun]['keywords'][i].ljust(width)} {str(val).rjust(20)} {str(ref).rjust(20)} {abs_diff_check.rjust(20)} {rel_diff_check.rjust(20)}") print(f" {thermo[irun]['keywords'][i].ljust(width)} {str(val).rjust(20)} {str(ref).rjust(20)} {abs_diff_check.rjust(20)} {rel_diff_check.rjust(20)}")
# after all runs completed, or are interrupted in one of the runs (mismatched_columns = True) # after all runs completed, or are interrupted in one of the runs (mismatched_columns = True)
if mismatched_columns == True: if mismatched_columns == True:
msg = f" mismatched log files after the first run. Check both log files for more details." msg = f" mismatched columns in the log files after the first run. Check both log files for more details."
print(msg) print(msg)
logger.info(msg) logger.info(msg)
result.status = "thermo checks failed due to mismatched log files after the first run" result.status = "thermo checks failed due to mismatched log files after the first run"
results.append(result)
progress.write(f"{{ '{input}': {{ 'folder': '{input_folder}', 'status': '{result.status}', 'walltime': '{walltime}', 'walltime_norm': '{walltime_norm}' }} }}\n")
progress.close()
num_error = num_error + 1
test_id = test_id + 1
continue
# some runs that involve the minimize command that leads to different number of steps vs the reference log file
if mismatched_num_steps == True:
msg = f" mismatched num steps in the log files. Check both log files for more details."
print(msg)
logger.info(msg)
result.status = "thermo checks failed due to mismatched log files "
results.append(result)
progress.write(f"{{ '{input}': {{ 'folder': '{input_folder}', 'status': '{result.status}', 'walltime': '{walltime}', 'walltime_norm': '{walltime_norm}' }} }}\n")
progress.close()
num_error = num_error + 1
test_id = test_id + 1
continue
result.status = "" result.status = ""
if num_abs_failed > 0: if num_abs_failed > 0: