From f21dec8b06faa311a312c6753a21cd0630e8897a Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 5 Aug 2024 23:40:05 -0500 Subject: [PATCH] Fixed issues with empty output, thus no Step nor Loop --- tools/regression-tests/run_tests.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tools/regression-tests/run_tests.py b/tools/regression-tests/run_tests.py index 63d16d28b2..8505458087 100644 --- a/tools/regression-tests/run_tests.py +++ b/tools/regression-tests/run_tests.py @@ -279,20 +279,15 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file # restore the nprocs value in the configuration config['nprocs'] = saved_nprocs - # check if a log.lammps file exists in the current folder - if os.path.isfile("log.lammps") == False: - logger.info(f" ERROR: No log.lammps generated with {input_test} with return code {returncode}. Check the {log_file} for the run output.\n") + if "Step" not in output or "Loop" not in output: + logger.info(f" ERROR: no Step nor Loop in the output failed. Check the {log_file} for the run output.\n") logger.info(f"\n{input_test}:") logger.info(f"\n{error}") - progress.write(f"{input}: {{ folder: {input_folder}, status: \"error, no log.lammps\" }}\n") + progress.write(f"{input}: {{ folder: {input_folder}, status: \"error, no Step nor Loop in the output.\" }}\n") progress.close() num_error = num_error + 1 test_id = test_id + 1 continue - else: - # save a copy of the log file - cmd_str = f"cp log.lammps log.{basename}.{nprocs}" - p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True) # check if the output contains ERROR if "ERROR" in output: @@ -319,6 +314,21 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file test_id = test_id + 1 continue + # check if a log.lammps file exists in the current folder + if os.path.isfile("log.lammps") == False: + logger.info(f" ERROR: No log.lammps generated with {input_test} with return code {returncode}. Check the {log_file} for the run output.\n") + logger.info(f"\n{input_test}:") + logger.info(f"\n{error}") + progress.write(f"{input}: {{ folder: {input_folder}, status: \"error, no log.lammps\" }}\n") + progress.close() + num_error = num_error + 1 + test_id = test_id + 1 + continue + else: + # save a copy of the log file + cmd_str = f"cp log.lammps log.{basename}.{nprocs}" + p = subprocess.run(cmd_str, shell=True, text=True, capture_output=True) + # process thermo output in log.lammps from the run thermo = extract_data_to_yaml("log.lammps") num_runs = len(thermo)