From 4e16e62c44e049ab17b777de80aa51117806f1be Mon Sep 17 00:00:00 2001 From: Andy Nonaka Date: Mon, 12 Aug 2024 17:27:34 -0700 Subject: [PATCH] checkpoint write --- src_analysis/StructFact.H | 2 +- src_analysis/StructFact.cpp | 38 ++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src_analysis/StructFact.H b/src_analysis/StructFact.H index 1b82ce08..b651e52a 100644 --- a/src_analysis/StructFact.H +++ b/src_analysis/StructFact.H @@ -151,7 +151,7 @@ public: void WriteCheckPoint(const int& step, const amrex::Real& time, - std::string plotfile_base); + std::string checkfile_base); const decltype(cov_names)& get_names() const { return cov_names; } }; diff --git a/src_analysis/StructFact.cpp b/src_analysis/StructFact.cpp index 02dacd7f..59269f36 100644 --- a/src_analysis/StructFact.cpp +++ b/src_analysis/StructFact.cpp @@ -1946,6 +1946,17 @@ void StructFact::WriteCheckPoint(const int& step, BoxArray ba = cov_real.boxArray(); + // single level problem + int nlevels = 1; + + // ---- prebuild a hierarchy of directories + // ---- dirName is built first. if dirName exists, it is renamed. then build + // ---- dirName/subDirPrefix_0 .. dirName/subDirPrefix_nlevels-1 + // ---- if callBarrier is true, call ParallelDescriptor::Barrier() + // ---- after all directories are built + // ---- ParallelDescriptor::IOProcessor() creates the directories + amrex::PreBuildDirectorHierarchy(checkpointname, "Level_", nlevels, true); + VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); // write Header file @@ -1973,13 +1984,38 @@ void StructFact::WriteCheckPoint(const int& step, // write out time HeaderFile << time << "\n"; + // write out misc structure factor member objects + HeaderFile << NVAR << "\n"; + HeaderFile << NVARU << "\n"; + HeaderFile << NCOV << "\n"; + HeaderFile << nsamples << "\n"; + for (int i=0; i