From 8d250988722b344b2bd187d63ed0dac2c593688f Mon Sep 17 00:00:00 2001 From: brockdyer03 Date: Tue, 3 Mar 2026 11:21:30 -0500 Subject: [PATCH 1/2] Nexus: Add check for failure to properly call `qmcpack` executable by checking for `'QMCPACK'` in output --- nexus/nexus/qmcpack.py | 6 ++++-- nexus/nexus/qmcpack_analyzer.py | 6 +++++- nexus/nexus/tests/test_qmcpack_simulation.py | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/nexus/nexus/qmcpack.py b/nexus/nexus/qmcpack.py index 78057a8697..878498842a 100644 --- a/nexus/nexus/qmcpack.py +++ b/nexus/nexus/qmcpack.py @@ -1151,10 +1151,10 @@ def check_sim_status(self): errors = self.errfile_text() ran_to_end = 'Total Execution' in output + run_started = 'QMCPACK' in output aborted = 'Fatal Error' in errors files_exist = True cusp_run = False - if not self.has_generic_input(): if not isinstance(self.input,TracedQmcpackInput): cusp_run = self.input.cusp_correction() @@ -1186,9 +1186,11 @@ def check_sim_status(self): #end if #end if + if not run_started: + self.warn("QMCPACK did not start properly!\n") self.succeeded = ran_to_end - self.failed = aborted + self.failed = aborted or not run_started self.finished = files_exist and (self.job.finished or ran_to_end) and not aborted if cusp_run and files_exist: diff --git a/nexus/nexus/qmcpack_analyzer.py b/nexus/nexus/qmcpack_analyzer.py index 6d3b8ed456..488a79db70 100644 --- a/nexus/nexus/qmcpack_analyzer.py +++ b/nexus/nexus/qmcpack_analyzer.py @@ -220,8 +220,12 @@ def __init__(self,arg0=None,**kwargs): ghost_atoms(*ghosts) #end if - if isinstance(arg0,Simulation): + if isinstance(arg0, Simulation): sim = arg0 + if sim.failed: + self.warn("Simulation failed, skipping analysis!") + self.info.analyzed = sim.failed + if 'analysis_request' in sim: request = sim.analysis_request.copy() else: diff --git a/nexus/nexus/tests/test_qmcpack_simulation.py b/nexus/nexus/tests/test_qmcpack_simulation.py index 40d2bcfe8d..72cf364c84 100644 --- a/nexus/nexus/tests/test_qmcpack_simulation.py +++ b/nexus/nexus/tests/test_qmcpack_simulation.py @@ -401,7 +401,10 @@ def test_check_sim_status(): assert(not sim.failed) outfile = os.path.join(tpath,sim.outfile) - out_text = 'Total Execution' + out_text = ( + 'QMCPACK\n' + 'Total Execution' + ) out = open(outfile,'w') out.write(out_text) out.close() From d91ec52a36eaf469f57afc8e53032d6328947701 Mon Sep 17 00:00:00 2001 From: brockdyer03 Date: Wed, 4 Mar 2026 08:16:36 -0500 Subject: [PATCH 2/2] Nexus: Add extra check for `self.info.analyzed` in addition to `self.analyzed` for `QmcpackAnalyzer` --- nexus/nexus/simulation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nexus/nexus/simulation.py b/nexus/nexus/simulation.py index e23a43d898..803c370e03 100644 --- a/nexus/nexus/simulation.py +++ b/nexus/nexus/simulation.py @@ -1262,7 +1262,13 @@ def progress(self,dependency_id=None): if not self.got_output and 'get_output' in nexus_core.stages: self.get_output() #end if + + analyzed = self.analyzed + if hasattr(self, "info"): # QmcpackAnalyzer uses QAInformation + analyzed |= self.info.analyzed + if not self.analyzed and 'analyze' in nexus_core.stages: + self.analyze() #end if #end if