Multi-threading not actually working on another machine

William Tao ywta... at
Fri Feb 24 16:06:49 UTC 2017

Dear Alfio,

I did set up the OMP_NUM_THREADS as 40 for my calculation. And here is part 
of my output in the very beginning.

 GLOBAL| Force Environment number                                           
 GLOBAL| Basis set file name                                           
 GLOBAL| Potential file name                                     
 GLOBAL| MM Potential file name                                     
 GLOBAL| Coordinate file name                                
 GLOBAL| Method name                                                       
 GLOBAL| Project name                                             ATOM-309
 GLOBAL| Preferred FFT library                                             
 GLOBAL| Preferred diagonalization lib.                                     
 GLOBAL| Run type                                                           
 GLOBAL| All-to-all communication in single precision                       
 GLOBAL| FFTs using library dependent lengths                               
 GLOBAL| Global print level                                                 
 GLOBAL| Total number of message passing processes                         
* GLOBAL| Number of threads for this process                               
 GLOBAL| This output is from process                                       
 GLOBAL| CPU model name :  Intel(R) Xeon(R) CPU E7-8891 v3 @ 2.80GHz

However, when running, it could only use up to 8 threads.

Thank you.


在 2017年2月24日星期五 UTC-6上午1:47:37,Alfio Lazzaro写道:
> Dear William,
> CP2K uses OpenMP for the threading. The number of threads is set by using 
> the environment variable OMP_NUM_THREADS and it goes at runtime, therefore 
> there is no relation with the compilation (you can specify the number of 
> threads at runtime). By default, if you don't set the variable, OpenMP 
> assumes the maximum number of available threads on the system (8 and 40 in 
> your case). That's why you see 40 threads. However, you should consider 
> that it is very hard to get good scalability for such large number of 
> threads (actually it depends on your workload), that's why in "average" 
> (what you see from top command) you are using 8 corresponding fully loaded 
> threads.
> I can suggest to experiment with setting a different number of threads. 
> Just use:
> export OMP_NUM_THREADS=<any number between 1 and 40>
> before running CP2K.
> Another better solution would be to use MPI and OpenMP (psmp version), by 
> using 4 MPI ranks and 10 threads (for example). Likely it would give you 
> better performance...
> Alfio
> Il giorno giovedì 23 febbraio 2017 22:48:01 UTC+1, William Tao ha scritto:
>> Dear friends,
>> I compiled the cp2k version 4.1 on a 8-core CPU machine.
>> When I run the binary cp2k.ssmp on another machine with 40-core CPU, the 
>> output prints that the number of threads is 40.
>> However, when I check with "top" command, the process could use up to 
>> 800% CPU.
>> Does anybody know what is going on?
>> William 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the CP2K-user mailing list