[CP2K-user] [CP2K:21674] Re: number of cores

Frederick Stein f.stein at hzdr.de
Sun Jul 20 15:29:22 UTC 2025


Dear Sihem,
The number of cores is provided by you when you call CP2K. The information 
is provided in the output file at two spots:
 DBCSR| MPI: My process id                                                 
    0
 DBCSR| MPI: Number of processes                                           
    2
 DBCSR| OMP: Current number of threads                                     
    2
 DBCSR| OMP: Max number of threads                                         
    2
...
 GLOBAL| Total number of message passing processes                         
    2
 GLOBAL| Number of threads for this process                                 
   2

CP2K employs a hybrid MPI/OpenMP approach using MPI ranks and OpenMP 
threads. The total number of CPUs in use is the product of both, in the 
above example, it is 2*2=4.
The number of MPI ranks is specified when you call CP2K using mpirun, 
mpiexec, srun etc. With mpiexec, it is `mpiexec -np <number of MPI 
processes/ranks> /path/to/cp2k/exe/cp2k.psmp -i <input_file> -o 
<output_file>`. In case of mpirun, check the documentation of your MPI 
implementation. In case of a job scheduler such as Slurm, check the 
respective documentation.
The number of OpenMP threads are using the environment variable 
OMP_NUM_THREADS (see documentation on OpenMP), by default all available 
threads are used.
If all CPUs are used as expected, it may be that your work machine does not 
have enough compute power for your calculation. To further estimate it, 
reduce your basis set to a SZV one instead DZVP.
Best,
Frederick
Sihem AZIZI schrieb am Sonntag, 20. Juli 2025 um 16:36:15 UTC+2:

> Dear all, I ran the attached calculation, and it's taking an extremely 
> long time. The workstation I'm working on has 8 cores, and I don't know how 
> many cores are being used. Can I specify the number of processors? If so, 
> how can I do it? 
> Thank you for your help. 
> Sihem
>

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/f88a4b0f-db10-43d9-8ed4-2c186089c864n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20250720/adcd4bc8/attachment.htm>


More information about the CP2K-user mailing list