Program PWSCF v.7.3.1 starts on 8May2025 at 9: 8: 9
This program is part of the open-source Quantum ESPRESSO suite
for quantum simulation of materials; please cite
"P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009);
"P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017);
"P. Giannozzi et al., J. Chem. Phys. 152 154105 (2020);
URL http://www.quantum-espresso.org",
in publications or presentations arising from this work. More details at
http://www.quantum-espresso.org/quote
Parallel version (MPI & OpenMP), running on 12 processor cores
Number of MPI processes: 1
Threads/MPI process: 12
MPI processes distributed on 1 nodes
278 MiB available memory on the printing compute node when the environment starts
Waiting for input...
^C
rupes@rupes-HP-255-G8-Notebook-PC:~$
now which mpirun --np i have to provide
Assistant
You are running Quantum ESPRESSO's pw.x executable which supports parallel execution with MPI and/or OpenMP.
User
Assistant
Your system has 12 logical CPU cores (6 physical cores with 2 threads each via SMT/Hyperthreading).
Recommended mpirun usage for pw.x on your machine:
You have a few options, depending on whether you want to use pure MPI or hybrid MPI+OpenMP:
Option 1: Pure MPI (using all 12 cores as MPI ranks)
There are not enough slots available in the system to satisfy the 12
slots that were requested by the application:
pw.x
Either request fewer procs for your application, or make more slots
available for use.
A "slot" is the PRRTE term for an allocatable unit where we can
launch a process. The number of slots available are defined by the
environment in which PRRTE processes are run:
Hostfile, via "slots=N" clauses (N defaults to number of
processor cores if not provided)
The --host command line parameter, via a ":N" suffix on the
hostname (N defaults to 1 if not provided)
If none of a hostfile, the --host command line parameter, or an
RM is present, PRRTE defaults to the number of processor cores
In all the above cases, if you want PRRTE to default to the number
of hardware threads instead of the number of processor cores, use the
--use-hwthread-cpus option.
Alternatively, you can use the --map-by :OVERSUBSCRIBE option to ignore the
number of available slots when deciding the number of processes to
launch.
Assistant
The error message:
code
There are not enough slots available in the system to satisfy the 12 slots that were requested by the application: pw.x
means that your MPI runtime (mpirun / PRRTE here) thinks there are fewer than 12 "slots" (CPU cores) available to launch processes on.
User
can i use export OMP_NUM_THREADS=2000
mpirun -np 6 pw.x < scf.in > scf.out
Assistant
No, you should not set OMP_NUM_THREADS=2000 because:
Your machine has only 12 logical CPU cores available.
Asking your program to launch 6 MPI processes each spawning 2000 OpenMP threads means a total of 6 × 2000 = 12,000 threads.
This hugely over-subscribes your hardware and will cause serious performance degradation, excessive context switching, memory exhaustion, and likely crashes.
What you should do instead
You want to use a total number of threads approximately equal to or less than your available logical CPUs (12 in your case).
So, for example:
If using 6 MPI ranks (-np 6), set OMP_NUM_THREADS=2 so total threads = 6 × 2 = 12.
Or if you want just MPI with no OpenMP, use OMP_NUM_THREADS=1 and -np 12.
Correct example:
bash
From the program output you shared:
It is currently running with 1 MPI process and 12 OpenMP threads (Number of MPI processes: 1 and Threads/MPI process: 12).
If you want to run with multiple MPI processes instead of just one (or in addition to OpenMP threads), you will need to decide:
How many total CPU cores you want to use,
How you want to split these cores between MPI processes and OpenMP threads.
Understanding your hardware and optimal parameters
How many CPU cores does your machine have?
You can check this by running:
bash
lscpu
or
bash
nproc
Let's say your machine has 12 cores (likely since pw.x started with 12 threads).
Choose the MPI/OpenMP balance
Typical strategies:
Run 12 MPI processes with 1 OpenMP thread each (--ntasks 12 and set OMP_NUM_THREADS=1)
Run 6 MPI processes with 2 OpenMP threads each (--ntasks 6 and OMP_NUM_THREADS=2)
Run 4 MPI processes with 3 OpenMP threads each (--ntasks 4 and OMP_NUM_THREADS=3)
Or just use all 12 cores for MPI (--ntasks 12) with no OpenMP (OMP_NUM_THREADS=1)
Because your CPU supports SMT (2 threads per physical core), best performance may come from using only physical cores (6 MPI ranks × 2 threads), but benchmarking is recommended to find the optimal setting.
Avoid over-subscription (total used CPU threads > 12).
You can experiment with switching SMT on/off in BIOS or in Linux and benchmarking.
Summary for your system:
MPI ranks (-np)
OMP_NUM_THREADS
Total threads
12
1
12
6
2
12
4
3
12
Just remember to set OMP_NUM_THREADSbefore launching mpirun, and ensure your input file is properly set to run in parallel.
Let me know if you want help with sample job scripts or more guidance!
Your system does have 12 logical cores (from lscpu/nproc).
However, your MPI environment (PRRTE) was not told to consider all 12 cores as available slots.
This can happen if the MPI runtime defaults to number of physical cores (6) instead of hyperthreads (12) or if it launches inside a restricted environment.
Fixes / Workarounds to try
1) Use the --use-hwthread-cpus flag to allow using hyperthreads (logical cores):
But in your case, since you do have 12 logical cores, you'd rather use --use-hwthread-cpus.
3) Check if your MPI environment is using a hostfile with limited slots.
If you use a hostfile or a resource manager, make sure it defines at least 12 slots on your local machine. For example, if you use --host option, make sure to specify the number of slots: