number of cores

49 views
Skip to first unread message

Sihem AZIZI

unread,
Jul 20, 2025, 10:36:15 AM7/20/25
to cp2k
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
Ru111 (1).inp

Frederick Stein

unread,
Jul 20, 2025, 11:29:22 AM7/20/25
to cp2k
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
Reply all
Reply to author
Forward
0 new messages