MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / Finalize

Method Finalize

Src/Base/AMReX_MFIter.cpp:230–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void
231MFIter::Finalize ()
232{
233 // avoid double finalize
234 if (finalized) { return; }
235 finalized = true;
236
237 // mark as invalid
238 currentIndex = endIndex;
239
240#ifdef BL_USE_TEAM
241 if ( ! (flags & NoTeamBarrier) )
242 ParallelDescriptor::MyTeam().MemoryBarrier();
243#endif
244
245#ifdef AMREX_USE_GPU
246 if (device_sync && device_sync_post) {
247 const int nstreams = std::min(endIndex, streams);
248 for (int i = 0; i < nstreams; ++i) {
249 Gpu::Device::setStreamIndex(i);
250 Gpu::streamSynchronize();
251 }
252 }
253
254 AMREX_GPU_ERROR_CHECK();
255 Gpu::Device::resetStreamIndex();
256#endif
257
258 if (m_fa) {
259#ifdef AMREX_USE_OMP
260#pragma omp barrier
261#pragma omp single
262#endif
263 m_fa->clearThisBD();
264 }
265 if (m_fa) {
266 m_fa.reset(nullptr);
267 }
268
269#ifdef AMREX_USE_OMP
270#pragma omp master
271#endif
272 {
273 depth = 0;
274 }
275}
276
277void
278MFIter::Initialize ()

Callers

nothing calls this directly

Calls 4

streamSynchronizeFunction · 0.85
MemoryBarrierMethod · 0.80
clearThisBDMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected