Skip to content

Commit 6ace042

Browse files
committed
feat(hpc): guard SLURM submit mode inside submitted jobs
1 parent 318969e commit 6ace042

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

CodeEntropy/config/runtime.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ def run_entropy_workflow(self) -> None:
258258

259259
args = self._config_manager.resolve(args, run_config)
260260

261+
if getattr(args, "submit", False):
262+
if os.environ.get("CODEENTROPY_SUBMITTED_JOB") == "1":
263+
run_logger.info(
264+
"Already running inside submitted SLURM job; "
265+
"continuing workflow."
266+
)
267+
else:
268+
HPCDaskManager(args).submit_master()
269+
return
270+
261271
log_level = (
262272
logging.DEBUG if getattr(args, "verbose", False) else logging.INFO
263273
)
@@ -268,11 +278,6 @@ def run_entropy_workflow(self) -> None:
268278

269279
self._validate_required_args(args)
270280

271-
if getattr(args, "submit", False):
272-
self._config_manager._check_parallel_frame_options(args)
273-
HPCDaskManager(args).submit_master()
274-
return
275-
276281
self.print_args_table(args)
277282

278283
universe_operations = UniverseOperations()
@@ -305,6 +310,7 @@ def run_entropy_workflow(self) -> None:
305310
except Exception:
306311
logger.error("Run arguments at failure could not be serialized")
307312

313+
logger.exception("Fatal error during entropy calculation")
308314
raise RuntimeError("CodeEntropyRunner encountered an error") from exc
309315

310316
@staticmethod

0 commit comments

Comments
 (0)