| 57 | } |
| 58 | |
| 59 | static inline void setupMaster() |
| 60 | { |
| 61 | MPI_Comm appComm; |
| 62 | MPI_CALL(Comm_split(world.comm, 1, world.rank, &appComm)); |
| 63 | |
| 64 | int size = 0; |
| 65 | int rank = 0; |
| 66 | MPI_Comm_size(appComm, &size); |
| 67 | MPI_Comm_rank(appComm, &rank); |
| 68 | |
| 69 | postStatusMsg(OSP_LOG_INFO) |
| 70 | << "#w: app process " << rank << '/' << size << " (global " << world.rank |
| 71 | << '/' << world.size << ')'; |
| 72 | |
| 73 | MPI_CALL(Barrier(world.comm)); |
| 74 | MPI_CALL(Comm_free(&appComm)); |
| 75 | |
| 76 | // ------------------------------------------------------- |
| 77 | // at this point, all processes should be set up and synced. in |
| 78 | // particular: |
| 79 | // - app has intracommunicator to all workers (and vica versa) |
| 80 | // - app process(es) are in one intercomm ("app"); workers all in |
| 81 | // another ("worker") |
| 82 | // - all processes (incl app) have barrier'ed, and thus now in sync. |
| 83 | } |
| 84 | |
| 85 | static inline void setupWorker() |
| 86 | { |
no test coverage detected