The number of CPUs I need and what is actually allocated to me(%CPU)

I have a 4-CPU machine. I applied for two CPUs to run a job. When I check the system resources, why is only one actually running?


When you request for resource using qsub ( -l select=1:ncpus=2) , it is to help the scheduler to find the resource that can match your request. Once it is launched on to the resource (node(s)) , then it is upto the application to use the respective cores (core pinning or not). The scheduler would not make or force or push the application to use 2 cpu cores, it is upto the application.

So the scheduler only helps you find resources (nodes) that meet your application requirements. If your program itself runs serially, even if you apply for several CPUs, it will only run on one CPU, but if the program runs in parallel , such as multi-threading, it will also run on multiple allocated CPUs accordingly.

Yes your understanding is correct

qsub -l select=1:ncpus=4 -- /bin/sleep 100 # This would not make sleep application to run on 4 cores. It will use only one core of the compute node, but the scheduler finds a 4 core system that to satisfy the job resource request.

For example:
qsub -l select=1:ncpus=2:mem=1gb -- /bin/sleep 100 # this will use one core on one compute node

qsub -l select=1:ncpus=4:mpiproc=4:mem=1gb -- /bin/some/application/applx -ncpus=4 -host=$PBS_NODEFILE /path/to/inputfile # This might be a parallel application using 4 cores on one node

qsub -l select=3:ncpus=4:mpiproc=4:mem=1gb -l place=scatter -- /bin/some/application/applx -ncpus=12 -host=$PBS_NODEFILE /path/to/inputfile # This might be a distributed parallel appliation using 4 cores each on 3 compute nodes

I get it.
Thanks sincerely.

1 Like