title: How to run two multiprocessing programs in one batch using SLURM?
body: <p>I have SLURM cluster with several nodes with 16 vcpus per node. I've tried to run the following code:</p>
  <pre><code>#SBATCH --nodes 2
  #SBATCH --ntasks 2
  #SBATCH -c 16
  
  srun --exclusive --nodes=1 program1 &amp;
  srun --exclusive --nodes=1 program2 &amp;
  wait
  </code></pre>
  <p><code>program1</code> and <code>program2</code> needs 16cpus each and I expected that 2 nodes with 32 cores would be allocated and <code>program1</code> would be ran on the first node and <code>program2</code> on the second one, but I got the following error message:</p>
  <pre><code>srun: error: Unable to create step for job 364966: Requested node configuration is not available
  </code></pre>
  <p>If I use only <code>--nodes</code> and <code>--ntasks</code> keys, sbatch allocates 2 nodes with 2 cpus and if I use <code>--nodes</code> and <code>-c</code> options, I get message that <code>--ntasks</code> should be defined.</p>
  <p>If I set <code>--ntasks=1</code>, SLURM set nnodes to 1.</p>
  <p>How can I run this two programs in one batch, each on one node and 16 vcpus?</p>