| 44 | |
| 45 | The main idea is to allow tasks to access data stored in NAM regions efficiently and potentially in parallel, e.g. using several tasks to put/get data to/from the NAM. |
| 46 | The mechanism to access NAM regions is provided by the !ParaStation MPI and is based on the MPI RMA model. |
| 47 | !ParaStation MPI allows allocating NAM regions as MPI RMA windows, so that they can be accessed remotely by the ranks that participate in those windows using the standard `MPI_Put` and `MPI_Get` RMA operations. |
| 48 | This support is based on the fence synchronization mode of the MPI RMA model. |
| 49 | This mode works as follows: (1) all ranks participating in a given window have to open an access epoch on that window calling `MPI_Win_fence`, (2) they perform the desired RMA operations on the NAM window, and (3) they close the epoch with another call to `MPI_Win_fence`. |
| 50 | This mode of operation can be integrated into a hybrid task-based application by instantiating a task to open the epoch on the NAM window with `MPI_Win_fence`, followed by multiple concurrent tasks that write or read data to/from the NAM window, and finally, another task to close the access epoch. |
| 51 | Notice that tasks can define the corresponding dependencies on the window to ensure this order of execution, as in the following example: |
| 52 | |
| 53 | {{{#!c |
| 54 | // Open RMA access epoch to write the NAM window |
| 55 | #pragma oss task inout(namWindow) |
| 56 | { |
| 57 | MPI_Request request; |
| 58 | MPI_Win_ifence(0, namWindow, &request); |
| 59 | TAMPI_Iwait(&request, MPI_STATUS_IGNORE); |
| 60 | } |
| 61 | |
| 62 | // Write to NAM region concurrently |
| 63 | for (...) { |
| 64 | #pragma oss task concurrent(namWindow) |
| 65 | MPI_Put(..., namWindow); |
| 66 | } |
| 67 | |
| 68 | // Close RMA access epoch to write the NAM window |
| 69 | #pragma oss task inout(namWindow) |
| 70 | { |
| 71 | MPI_Request request; |
| 72 | MPI_Win_ifence(0, namWindow, &request); |
| 73 | TAMPI_Iwait(&request, MPI_STATUS_IGNORE); |
| 74 | } |
| 75 | }}} |