Run only one job on local machine

Hello everyone,

I’ve recently been doing development on my local machine and at some point have several jobs that get launched in parallel from a single workchain instance. It seems someone had a similar question Is there a Desktop Job Scheduler for MacOS - #3 by mbercx and I’m wondering if there is a simpler way to just tell AiiDA to only run one JobCalc at a time? Otherwise, I’ll just deal with it or install a scheduler as mentioned. Thanks.

Nathan

If your WorkChain is not nested (i.e., it only submits CalcJobs and does not submit other WorkChains), and you’re only running one WorkChain at a time, you can follow this simple approach:

# Allocate one slot for the WorkChain itself and another for a CalcJob.
# Any additional CalcJobs will wait until a slot is available.
verdi config set daemon.worker_process_slots 2
verdi daemon restart

If your WorkChain is nested (i.e., it submits other WorkChains), you should increase the worker_process_slots based on the depth of nesting. For example, if your WorkChain submits two nested WorkChains, you will need two more slots to ensure smooth execution without blocking.

Important Note:

This configuration should only be used for testing purposes. If the number of submitted WorkChains is equal to or greater than the available worker slots, the WorkChan can deadlock, as there will not be enough slots for all the processes to complete.

When moving to production, set the default value back for worker_process_slots:

verdi config set daemon.worker_process_slots 200
verdi daemon restart
1 Like