diff --git a/seamm_exec/computational_environment.py b/seamm_exec/computational_environment.py index 5336edb..d2fe92e 100644 --- a/seamm_exec/computational_environment.py +++ b/seamm_exec/computational_environment.py @@ -68,7 +68,7 @@ def _slurm(): if "NTASKS_PER_NODE" not in ce: ce["NTASKS_PER_NODE"] = int(ce["NTASKS"]) // int(ce["NNODES"]) - # Expand `[i-k]` naming in nodelist + # Expand `[i-k]` naming in nodelist, eg. SLURM_NODELIST=tc[053,059,183,200] nodes = ce["NODELIST"].split(",") nodelist = [] npernode = ce["NTASKS_PER_NODE"] diff --git a/seamm_exec/exec_flowchart.py b/seamm_exec/exec_flowchart.py index 7ef88df..f57ad5e 100644 --- a/seamm_exec/exec_flowchart.py +++ b/seamm_exec/exec_flowchart.py @@ -60,7 +60,7 @@ def __init__(self, flowchart=None): self.flowchart = flowchart - def run(self, root=None): + def run(self, root=None, job_id=None): logger.info("In ExecFlowchart.run()") if not self.flowchart: raise RuntimeError("There is no flowchart to run!") @@ -77,6 +77,10 @@ def run(self, root=None): logger.info("Creating global variables space") seamm.flowchart_variables = seamm.Variables() + # Put the current time as a variable + seamm.flowchart_variables.set_variable("_start_time", time.time()) + seamm.flowchart_variables.set_variable("_job_id", job_id) + # And add the printer seamm.flowchart_variables.set_variable("printer", printer) @@ -657,7 +661,7 @@ def run( logger.info("Executing the flowchart") try: exec = ExecFlowchart(flowchart) - exec.run(root=wdir) + exec.run(root=wdir, job_id=job_id) data["state"] = "finished" except Exception as e: data["state"] = "error"