Gromacs with SLURM

GROMACS version: 2020
GROMACS modification: No

Good morning,

I’m running gromacs on a computing cluster using SLURM, but the simulation requires more than the job timelimits allowed (24 hours). How can I manage long simulations without submitting continuously new jobs?

Any advice would be greatly appreciated.

Mattia

Hi,

Not sure what you mean when you say “without submitting continuously new jobs”, since you will have to submit more. Here’s a few notes on that:

For the mdrun command, make sure to include the options -cpi -maxh 24 along with your other options. -cpi will resume from the last checkpoint, -maxh 24 ensures that mdrun stops and finishes writing all files before the 24 hours are up.

For SLURM, you can specify that your new job depends on a previous job to finish. This is how you can queue up multiple jobs to execute after each other, without running simultaneously. The documentation lists the various options to specify this. I usually submit with “singleton”, which uses the submitted job name as a check – if a job with the same name is already running, it’ll wait for that to finish. So I’ll just repeat my sbatch command to submit my job script a few times, which creates the queue since the name will be the same for all.

You can set the dependency in the job script with the SLURM_JOB_DEPENDENCY variable or use it with sbatch.

Regards,
Petter

Thanks a lot, you’ve been very helpful.

Regards,
Mattia