| 98 | #endif // ACL_DEVICE |
| 99 | |
| 100 | void seissol::initializer::MemoryManager::initialize() |
| 101 | { |
| 102 | // initialize global matrices |
| 103 | GlobalDataInitializerOnHost::init(m_globalDataOnHost, m_memoryAllocator, memory::Standard); |
| 104 | if constexpr (seissol::isDeviceOn()) { |
| 105 | // the serial order for initialization is needed for some (older) driver versions on some GPUs |
| 106 | bool serialize = false; |
| 107 | const char* envvalue = std::getenv("SEISSOL_SERIAL_NODE_DEVICE_INIT"); |
| 108 | if (envvalue != nullptr) { |
| 109 | if (strcmp(envvalue, "1") == 0) { |
| 110 | serialize = true; |
| 111 | } |
| 112 | else if (strcmp(envvalue, "0") == 0) { |
| 113 | serialize = false; |
| 114 | } |
| 115 | else { |
| 116 | logError() << "Invalid value for \"SEISSOL_SERIAL_NODE_DEVICE_INIT\""; |
| 117 | } |
| 118 | } |
| 119 | if (serialize) { |
| 120 | logInfo(MPI::mpi.rank()) << "Initializing device global data on a node in serial order."; |
| 121 | MPI::mpi.serialOrderExecute([&]() { |
| 122 | GlobalDataInitializerOnDevice::init(m_globalDataOnDevice, m_memoryAllocator, memory::DeviceGlobalMemory); |
| 123 | }, MPI::mpi.sharedMemComm()); |
| 124 | } |
| 125 | else { |
| 126 | GlobalDataInitializerOnDevice::init(m_globalDataOnDevice, m_memoryAllocator, memory::DeviceGlobalMemory); |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void seissol::initializer::MemoryManager::correctGhostRegionSetups() |
| 132 | { |
no test coverage detected