multithreadingmpiopenmpcray

mpi: MPI_INIT_THREAD provided level of support


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.


Solution

  • 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.