Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract restart read/write IO from M2ulPhyS #243

Merged
merged 14 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/M2ulPhyS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ void M2ulPhyS::initVariables() {
if (config.isRestartSerialized("read")) {
assert(serial_mesh->Conforming());
partitioning_ = Array<int>(serial_mesh->GeneratePartitioning(nprocs_, defaultPartMethod), nelemGlobal_);
partitioning_file_hdf5("write");
partitioning_file_hdf5("write", config, groupsMPI, nelemGlobal_, partitioning_);
} else {
partitioning_file_hdf5("read");
partitioning_file_hdf5("read", config, groupsMPI, nelemGlobal_, partitioning_);
}
}

Expand Down Expand Up @@ -359,7 +359,7 @@ void M2ulPhyS::initVariables() {
if (nprocs_ > 1) {
assert(serial_mesh->Conforming());
partitioning_ = Array<int>(serial_mesh->GeneratePartitioning(nprocs_, defaultPartMethod), nelemGlobal_);
if (rank0_) partitioning_file_hdf5("write");
if (rank0_) partitioning_file_hdf5("write", config, groupsMPI, nelemGlobal_, partitioning_);
MPI_Barrier(groupsMPI->getTPSCommWorld());
}

Expand Down Expand Up @@ -655,7 +655,7 @@ void M2ulPhyS::initVariables() {
ioData.registerIOVar("/rmsData", "vw", 5);
}

ioData.initializeSerial(rank0_, (config.RestartSerial() != "no"), serial_mesh);
ioData.initializeSerial(rank0_, (config.RestartSerial() != "no"), serial_mesh, locToGlobElem, &partitioning_);
projectInitialSolution();

// Boundary attributes in present partition
Expand Down Expand Up @@ -1795,7 +1795,7 @@ void M2ulPhyS::initSolutionAndVisualizationVectors() {
}

// define solution parameters for i/o
ioData.registerIOFamily("Solution state variables", "/solution", U);
ioData.registerIOFamily("Solution state variables", "/solution", U, true, true, fec);
ioData.registerIOVar("/solution", "density", 0);
ioData.registerIOVar("/solution", "rho-u", 1);
ioData.registerIOVar("/solution", "rho-v", 2);
Expand Down Expand Up @@ -1988,12 +1988,6 @@ void M2ulPhyS::solveStep() {

const int vis_steps = config.GetNumItersOutput();
if (iter % vis_steps == 0) {
// dump history
// NOTE(kevin): this routine is currently obsolete.
// It computes `dof`-averaged state and time-derivative, which are useless at this point.
// This will not be supported.
writeHistoryFile();

#ifdef HAVE_MASA
if (config.use_mms_) {
if (config.mmsSaveDetails_) {
Expand Down
12 changes: 2 additions & 10 deletions src/M2ulPhyS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,10 @@ class M2ulPhyS : public TPS::Solver {
void initGradUp();
void initilizeSpeciesFromLTE();

// NOTE(kevin): this routine is currently obsolete.
// It computes `dof`-averaged state and time-derivative, which are useless at this point.
// This will not be supported.
void writeHistoryFile();

// i/o routines
void read_partitioned_soln_data(hid_t file, string varName, size_t index, double *data);
void read_serialized_soln_data(hid_t file, string varName, int numDof, int varOffset, double *data, IOFamily &fam);
void restart_files_hdf5(string mode, string inputFileName = std::string());
void partitioning_file_hdf5(string mode);
void serialize_soln_for_write(IOFamily &fam);
void write_soln_data(hid_t group, string varName, hid_t dataspace, double *data);
void write_restart_files_hdf5(hid_t file, bool serialized_write);
void read_restart_files_hdf5(hid_t file, bool serialized_read);

void Check_NAN();
bool Check_JobResubmit();
Expand Down
1 change: 0 additions & 1 deletion src/cycle_avg_joule_coupling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ void CycleAvgJouleCoupling::interpElectricFieldFromEMToFlow() {
efieldR_->SetFromTrueDofs(interp_vals);
efieldR_->HostRead();


const ParGridFunction *efield_imag_gf = qmsa_solver_->getElectricFieldimag();
interp_em_to_flow_->Interpolate(vxyz, *efield_imag_gf, interp_vals);
efieldI_->SetFromTrueDofs(interp_vals);
Expand Down
Loading
Loading