Skip to content

case.qstatus will not work. #4926

@mvdebolskiy

Description

@mvdebolskiy

cime/CIME/XML/env_batch.py

Lines 1392 to 1409 in 66dd00b

def get_status(self, jobid):
batch_query = self.get_optional_child("batch_query")
if batch_query is None:
logger.warning("Batch queries not supported on this platform")
else:
cmd = self.text(batch_query) + " "
if self.has(batch_query, "per_job_arg"):
cmd += self.get(batch_query, "per_job_arg") + " "
cmd += jobid
status, out, err = run_cmd(cmd)
if status != 0:
logger.warning(
"Batch query command '{}' failed with error '{}'".format(cmd, err)
)
else:
return out.strip()

Since the root= is not specified in the self.get_optional_child call and "batch_query" is not a child of self in most cases but it's grandchild, it will return None. Since we have at list two children (one in config_batch.xml in ccs_config/machines and another one in the machine directory). The trival fix would be too loop through "batch_system" and take the last "batch_query" that is not None. Should I fire a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions