Code Monkey home page Code Monkey logo

Comments (6)

beck-llr avatar beck-llr commented on May 28, 2024

Hi
How many openMP threads do you use ? This behaviour is typical of an oversubscribing of the cores of your CPU. Either because you have too many threads per core and use hyperthreading or simply because you pin your openMP threads on the same core. Make sure your openMP threads are correctly pinned.
When not specified sometimes the maximum number of openMP threads are used by certain system and that leads to bad performances. If you want to run the code without openMP at all and just run mpi checks you can compile the code with the option config=nopenmp.
Let us know how that goes.

from smilei.

jderouillat avatar jderouillat commented on May 28, 2024

I confirm Arnaud's comment.
You'll find below the behaviour observed on a double E5-2670 architecture (fixing OMP_NUM_THREADS to 1).
It has been run with IntelMPI which is smart regarding the MPI process affinity without specifying it.

Number of MPI  1 2 4 8 16
           
time loop 25.06 12.53 6.36 3.38 1.86
Particles   24.51 12.22 6.13 3.20 1.70
Maxwell   0.22 0.09 0.05 0.03 0.02
Sync Particles 0.11 0.05 0.04 0.03 0.03
Sync Fields 0.00 0.01 0.01 0.03 0.03
Sync Densities 0.01 0.04 0.06 0.05 0.05
           
Efficiency   100.00% 100.00% 98.57% 92.68% 84.12%

from smilei.

dsbertini avatar dsbertini commented on May 28, 2024

OK you are right,
For any reason when OMP_NUM_THREADS is not set, the scalability problem i mentioned in this issue
shows up immediately after more than 2 MPI cores. So one has to explicitly set this env. variable and the speed up is clea and linear when using n= 1 or 2 threads but for higher threads number is see no real improvement. May be some other dual MPI - OpenMP effects ?...

from smilei.

beck-llr avatar beck-llr commented on May 28, 2024

As I said in my first message, if you do not set your OMP_NUM_THREADS, sometimes the system uses a stupid value. The SMILEI simulation log tells you how many openMP threads are being used so that you can check this.
You should be able to reproduce an almost linear improvement for openMP as well but it is more difficult to achieve because you have to properly pin your threads to the cores.
The first thing we advise is not to use openMP across different sockets. So make sure you allocate at least one MPI process per socket.
Then you have to allocate at least as many cores to each of your MPI process as you have openMP threads.
It is often good to bind threads to cores.
And finally make sure your threads are properly positioned across your physical cores and not stack on each other on a same core because of hyperthreading.

All of this is completely independent of SMILEI and is just standard good practice of hybrid codes on many core systems. It is difficult to tell you exactly how to do it because it depends on your environment, compiler, Mpi version etc.

from smilei.

dsbertini avatar dsbertini commented on May 28, 2024

thanks a lot for the detailed explanation.

from smilei.

beck-llr avatar beck-llr commented on May 28, 2024

Anytime. Hope this will help you get the most out of SMILEI. Let us know if we can be of further help.

from smilei.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.