Author Topic: Threading  (Read 3099 times)

0 Members and 1 Guest are viewing this topic.

Offline asanchez

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: ie
  • Reputation: 1
    • View Profile
Threading
« on: October 27, 2015, 17:38 »
I noticed that in the latest release letter you advise regarding MKL_NUM_THREADS.

I know how to combine OMP_NUM_THREADS with MPI processes but haven't much experience with MKL_NUM_THREADS (just recently started using intel compilers).

An example: 24 core machine. Due to memory constraints let's say I want to run only 6 MPI processes. I would usually do something like:

export OMP_NUM_THREADS=4
mpirun -n 6 .....

As to use 6 threaded (4x) MPI processes. How would that work with MKL_NUM_THREADS as well?  Should I set OMP to 1 and MKL to 4? Any guidance is highly appreciated.

Thanks in advance.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5583
  • Country: dk
  • Reputation: 100
    • View Profile
    • QuantumATK at Synopsys
Re: Threading
« Reply #1 on: October 27, 2015, 18:28 »
There were some versions of MKL that didn't fully respect OMP variables, so you had to set the MKL equivalent also. In general, however, they are interchangeable, at least for ATK in the sense that we only use threading (almost only) in MKL. So, in theory, you could thread MKL in one way and other parts of the code in another, but it typically only makes sense in ATK to either assign the same value to both variables (to be on the safe side) or either one - according to the specs MKL should respect the OMP variable.