only allocate trans_ for globalTrans_

others are not needed for globalTrans_ for now. It will help to flatten
the peak memory usage for rank 0 during a parallel running.
This commit is contained in:
Kai Bao
2024-06-04 11:25:24 +02:00
parent 4cf8a50b26
commit 303a677a81
5 changed files with 31 additions and 17 deletions

View File

@@ -190,7 +190,7 @@ public:
getPropValue<TypeTag,
Properties::EnableDispersion>());
// Re-ordering for ALUGrid
globalTrans_->update(false, [&](unsigned int i) { return gridEquilIdxToGridIdx(i);});
globalTrans_->update(false, true, [&](unsigned int i) { return gridEquilIdxToGridIdx(i);});
}
}
@@ -351,6 +351,10 @@ protected:
std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_;
std::unique_ptr<EquilCartesianIndexMapper> equilCartesianIndexMapper_;
std::unique_ptr<Factory> factory_;
// \Note: this globalTrans_ is used for domain decomposition and INIT file output.
// It only contains trans_ due to permeability and does not contain thermalHalfTrans_,
// diffusivity_ abd dispersivity_. The main reason is to reduce the memory usage for rank 0
// during parallel running.
std::unique_ptr<TransmissibilityType> globalTrans_;
int mpiRank;
};