1

I am writing a hybrid MPI/OpenMP code with MPI-3 remote memory access feature. I am assuming MPI_THREAD_SERIALIZED is available.

Can I do this?

 MPI_Win_lock_all(0, win);
 #pragma omp parallel 
 {
      ...
      #pragma omp critical(getRemoteData)
      {
           MPI_Get(buf, len, MPI_UINT64_T, t_rank, localOffset, len, MPI_UINT64_T, win);
           MPI_Win_flush(t_rank, win);
      }
      ...

 }
 MPI_Win_unlock_all(win);

Here main thread calls lock and unlock once for the whole MPI process. The OMP threads call MPI_Get when required. I could call lock and unlock for each MPI_Get, but, I think that takes more time.

Does seem to be working. But, I am not sure if this is the correct use.

Abhishek
  • 87
  • 5
  • 1
    Yes, it is a correct use of MPI. This is the level of protection `MPI_THREAD_SERIALIZED` is supposed to deliver. Window access epochs are process-level operations in MPI implementations that map a separate OS process to each rank (as virtually all production-level implementations do). – Hristo Iliev Aug 23 '16 at 07:04
  • I agree with @HristoIliev. – Harald Aug 24 '16 at 09:11

0 Answers0