Intel® oneAPI HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
1920 Discussions

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

ArthurRatz
Black Belt
206 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
206 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
206 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
207 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.

ArthurRatz
Black Belt
206 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
206 Views
ArthurRatz
Black Belt
206 Views

Thanks for reply.

ArthurRatz
Black Belt
206 Views

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

Reply