locked
Are MPI functions thread-safe? RRS feed

  • Question

  • Hi,

    Could I use multi-threads in each process on HPC? In another word, are HPC's MPI functions thread-safe?

    Thanks!

    Wednesday, May 12, 2010 6:07 AM

Answers

  • Hi Teng

    Among the  four multithreading models supported in MPI2:

    •  
      • { MPI_THREAD_SINGLE}. Only one thread will execute.
      • { MPI_THREAD_FUNNELED}. The process can be multithreaded, but only the main thread will make MPI calls (all MPI calls are "funneled'' to the main thread).
      • { MPI_THREAD_SERIALIZED}. The process can be multithreaded, and multiple threads can make MPI calls, but only one at a time; MPI calls are not made concurrently from two distinct threads (all MPI calls are "serialized'').
      • { MPI_THREAD_MULTIPLE}. Multiple threads can call MPI, with no restrictions.

    MS MPI supports up to and including MPI_THREAD_SERIALIZED, MPI_THREAD_FUNNELED,MPI_THREAD_SINGLE.  MSMPI doesn't support MPI_THREAD_MULTIPLE.

    For more details, please see MSMPI white paper http://download.microsoft.com/download/e/c/a/eca09493-3e66-4fb5-aba3-1e833c158052/Windows%20HPC%20Server%202008%20-%20Using%20MS%20MPI%20White%20Paper.doc

    Liwei

    • Marked as answer by Teng Gao Wednesday, May 26, 2010 8:13 AM
    Tuesday, May 18, 2010 2:05 PM

All replies

  • Hi Teng

    Among the  four multithreading models supported in MPI2:

    •  
      • { MPI_THREAD_SINGLE}. Only one thread will execute.
      • { MPI_THREAD_FUNNELED}. The process can be multithreaded, but only the main thread will make MPI calls (all MPI calls are "funneled'' to the main thread).
      • { MPI_THREAD_SERIALIZED}. The process can be multithreaded, and multiple threads can make MPI calls, but only one at a time; MPI calls are not made concurrently from two distinct threads (all MPI calls are "serialized'').
      • { MPI_THREAD_MULTIPLE}. Multiple threads can call MPI, with no restrictions.

    MS MPI supports up to and including MPI_THREAD_SERIALIZED, MPI_THREAD_FUNNELED,MPI_THREAD_SINGLE.  MSMPI doesn't support MPI_THREAD_MULTIPLE.

    For more details, please see MSMPI white paper http://download.microsoft.com/download/e/c/a/eca09493-3e66-4fb5-aba3-1e833c158052/Windows%20HPC%20Server%202008%20-%20Using%20MS%20MPI%20White%20Paper.doc

    Liwei

    • Marked as answer by Teng Gao Wednesday, May 26, 2010 8:13 AM
    Tuesday, May 18, 2010 2:05 PM
  • That's it! Thank you very much, Liwei!

    Wednesday, May 26, 2010 8:16 AM