Each of the hybrid examples use the same basic structure, as outlined below:

Start with MPI initialization MPI_Init_thread
...
MPI_Call
...
(Serial regions are executed by the main thread of the MPI process)

Create OpenMP parallel regions within each MPI process
(if MPI implementation has thread support)

  • MPI calls are allowed here too (possibly with conditions)
  • MPI rank is known to all relevant threads
OMP parallel
...
MPI_Call
...
end parallel
Call MPI in single-threaded regions ...
MPI_Call
Finalize MPI ...
MPI_Finalize
 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement