Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2228 Discussions

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

ArthurRatz
Novice
1,289 Views

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
1,289 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

0 Kudos
6 Replies
Andrey_C_Intel1
Employee
1,289 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
 

0 Kudos
James_T_Intel
Moderator
1,290 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.

0 Kudos
ArthurRatz
Novice
1,289 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.

0 Kudos
James_T_Intel
Moderator
1,289 Views
0 Kudos
ArthurRatz
Novice
1,289 Views

Thanks for reply.

0 Kudos
ArthurRatz
Novice
1,289 Views

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

0 Kudos
Reply