<div dir="ltr">Hi!<div><br></div><div>I'd like to set different resource limits for different steps of my job. A sample script might look like this (e.g. <font face="monospace">job.sh</font>):<br><br><font face="monospace">#!/bin/bash</font></div><div><font face="monospace">srun --cpus-per-task=1 --mem=1 echo "Starting..."<br>srun --cpus-per-task=4 --mem=250 --exclusive <do something complicated></font></div><div><font face="monospace">srun --cpus-per-task=1 --mem=1 echo "Finished."</font></div><div><br></div><div><div>Then I would run the script from the command line using the following command: <font face="monospace">sbatch --ntasks=1 job.sh</font>. I have observed that while none of the steps appear to have limited memory (which I'm pretty sure has to do with my proctrack plugin type), the second step runs and <font face="monospace">scontrol show step <id>.1</font> shows the step has having been allocated 4 CPUs, in reality the step is only able to use 1. </div><div><br></div><div>I have also observed the opposite. Running the following command, I can see that the job step is able to use all CPUs allocated to the job, rather than the one it was allocated itself:<br><br><font face="monospace">sbatch --ntasks=1 --cpus-per-task=2 << EOF<br>#!/bin/bash<br>srun --cpus-per-task=1 <do something complicated></font></div><div><font face="monospace">EOF</font></div><div><br></div><div>My goal here is to be able to run a single job with 3 steps where the first and last step are always executed, even if the second would not be run because too many resources were requested.</div><div><br></div><div>Here is my slurm.conf, with commented out lines removed (this is just a small test cluster with a single node on the same machine as the controller):<br><br></div><div><font face="monospace">SlurmctldHost=ubuntu<br>CredType=cred/munge<br>AuthType=auth/munge<br>EnforcePartLimits=ALL<br>MpiDefault=none<br>ProctrackType=proctrack/linuxproc<br>ReturnToService=2<br>SlurmctldPidFile=/var/spool/slurm/slurmctld.pid<br>SlurmctldPort=6817<br>SlurmdPidFile=/var/spool/slurm/slurmd.pid<br>SlurmdPort=6818<br>SlurmdSpoolDir=/var/spool/slurm/slurmd<br>SlurmUser=slurm<br>StateSaveLocation=/var/spool/slurm<br>SwitchType=switch/none<br>TaskPlugin=task/affinity<br>TaskPluginParam=Sched<br>InactiveLimit=0<br>KillWait=30<br>MinJobAge=3600<br>SlurmctldTimeout=120<br>SlurmdTimeout=300<br>Waittime=0<br>FastSchedule=1<br>SchedulerType=sched/backfill<br>SelectType=select/cons_res<br>SelectTypeParameters=CR_CPU<br>AccountingStorageType=accounting_storage/slurmdbd<br>AccountingStoreJobComment=YES<br>ClusterName=cluster<br>JobCompHost=localhost<br>JobCompLoc=slurm_db<br>JobCompPort=3306<br>JobCompType=jobcomp/mysql<br>JobCompUser=slurm<br>JobAcctGatherFrequency=30<br>JobAcctGatherType=jobacct_gather/linux<br>SlurmctldDebug=info<br>SlurmctldLogFile=/var/spool/slurm/slurmctld.log<br>SlurmdDebug=info<br>SlurmdLogFile=/var/spool/slurm/slurmd/slurmd.log<br>NodeName=ubuntu CPUs=4 RealMemory=500 State=UNKNOWN<br>PartitionName=main Nodes=ubuntu Default=YES MaxTime=INFINITE State=UP AllowGroups=maria</font><br></div><div><br></div><div>Any advice would be greatly appreciated! Thanks in advance!</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Thanks,<br></div>Maria<br></div></div></div></div>