added subphase analysis interval
This commit is contained in:
@@ -148,10 +148,11 @@ void SubPhase::Basic(){
|
||||
if (Dm->BoundaryCondition > 0 && Dm->kproc() == Dm->nprocz()-1) kmax=Nz-4;
|
||||
|
||||
imin=jmin=1;
|
||||
// If inlet layers exist use these as default
|
||||
// If inlet/outlet layers exist use these as default
|
||||
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
|
||||
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
|
||||
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z;
|
||||
if (Dm->outlet_layers_z > 0) kmax = Dm->outlet_layers_z;
|
||||
|
||||
nb.reset(); wb.reset();
|
||||
/*
|
||||
|
||||
@@ -389,9 +389,9 @@ public:
|
||||
// Averages.ColorToSignedDistance(beta,Averages.Phase,Averages.Phase_tplus);
|
||||
}
|
||||
if ( matches(type,AnalysisType::ComputeAverages) ) {
|
||||
PROFILE_START("Compute subphase",1);
|
||||
PROFILE_START("Compute basic averages",1);
|
||||
Averages.Basic();
|
||||
PROFILE_STOP("Compute subphase",1);
|
||||
PROFILE_STOP("Compute basic averages",1);
|
||||
}
|
||||
}
|
||||
private:
|
||||
@@ -402,6 +402,29 @@ private:
|
||||
double beta;
|
||||
};
|
||||
|
||||
class SubphaseWorkItem: public ThreadPool::WorkItemRet<void>
|
||||
{
|
||||
public:
|
||||
SubphaseWorkItem( AnalysisType type_, int timestep_, SubPhase& Averages_ ):
|
||||
type(type_), timestep(timestep_), Averages(Averages_){ }
|
||||
~SubphaseWorkItem() { }
|
||||
virtual void run() {
|
||||
|
||||
if ( matches(type,AnalysisType::ComputeAverages) ) {
|
||||
PROFILE_START("Compute subphase",1);
|
||||
Averages.Full();
|
||||
PROFILE_STOP("Compute subphase",1);
|
||||
}
|
||||
}
|
||||
private:
|
||||
SubphaseWorkItem();
|
||||
AnalysisType type;
|
||||
int timestep;
|
||||
SubPhase& Averages;
|
||||
double beta;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* MPI comm wrapper for use with analysis *
|
||||
@@ -479,6 +502,12 @@ runAnalysis::runAnalysis( std::shared_ptr<Database> db,
|
||||
d_blobid_interval = db->getScalar<int>( "blobid_interval" );
|
||||
d_visualization_interval = db->getScalar<int>( "visualization_interval" );
|
||||
auto restart_file = db->getScalar<std::string>( "restart_file" );
|
||||
if (db->keyExists( "subphase_analysis_interval" ){
|
||||
d_subphase_analysis_interval = db->getScalar<int>( "subphase_analysis_interval" );
|
||||
}
|
||||
else{
|
||||
d_subphase_analysis_interval = INT_MAX;
|
||||
}
|
||||
d_restartFile = restart_file + "." + rankString;
|
||||
d_rank = MPI_WORLD_RANK();
|
||||
writeIDMap(ID_map_struct(),0,id_map_filename);
|
||||
@@ -892,10 +921,17 @@ void runAnalysis::basic( int timestep, SubPhase &Averages, const double *Phi, do
|
||||
// if ( matches(type,AnalysisType::ComputeAverages) ) {
|
||||
if ( timestep%d_analysis_interval == 0 ) {
|
||||
auto work = new BasicWorkItem(type,timestep,Averages);
|
||||
work->add_dependency(d_wait_analysis); // Make sure we are done using analysis before modifying
|
||||
work->add_dependency(d_wait_subphase); // Make sure we are done using analysis before modifying
|
||||
work->add_dependency(d_wait_analysis);
|
||||
d_wait_analysis = d_tpool.add_work(work);
|
||||
}
|
||||
|
||||
if ( timestep%d_subphase_analysis_interval == 0 ) {
|
||||
auto work = new BasicWorkItem(type,timestep,Averages);
|
||||
work->add_dependency(d_wait_subphase); // Make sure we are done using analysis before modifying
|
||||
d_wait_subphase = d_tpool.add_work(work);
|
||||
}
|
||||
|
||||
if (timestep%d_restart_interval==0){
|
||||
std::shared_ptr<double> cfq,cDen;
|
||||
// Copy restart data to the CPU
|
||||
|
||||
@@ -88,6 +88,7 @@ private:
|
||||
int d_Np;
|
||||
int d_rank;
|
||||
int d_restart_interval, d_analysis_interval, d_blobid_interval, d_visualization_interval;
|
||||
int d_subphase_analysis_interval;
|
||||
double d_beta;
|
||||
bool d_regular;
|
||||
ThreadPool d_tpool;
|
||||
|
||||
Reference in New Issue
Block a user