Commit 872c0277 authored by pugmire's avatar pugmire

Add ability to loop multiple times over time sequence.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@18762 18c085ea-50e0-402c-830e-de6fd14e8384
parent 69901988
......@@ -168,74 +168,86 @@ avtTimeLoopFilter::Update(avtContract_p spec)
FinalizeTimeLoop();
int numTimeLoopIterations = GetNumberOfIterations();
//
// This will tell the terminating source how many executions we are doing.
// That in turn will allow the progress to work correctly.
//
int numIters = (actualEnd-startTime)/stride+1;
int numIters = ((actualEnd-startTime)/stride+1)*numTimeLoopIterations;
avtOriginatingSource *src = GetOriginatingSource();
src->SetNumberOfExecutions(numIters);
int curIter = 0;
for (i = startTime; i < actualEnd; i+= stride)
for (currentLoopIter = 0; currentLoopIter < numTimeLoopIterations; currentLoopIter++)
{
bool shouldDoThisTimeSlice = true;
if (parallelizingOverTime)
if ((curIter % PAR_Size()) != PAR_Rank())
shouldDoThisTimeSlice = false;
curIter++;
if (!shouldDoThisTimeSlice)
continue;
if (i < endTime)
currentTime = i;
else
currentTime = endTime;
debug4 << "Time loop filter updating with time slice #"
<< currentTime << endl;
avtSIL *sil = GetInput()->GetOriginatingSource()->GetSIL(currentTime);
if (sil == NULL)
{
debug4 << "Could not read the SIL at state " << currentTime << endl;
currentSILR = orig_SILR;
}
else
debug4 << "Time loop filter updating with iteration # "<<currentLoopIter<<endl;
int curIter = 0;
BeginIteration(currentLoopIter);
for (i = startTime; i < actualEnd; i+= stride)
{
currentSILR = new avtSILRestriction(sil);
currentSILR->SetTopSet(orig_SILR->GetTopSet());
if (!currentSILR->SetFromCompatibleRestriction(orig_SILR))
bool shouldDoThisTimeSlice = true;
if (parallelizingOverTime)
if ((curIter % PAR_Size()) != PAR_Rank())
shouldDoThisTimeSlice = false;
curIter++;
if (!shouldDoThisTimeSlice)
continue;
if (i < endTime)
currentTime = i;
else
currentTime = endTime;
if (!NeedCurrentTimeSlice())
continue;
debug4 << "Time loop filter updating with time slice #"
<< currentTime << endl;
avtSIL *sil = GetInput()->GetOriginatingSource()->GetSIL(currentTime);
if (sil == NULL)
{
debug4 << "Could not Set compatible restriction." << endl;
debug4 << "Could not read the SIL at state " << currentTime << endl;
currentSILR = orig_SILR;
}
}
avtDataRequest_p newDS = new avtDataRequest(orig_DS, currentSILR);
newDS->SetTimestep(currentTime);
else
{
currentSILR = new avtSILRestriction(sil);
currentSILR->SetTopSet(orig_SILR->GetTopSet());
if (!currentSILR->SetFromCompatibleRestriction(orig_SILR))
{
debug4 << "Could not Set compatible restriction." << endl;
currentSILR = orig_SILR;
}
}
avtDataRequest_p newDS = new avtDataRequest(orig_DS, currentSILR);
newDS->SetTimestep(currentTime);
avtContract_p contract =
new avtContract(newDS, spec->GetPipelineIndex());
if (parallelizingOverTime)
{
contract->SetOnDemandStreaming(true);
contract->UseLoadBalancing(false);
}
else
contract->NoStreaming();
avtContract_p contract =
new avtContract(newDS, spec->GetPipelineIndex());
if (parallelizingOverTime)
{
contract->SetOnDemandStreaming(true);
contract->UseLoadBalancing(false);
}
else
contract->NoStreaming();
modified |= avtFilter::Update(contract);
modified |= avtFilter::Update(contract);
if (ExecutionSuccessful())
{
validTimes.push_back(currentTime);
}
else
{
skippedTimes.push_back(currentTime);
if (ExecutionSuccessful())
{
validTimes.push_back(currentTime);
}
else
{
skippedTimes.push_back(currentTime);
}
avtCallback::ResetTimeout(5*60);
}
avtCallback::ResetTimeout(5*60);
}
EndIteration(currentLoopIter);
}
//
// It is possible that execution of some timesteps may have resulted
......
......@@ -74,6 +74,9 @@
// Hank Childs, Wed Dec 15 14:30:42 PST 2010
// Add support for parallelizing over time.
//
// Dave Pugmire, Tue Jul 17 11:52:34 EDT 2012
// Added ability to make multiple passes over the time series.
//
// ****************************************************************************
class PIPELINE_API avtTimeLoopFilter : virtual public avtFilter
......@@ -101,10 +104,14 @@ class PIPELINE_API avtTimeLoopFilter : virtual public avtFilter
protected:
intVector validTimes;
intVector skippedTimes;
int currentTime;
int currentTime, currentLoopIter;
avtSILRestriction_p currentSILR;
std::string errorMessage;
virtual void BeginIteration(int i) {}
virtual void EndIteration(int i) {}
virtual int GetNumberOfIterations() {return 1;}
virtual bool NeedCurrentTimeSlice() {return true;}
virtual void CreateFinalOutput(void) = 0;
virtual bool ExecutionSuccessful(void) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment