Skip to content

Commit 9ef9c1b

Browse files
committed
Add monitor arg to restart_job
1 parent 85efde8 commit 9ef9c1b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

smartsim/_core/control/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def _launch_step(
588588

589589
if self._jobs.query_restart(entity.name):
590590
logger.debug(f"Restarting {entity.name}")
591-
self._jobs.restart_job(job_step.name, job_id, entity.name, is_task)
591+
self._jobs.restart_job(job_step.name, job_id, entity.name, is_task, monitor)
592592
else:
593593
logger.debug(f"Launching {entity.name}")
594594
self._jobs.add_job(job_step.name, job_id, entity, is_task, monitor)

smartsim/_core/control/jobmanager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def restart_job(
271271
job_id: str | None,
272272
entity_name: str,
273273
is_task: bool = True,
274+
monitor: bool = True,
274275
) -> None:
275276
"""Function to reset a job to record history and be
276277
ready to launch again.
@@ -279,6 +280,7 @@ def restart_job(
279280
:param job_id: new job id
280281
:param entity_name: name of the entity of the job
281282
:param is_task: process monitored by TaskManager (True) or the WLM (True)
283+
:param monitor: boolean to monitor job
282284
283285
"""
284286
with self._lock:
@@ -290,6 +292,8 @@ def restart_job(
290292
self.db_jobs[entity_name] = job
291293
else:
292294
self.jobs[entity_name] = job
295+
if monitor:
296+
self.monitor_jobs[entity_name] = job
293297

294298
def get_db_host_addresses(self) -> dict[str, list[str]]:
295299
"""Retrieve the list of hosts for the database

0 commit comments

Comments
 (0)