Reputation: 21
My PC have two cpu xeon e5-2678v3, 12 cores/24 thread each cpu (total 24core/48 threads) I submitted slurm batch job that request multicores for my code (CFD fortran code with intel fortran compiler in linux) The code run well but it seem that all 48 threads run on only 1 cpu not dual cpu. I checked both serial and openMP run using the same slurm batch job file above; the same result and same calculation speed resulted. Please tell me how to use all 2 CPU to run the code?
The first job file, system run with all 48 threads: *
#!/bin/sh
#PBS -N Ogive
#PBS -o output
#PBS -j oe
#PBS -l ncpus=2
cd <directory>
time ./2D-TFlow2Wall-MCM-HKO
*
The second job file, systems run with 20 threads
*#!/bin/bash
#SBATCH --job-name=testOMP
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=20
#SBATCH --exclusive
#SBATCH --time=0-20:00:00
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
time ./2D-test*
Upvotes: 0
Views: 104
Reputation: 10087
I suspect that your directive of --ntasks-per-node
of 1 is competing with your --cpus-per-task
directive, it sounds like they may be in competition with each other (that is, I think SLURM expects you to give one of those options, not both). Try setting that to 20 also, or using only one or the other. From the docs:
--ntasks-per-node= Request that ntasks be invoked on each node. If used with the --ntasks option, the --ntasks option will take precedence and the --ntasks-per-node will be treated as a maximum count of tasks per node. Meant to be used with the --nodes option. This is related to --cpus-per-task=ncpus, but does not require knowledge of the actual number of cpus on each node. In some cases, it is more convenient to be able to request that no more than a specific number of tasks be invoked on each node. Examples of this include submitting a hybrid MPI/OpenMP app where only one MPI "task/rank" should be assigned to each node while allowing the OpenMP portion to utilize all of the parallelism present in the node, or submitting a single setup/cleanup/monitoring job to each node of a pre-existing allocation as one step in a larger job script.
(emphasis mine.)
Upvotes: 1