Will openMP use all the cores when MPI is also enabled?

You should read through Question about hyper-threading, as it may answer some of your questions.

You should always be specific about whether you’re talking about physical or logical cores when talking about parallelization models.

MPI and OpenMP don’t “see” cores, at least on the programmer level, they launch tasks and processes. You can easily launch 17 MPI tasks, each with 33 OpenMP threads, on a single (physical) core CPU if you want. The runtimes trust that you’re doing the right thing, and it’s up to you to set the thread affinity properly.

1 Like