Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue a warning when get_status failed to resolve #842

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/ramble/ramble/workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def set_application(self, app_inst):

def get_status(self, workspace):
"""Return status of a given job"""
return None
raise NotImplementedError(
f"The workflow manager {self.name} does not support `get_status`"
)

def conditional_expand(self, templates):
"""Return a (potentially empty) list of expanded strings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, file_path):
name="slurm_execute_template_path",
default="slurm_experiment_sbatch.tpl",
description="Path to the custom template for generating the slurm sbatch job script. "
"If a relative path is given, it is searched under the workflow manager's source directory. "
"For a relative path, it is searched under the workflow manager's source directory. "
"The path can contain workspace path variables such as $workspace_config.",
)

Expand Down Expand Up @@ -190,6 +190,11 @@ def get_status(self, workspace):
wm_status = _STATUS_MAP.get(wm_status_raw)
if wm_status is not None and hasattr(experiment_status, wm_status):
status = getattr(experiment_status, wm_status)
if status == experiment_status.UNRESOLVED:
logger.warn(
f"The slurm workflow manager failed to resolve the status of job {job_id}. "
"Enable debug mode (`ramble -d`) for more detailed error messages."
)
return status


Expand Down
Loading