Modify resources of not-yet-running jobs (i.e. in READY
or slurm
-SUBMITTED
state)
#133
Replies: 1 comment 1 reply
-
Hi @janosh, thanks for providing the script. As a general comment, if you don't need/want to modify the jobs already submitted (so you don't need to interact with slurm and you can run the script on the Runner machine) or if you are running in the all-in-one configuration, a convenient way to have access to the DB without manually including the connection details is to use the jc = JobController.from_project_name()
job_coll = jc.jobs In this way it is also possible to directly use the JobController to apply the changes instead of the CLI functions (i.e. I have seen that you mention that these methods are slow. I suppose the reason is because it does not apply a bulk update, but locks each document and updates them individually to prevent race conditions with the runner. In principle I could also add a method for bulk updates that will not be safe if the runner is active, but could be way faster than the one currently available. |
Beta Was this translation helpful? Give feedback.
-
posting a script in case it's useful as a starting point for others.
this script modifies resource allocations on all jobs that aren't already running or finished, including jobs already submitted to
slurm
. needs to be run on the cluster in order to interact withslurm
.this minimal example changes the number of allocated processes to
n_processes = 8
Beta Was this translation helpful? Give feedback.
All reactions