| 55 | } |
| 56 | |
| 57 | DirectGhostTimeCluster::DirectGhostTimeCluster(double maxTimeStepSize, |
| 58 | int timeStepRate, |
| 59 | int globalTimeClusterId, |
| 60 | int otherGlobalTimeClusterId, |
| 61 | const MeshStructure *meshStructure, |
| 62 | bool persistent) |
| 63 | : AbstractGhostTimeCluster(maxTimeStepSize, |
| 64 | timeStepRate, |
| 65 | globalTimeClusterId, |
| 66 | otherGlobalTimeClusterId, |
| 67 | meshStructure), persistent(persistent) { |
| 68 | if (persistent) { |
| 69 | for (unsigned int region = 0; region < meshStructure->numberOfRegions; ++region) { |
| 70 | if (meshStructure->neighboringClusters[region][1] == static_cast<int>(otherGlobalClusterId) ) { |
| 71 | MPI_Send_init(meshStructure->copyRegions[region], |
| 72 | static_cast<int>(meshStructure->copyRegionSizes[region]), |
| 73 | MPI_C_REAL, |
| 74 | meshStructure->neighboringClusters[region][0], |
| 75 | DataTagOffset + meshStructure->sendIdentifiers[region], |
| 76 | seissol::MPI::mpi.comm(), |
| 77 | meshStructure->sendRequests + region); |
| 78 | MPI_Recv_init(meshStructure->ghostRegions[region], |
| 79 | static_cast<int>(meshStructure->ghostRegionSizes[region]), |
| 80 | MPI_C_REAL, |
| 81 | meshStructure->neighboringClusters[region][0], |
| 82 | DataTagOffset + meshStructure->receiveIdentifiers[region], |
| 83 | seissol::MPI::mpi.comm(), |
| 84 | meshStructure->receiveRequests + region); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void DirectGhostTimeCluster::finalize() { |
| 91 | if (persistent) { |