@@ -1114,6 +1114,7 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
11141114 nfi.Stream ().write (allFabData, bytesWritten);
11151115 nfi.Stream ().flush ();
11161116 delete [] allFabData;
1117+ if (! nfi.Stream ().good ()) { amrex::Error (" VisMF::Write failed" ); }
11171118
11181119 } else { // ---- write fabs individually
11191120 for (MFIter mfi (mf); mfi.isValid (); ++mfi) {
@@ -1154,6 +1155,8 @@ VisMF::Write (const FabArray<FArrayBox>& mf,
11541155 if (!noFlushAfterWrite) {
11551156 nfi.Stream ().flush ();
11561157 }
1158+
1159+ if (! nfi.Stream ().good ()) { amrex::Error (" VisMF::Write failed" ); }
11571160 }
11581161 }
11591162
@@ -1485,6 +1488,8 @@ VisMF::readFAB (int idx,
14851488#endif
14861489 }
14871490
1491+ if (!(infs->good ())) { amrex::Error (" VisMF::readFAB failed" ); }
1492+
14881493 VisMF::CloseStream (FullName);
14891494
14901495 return fab;
@@ -1532,6 +1537,8 @@ VisMF::readFAB (FabArray<FArrayBox> &mf,
15321537 fab.readFrom (*infs);
15331538 }
15341539
1540+ if (!(infs->good ())) { amrex::Error (" VisMF::readFAB failed" ); }
1541+
15351542 VisMF::CloseStream (FullName);
15361543}
15371544
@@ -1831,6 +1838,8 @@ VisMF::Read (FabArray<FArrayBox> &mf,
18311838 }
18321839 }
18331840
1841+ if (! nfi.Stream ().good ()) { amrex::Error (" VisMF::Read failed" ); }
1842+
18341843 } // ---- end NFilesIter
18351844 }
18361845
@@ -2524,6 +2533,7 @@ VisMF::AsyncWriteDoit (const FabArray<FArrayBox>& mf, const std::string& mf_name
25242533 fabio->write (ofs, fab, 0 , fab.nComp ());
25252534 }
25262535 ofs.flush ();
2536+ if (!ofs.good ()) { amrex::Error (" VisMF::AsyncWriteDoit failed" ); }
25272537 ofs.close ();
25282538 }
25292539
0 commit comments