A Slurm cluster administrator wants to ensure that a job submission script requests exactly 2 GPUs on a single compute node. Which directive should be included in the batch script to correctly specify this GPU resource requirement?
Answer: A
Explanation
In Slurm, Generic Resource (GRES) scheduling is used to request specialised hardware such as GPUs. The --gres flag is the standard directive for requesting GPU resources within a batch job script. The format gpu:N specifies the GPU resource type and the number of GPUs required on the allocated node.Option A is correct. The directive #SBATCH --gres=gpu:2 requests 2 GPU devices on the compute node allocated for the job. This is the standard and most widely used method for GPU resource allocation in batch scripts and is supported across Slurm-managed NVIDIA GPU clusters. Option B is incorrect. --gpus-per-task allocates GPUs relative to each task, not per node. For a single-node job with one task it may produce the same result, but it is not the standard node-level GPU request directive. Option C is incorrect. --ntasks=2 sets the number of parallel tasks, and there is no --gpu flag in standard Slurm syntax. This combination does not correctly specify a 2-GPU-per-node resource request. Option D is incorrect. --resource is not a valid Slurm directive for GPU allocation. Reference URLs: