3

I am using openmp on a cluster. When I use MPI_INIT_THREAD with desired level of thread support as MPI_THREAD_MULTIPLE, the provided level is support is only 2. I do not know, whether I am doing some mistake or missing a compiler flag. On this cluster, mpi, openmp etc are available to be used.

On my ubuntu laptop with mpich2, I do get provided level of support as 3, with same code. However, I need to use the cluster for studies. My program is C++.

Can you please tell me, if I need to change something. Thanks. Let me know, if I need to provide more information.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
user984260
  • 3,401
  • 5
  • 25
  • 38

1 Answers1

6

On most current Cray machines, you can enable the desired MPI_THREAD_MULTIPLE by setting the environment variable

MPICH_MAX_THREAD_SAFETY=multiple

For Cray XT4, you had to load a module to enable it (it would replace the default MPI library); I don't have access on an XT4 anymore, so I don't remember the name of the module.

ipapadop
  • 1,432
  • 14
  • 19
  • Thank you, I am grateful for stumbling across this. Why is this so poorly documented? I haven't found this in any Cray documentation. Have an upvote. – Rob Stewart Aug 24 '13 at 23:15
  • 2
    The relevant Cray documentation is normally in man pages. Doing a "man mpi" will give a lot of interesting information. – ipapadop Aug 27 '13 at 21:59
  • 1
    For others who come here, using the man pages is the way to go, because in some cases additional flags are required to build with the correct libraries. E.g. on the machine I'm using, you need to build with `cc -craympich-mt` or else the `MPICH_MAX_THREAD_SAFETY` variable won't be respected at runtime. – Elliott Slaughter Oct 28 '18 at 19:57