MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / initDataStructures

Function initDataStructures

auto_tuning/proxy/src/proxy_seissol_allocator.hpp:119–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119unsigned int initDataStructures(unsigned int i_cells, bool enableDynamicRupture) {
120 // init RNG
121 srand48(i_cells);
122 m_lts.addTo(*m_ltsTree, false); // proxy does not use plasticity
123 m_ltsTree->setNumberOfTimeClusters(1);
124 m_ltsTree->fixate();
125
126 seissol::initializer::TimeCluster& cluster = m_ltsTree->child(0);
127 cluster.child<Ghost>().setNumberOfCells(0);
128 cluster.child<Copy>().setNumberOfCells(0);
129 cluster.child<Interior>().setNumberOfCells(i_cells);
130
131 seissol::initializer::Layer& layer = cluster.child<Interior>();
132 layer.setBucketSize(m_lts.buffersDerivatives, sizeof(real) * tensor::I::size() * layer.getNumberOfCells());
133
134 m_ltsTree->allocateVariables();
135 m_ltsTree->touchVariables();
136 m_ltsTree->allocateBuckets();
137
138 if (enableDynamicRupture) {
139 m_dynRup.addTo(*m_dynRupTree);
140 m_dynRupTree->setNumberOfTimeClusters(1);
141 m_dynRupTree->fixate();
142
143 seissol::initializer::TimeCluster& cluster = m_dynRupTree->child(0);
144 cluster.child<Ghost>().setNumberOfCells(0);
145 cluster.child<Copy>().setNumberOfCells(0);
146 cluster.child<Interior>().setNumberOfCells(4*i_cells); /// Every face is a potential dynamic rupture face
147
148 m_dynRupTree->allocateVariables();
149 m_dynRupTree->touchVariables();
150
151 m_fakeDerivativesHost = (real*) m_allocator->allocateMemory(i_cells * yateto::computeFamilySize<tensor::dQ>() * sizeof(real), PagesizeHeap, seissol::memory::Standard);
152#ifdef _OPENMP
153 #pragma omp parallel for schedule(static)
154#endif
155 for (unsigned cell = 0; cell < i_cells; ++cell) {
156 for (unsigned i = 0; i < yateto::computeFamilySize<tensor::dQ>(); i++) {
157 m_fakeDerivativesHost[cell*yateto::computeFamilySize<tensor::dQ>() + i] = (real)drand48();
158 }
159 }
160
161#ifdef ACL_DEVICE
162 m_fakeDerivatives = (real*) m_allocator->allocateMemory(i_cells * yateto::computeFamilySize<tensor::dQ>() * sizeof(real), PagesizeHeap, seissol::memory::DeviceGlobalMemory);
163 const auto& device = ::device::DeviceInstance::getInstance();
164 device.api->copyTo(m_fakeDerivatives, m_fakeDerivativesHost, i_cells * yateto::computeFamilySize<tensor::dQ>() * sizeof(real));
165#else
166 m_fakeDerivatives = m_fakeDerivativesHost;
167#endif
168 }
169
170 /* cell information and integration data*/
171 seissol::fakeData(m_lts, layer, (enableDynamicRupture) ? FaceType::DynamicRupture : FaceType::Regular);
172
173 if (enableDynamicRupture) {
174 // From lts tree
175 CellDRMapping (*drMapping)[4] = m_ltsTree->var(m_lts.drMapping);
176

Callers 1

runProxyFunction · 0.85

Calls 13

sizeFunction · 0.85
CellDRMappingClass · 0.85
fixateMethod · 0.80
setNumberOfCellsMethod · 0.80
setBucketSizeMethod · 0.80
allocateVariablesMethod · 0.80
allocateBucketsMethod · 0.80
addToMethod · 0.45
getNumberOfCellsMethod · 0.45
touchVariablesMethod · 0.45
allocateMemoryMethod · 0.45

Tested by

no test coverage detected