Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ArthurRatz
Black Belt
115 Views

Hybrid OpenMP+MPI: How to synchronize access to MPI shared RMA window by multiple OpenMP threads ?

Jump to solution

Dear Collegues,

I've developed parallel code that implements both OpenMP + MPI hybrid parallelization and allocates a shared RMA window by calling MPI_Win_allocate_shared function to store the data shared among multiple OpenMP threads executed withing several MPI processes.

Is there any chance to synchronize access to the shared RMA window by the number of OpenMP threads executed within multiple MPI processes.?

Is there any pattern for hybrid OpenMP + MPI programming ?

Thanks for your replies in advance.

Cheers, Arthur.

0 Kudos
1 Solution
James_T_Intel
Moderator
115 Views

Can you explain in more detail how you're trying to control your synchronization?

I personally would not use MPI_Win_allocate_shared along with OpenMP.  MPI_Win_allocate_shared is intended as a means of local shared memory similar to threading, but without having to implement threading.  At the point that threading is implemented, I'd aim for having a single rank per node, and use threading within that rank to fully utilize the node.

Is it doable?  Absolutely.  But MPI mostly expects you to control access to shared memory much more directly than OpenMP requires.  So it's going to take more effort.

View solution in original post

6 Replies
Andrey_C_Intel1
Employee
115 Views

Hi Arthur,

I am moving your question to Intel MPI forum for experts on MPI internals, as it does not relate to the open source runtime library.

Regards,
Andrey
 

James_T_Intel
Moderator
116 Views

Can you explain in more detail how you're trying to control your synchronization?

I personally would not use MPI_Win_allocate_shared along with OpenMP.  MPI_Win_allocate_shared is intended as a means of local shared memory similar to threading, but without having to implement threading.  At the point that threading is implemented, I'd aim for having a single rank per node, and use threading within that rank to fully utilize the node.

Is it doable?  Absolutely.  But MPI mostly expects you to control access to shared memory much more directly than OpenMP requires.  So it's going to take more effort.

View solution in original post

ArthurRatz
Black Belt
115 Views

Thanks for your reply. Can you explain me how to implement global shared memory using MPI and not using MPI_Win_allocate_shared at the same time ? Thanks for your reply in advance.

Cheers, Arthur.

James_T_Intel
Moderator
115 Views
ArthurRatz
Black Belt
115 Views

Thanks for reply.

ArthurRatz
Black Belt
115 Views

Can you provide an example of using MPI_Send/MPI_Recv instead to maintain a shared memory between processes on different nodes ?

Reply