Make use of all CPUs on SLURM
问题 I would like to run a job on the cluster. There are a different number of CPUs on different nodes and I have no idea which nodes will be assigned to me. What are the proper options so that the job can create as many tasks as CPUs on all nodes? #!/bin/bash -l #SBATCH -p normal #SBATCH -N 4 #SBATCH -t 96:00:00 srun -n 128 ./run 回答1: One dirty hack to achieve the objective is using the environment variables provided by the SLURM. For a sample sbatch file: #!/bin/bash #SBATCH --job-name=test