Multi-threading not actually working on another machine

Alfio Lazzaro alfio.... at gmail.com
Fri Feb 24 07:47:37 UTC 2017


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: <https://lists.cp2k.org/archives/cp2k-user/attachments/20170223/00aba5a8/attachment.htm>


More information about the CP2K-user mailing list