Skip to content

Commit ea536b7

Browse files
committed
Add bool MFIter::initialized
1 parent 2a7cba8 commit ea536b7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Src/Base/AMReX_MFIter.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ protected:
180180
IndexType typ;
181181

182182
bool dynamic;
183+
bool initialized;
183184

184185
struct DeviceSync {
185186
DeviceSync () = default;

Src/Base/AMReX_MFIter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ MFIter::~MFIter ()
215215
void
216216
MFIter::Finalize ()
217217
{
218+
if (!initialized) return;
219+
218220
#ifdef AMREX_USE_OMP
219221
#pragma omp master
220222
#endif
221223
{
224+
initialized = false;
222225
depth = 0;
223226
}
224227

@@ -354,6 +357,13 @@ MFIter::Initialize ()
354357

355358
typ = fabArray.boxArray().ixType();
356359
}
360+
361+
#ifdef AMREX_USE_OMP
362+
#pragma omp master
363+
#endif
364+
{
365+
initialized = true;
366+
}
357367
}
358368

359369
Box

0 commit comments

Comments
 (0)