Skip to content

Commit 75bce46

Browse files
Merge pull request #842 from linsword13/slurm-status
Issue a warning when `get_status` failed to resolve
2 parents 6d67f64 + 25e2ea0 commit 75bce46

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/ramble/ramble/workflow_manager.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def set_application(self, app_inst):
4747

4848
def get_status(self, workspace):
4949
"""Return status of a given job"""
50-
return None
50+
raise NotImplementedError(
51+
f"The workflow manager {self.name} does not support `get_status`"
52+
)
5153

5254
def conditional_expand(self, templates):
5355
"""Return a (potentially empty) list of expanded strings

var/ramble/repos/builtin/workflow_managers/slurm/workflow_manager.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(self, file_path):
8787
name="slurm_execute_template_path",
8888
default="slurm_experiment_sbatch.tpl",
8989
description="Path to the custom template for generating the slurm sbatch job script. "
90-
"If a relative path is given, it is searched under the workflow manager's source directory. "
90+
"For a relative path, it is searched under the workflow manager's source directory. "
9191
"The path can contain workspace path variables such as $workspace_config.",
9292
)
9393

@@ -207,6 +207,11 @@ def get_status(self, workspace):
207207
wm_status = _STATUS_MAP.get(wm_status_raw)
208208
if wm_status is not None and hasattr(experiment_status, wm_status):
209209
status = getattr(experiment_status, wm_status)
210+
if status == experiment_status.UNRESOLVED:
211+
logger.warn(
212+
f"The slurm workflow manager failed to resolve the status of job {job_id}. "
213+
"Enable debug mode (`ramble -d`) for more detailed error messages."
214+
)
210215
return status
211216

212217

0 commit comments

Comments
 (0)