Commit 961e71f4 authored by hrchilds's avatar hrchilds

Refactor out base class, avtPICSFilter, from avtStreamlineFilter.

Also fix minor bug with setting extents when coloring a straemline plot by a
scalar variable.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11579 18c085ea-50e0-402c-830e-de6fd14e8384
parent 46a7d5b3
......@@ -39,6 +39,9 @@
# Hank Childs, Fri Jun 4 17:03:43 CDT 2010
# Remove avtStreamlineWrapper.
#
# Hank Childs, Sat Jun 5 19:03:22 CDT 2010
# Add avtPICSFilter.
#
#****************************************************************************/
SET(AVTFILTERS_SOURCES
......@@ -65,6 +68,7 @@ avtMeshLogFilter.C
avtNamedSelectionFilter.C
avtParDomSLAlgorithm.C
avtParSLAlgorithm.C
avtPICSFilter.C
avtPointToGlyphFilter.C
avtRayCompositer.C
avtRayTracer.C
......
......@@ -83,7 +83,7 @@ int avtMasterSlaveSLAlgorithm::MSG_OFFLOAD_SL = 420010;
// ****************************************************************************
avtMasterSlaveSLAlgorithm*
avtMasterSlaveSLAlgorithm::Create(avtStreamlineFilter *slFilter,
avtMasterSlaveSLAlgorithm::Create(avtPICSFilter *slFilter,
int maxCount,
int rank,
int nProcs,
......@@ -197,7 +197,7 @@ avtMasterSlaveSLAlgorithm::Create(avtStreamlineFilter *slFilter,
//
// ****************************************************************************
avtMasterSlaveSLAlgorithm::avtMasterSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
avtMasterSlaveSLAlgorithm::avtMasterSlaveSLAlgorithm(avtPICSFilter *slFilter,
int maxCount)
: avtParSLAlgorithm(slFilter),
SleepTime("sleepT"), LatencyTime("latT"), MaxLatencyTime("maxLatT"), SleepCnt("sleepC"),
......@@ -255,13 +255,13 @@ avtMasterSlaveSLAlgorithm::Initialize(std::vector<avtStreamline *> &seedPts)
}
void
avtMasterSlaveSLAlgorithm::ResetStreamlinesForContinueExecute()
avtMasterSlaveSLAlgorithm::ResetIntegralCurvesForContinueExecute()
{
EXCEPTION0(ImproperUseException);
}
void
avtMasterSlaveSLAlgorithm::AddStreamlines(std::vector<avtStreamline*> &sls)
avtMasterSlaveSLAlgorithm::AddIntegralCurves(std::vector<avtStreamline*> &sls)
{
EXCEPTION0(ImproperUseException);
}
......@@ -430,7 +430,7 @@ avtMasterSlaveSLAlgorithm::ReportCounters(ostream &os, bool totals)
//
// ****************************************************************************
avtMasterSLAlgorithm::avtMasterSLAlgorithm(avtStreamlineFilter *slFilter,
avtMasterSLAlgorithm::avtMasterSLAlgorithm(avtPICSFilter *slFilter,
int maxCount,
int workGrpSz,
vector<int> &slaves,
......@@ -501,12 +501,15 @@ avtMasterSLAlgorithm::~avtMasterSLAlgorithm()
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename several methods called in this function to reflect the new emphasis // in particle advection, as opposed to streamlines.
//
// ****************************************************************************
void
avtMasterSLAlgorithm::Initialize(std::vector<avtStreamline *> &seedPts)
{
SortStreamlines(seedPts);
SortIntegralCurves(seedPts);
avtMasterSlaveSLAlgorithm::Initialize(seedPts);
int nSeeds = seedPts.size();
......@@ -825,7 +828,7 @@ avtMasterSLAlgorithm::RunAlgorithm()
{
debug1<<"Looping SLs= "<<workGroupActiveSLs<<endl;
ProcessMessages();
ProcessNewStreamlines();
ProcessNewIntegralCurves();
ManageWorkgroup();
CheckPendingSendRequests();
......@@ -1159,7 +1162,7 @@ avtMasterSLAlgorithm::ProcessOffloadSL(vector<int> &status)
// ****************************************************************************
// Method: avtMasterSLAlgorithm::NewStreamlines
// Method: avtMasterSLAlgorithm::NewIntegralCurves
//
// Purpose:
// Handle incoming streamlines.
......@@ -1172,16 +1175,20 @@ avtMasterSLAlgorithm::ProcessOffloadSL(vector<int> &status)
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename this method to reflect the new emphasis in particle advection, as
// opposed to streamlines.
//
// ****************************************************************************
void
avtMasterSLAlgorithm::ProcessNewStreamlines()
avtMasterSLAlgorithm::ProcessNewIntegralCurves()
{
list<avtStreamline*> newSLs;
RecvSLs(newSLs);
if (!newSLs.empty())
{
debug1<<"avtMasterSLAlgorithm::ProcessNewStreamlines() cnt "<<workGroupActiveSLs<<" ==> ";
debug1<<"avtMasterSLAlgorithm::ProcessNewIntegralCurves() cnt "<<workGroupActiveSLs<<" ==> ";
workGroupActiveSLs += newSLs.size();
debug1<<workGroupActiveSLs<<endl;
......@@ -1997,7 +2004,7 @@ avtMasterSLAlgorithm::Case5(int overworkThreshold, bool domainCheck, int &counte
//
// ****************************************************************************
avtSlaveSLAlgorithm::avtSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
avtSlaveSLAlgorithm::avtSlaveSLAlgorithm(avtPICSFilter *slFilter,
int maxCount,
int masterRank)
: avtMasterSlaveSLAlgorithm(slFilter, maxCount)
......@@ -2242,6 +2249,9 @@ avtSlaveSLAlgorithm::SendStatus(bool forceSend)
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename several methods called in this function to reflect the new emphasis // in particle advection, as opposed to streamlines.
//
// ****************************************************************************
void
......@@ -2322,10 +2332,10 @@ avtSlaveSLAlgorithm::RunAlgorithm()
activeSLs.pop_front();
debug1<<"Integrate "<<s->domain<<".....";
IntegrateStreamline(s);
AdvectParticle(s);
if (s->status == avtStreamline::STATUS_TERMINATE)
{
terminatedSLs.push_back(s);
terminatedICs.push_back(s);
numTerminated++;
debug1<<"TERM. nT= "<<numTerminated<<endl;
}
......@@ -2372,12 +2382,12 @@ avtSlaveSLAlgorithm::RunAlgorithm()
if (!activeSLs.empty())
{
debug1<<"activeproblem "<<endl;
terminatedSLs.splice(terminatedSLs.end(), activeSLs);
terminatedICs.splice(terminatedICs.end(), activeSLs);
}
if (!oobSLs.empty())
{
debug1<<"oobproblem "<<endl;
terminatedSLs.splice(terminatedSLs.end(), oobSLs);
terminatedICs.splice(terminatedICs.end(), oobSLs);
}
TotalTime.value += visitTimer->StopTimer(timer, "Execute");
......
......@@ -75,22 +75,27 @@ class SlaveInfo;
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:25:31 CDT 2010
// Change the names of several methods to reflect the new emphasis in
// particle advection, as opposed to streamlines. Also change reference
// from avtStreamlineFilter to avtPICSFilter.
//
// ****************************************************************************
class avtMasterSlaveSLAlgorithm : public avtParSLAlgorithm
{
public:
avtMasterSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
avtMasterSlaveSLAlgorithm(avtPICSFilter *slFilter,
int maxCount);
virtual ~avtMasterSlaveSLAlgorithm();
virtual void Initialize(std::vector<avtStreamline *> &);
virtual const char* AlgoName() const {return "MasterSlave";}
virtual void ResetStreamlinesForContinueExecute();
virtual void AddStreamlines(std::vector<avtStreamline*> &sls);
virtual void ResetIntegralCurvesForContinueExecute();
virtual void AddIntegralCurves(std::vector<avtStreamline*> &sls);
static avtMasterSlaveSLAlgorithm* Create(avtStreamlineFilter *slFilter,
static avtMasterSlaveSLAlgorithm* Create(avtPICSFilter *slFilter,
int maxCount,
int rank,
int nProcs,
......@@ -163,7 +168,7 @@ class avtMasterSlaveSLAlgorithm : public avtParSLAlgorithm
class avtMasterSLAlgorithm : public avtMasterSlaveSLAlgorithm
{
public:
avtMasterSLAlgorithm(avtStreamlineFilter *slFilter,
avtMasterSLAlgorithm(avtPICSFilter *slFilter,
int maxCount,
int workGrpSz,
std::vector<int> &slaves,
......@@ -184,7 +189,7 @@ class avtMasterSLAlgorithm : public avtMasterSlaveSLAlgorithm
virtual void ProcessSlaveUpdate(std::vector<int> &);
virtual void ProcessMasterUpdate(std::vector<int> &);
virtual void ProcessOffloadSL(std::vector<int> &);
virtual void ProcessNewStreamlines();
virtual void ProcessNewIntegralCurves();
virtual void ManageWorkgroup();
virtual void ManageSlaves();
virtual void ManageMasters();
......@@ -248,7 +253,7 @@ class avtMasterSLAlgorithm : public avtMasterSlaveSLAlgorithm
class avtSlaveSLAlgorithm : public avtMasterSlaveSLAlgorithm
{
public:
avtSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
avtSlaveSLAlgorithm(avtPICSFilter *slFilter,
int maxCount,
int masterRank);
virtual ~avtSlaveSLAlgorithm();
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtPICSFilter.h //
// ************************************************************************* //
#ifndef AVT_PICS_FILTER_H
#define AVT_PICS_FILTER_H
#include <avtStreamline.h>
#include <avtDatasetOnDemandFilter.h>
#include <avtDatasetToDatasetFilter.h>
#include <avtIVPDopri5.h>
#include <avtVec.h>
#include <avtIntervalTree.h>
#include <MemStream.h>
#include <filters_exports.h>
#ifdef PARALLEL
#include <avtParallel.h>
#include <mpi.h>
#endif
class vtkVisItCellLocator;
class DomainType;
class avtSLAlgorithm;
#define STREAMLINE_TERMINATE_DISTANCE 0
#define STREAMLINE_TERMINATE_TIME 1
#define STREAMLINE_TERMINATE_STEPS 2
#define STREAMLINE_TERMINATE_INTERSECTIONS 3
#define STREAMLINE_INTEGRATE_DORMAND_PRINCE 0
#define STREAMLINE_INTEGRATE_ADAMS_BASHFORTH 1
#define STREAMLINE_INTEGRATE_M3D_C1_INTEGRATOR 2
#define STREAMLINE_STAGED_LOAD_ONDEMAND 0
#define STREAMLINE_PARALLEL_STATIC_DOMAINS 1
#define STREAMLINE_MASTER_SLAVE 2
// ****************************************************************************
// Class: avtPICSFilter
//
// Purpose:
// PICS = Parallel integral curve system. An abstract type. The purpose
// of this filter is to define an AVT filter that can do parallel
// particle advection. How to analyze those particles, termination
// criteria, etc, are left to the derived types. Examples of derived
// types are for streamlines and poincare analysis.
//
// Programmer: Hank Childs (extracted base class from avtStreamlineFilter)
// Creation: June 5, 2010
//
// ****************************************************************************
class AVTFILTERS_API avtPICSFilter :
virtual public avtDatasetOnDemandFilter,
virtual public avtDatasetToDatasetFilter
{
public:
avtPICSFilter();
virtual ~avtPICSFilter();
virtual const char *GetType(void) { return "avtPICSFilter"; };
virtual const char *GetDescription(void)
{ return "Advecting particles"; };
virtual avtStreamline *CreateIntegralCurve() = 0;
virtual avtStreamline *CreateIntegralCurve(
const avtIVPSolver* model,
const double& t_start,
const avtVector &p_start, int ID) = 0;
virtual std::vector<avtVector> GetInitialLocations() = 0;
// Methods to set the filter's attributes.
void SetMaxStepLength(double len);
void SetTermination(int type, double term);
void SetPathlines(bool pathlines, double time0=0.0);
void SetIntegrationType(int algo);
void SetStreamlineAlgorithm(int algo, int maxCnt,
int domainCache,
int workGrpSz);
void SetTolerances(double reltol, double abstol);
void SetIntegrationDirection(int dir);
void InitializeLocators(void);
protected:
double maxStepLength;
double relTol;
double absTol;
avtIVPSolver::TerminateType terminationType;
int integrationType;
double termination;
int integrationDirection;
int dataSpatialDimension;
avtSLAlgorithm *slAlgo;
avtContract_p lastContract;
std::vector<std::vector<double> > domainTimeIntervals;
std::string pathlineVar, pathlineNextTimeVar;
bool doPathlines;
double seedTime0;
int seedTimeStep0;
avtIntervalTree *intervalTree;
bool specifyPoint;
avtIVPSolver *solver;
int numDomains, numTimeSteps, cacheQLen;
std::vector<int> domainToRank;
std::vector<vtkDataSet*>dataSets;
std::map<DomainType, vtkVisItCellLocator*> domainToCellLocatorMap;
std::vector<double> pointList;
// Data retrieved from contract
int activeTimeStep;
//Timings helpers.
int numSeedPts, MaxID;
int method;
int maxCount, workGroupSz;
double InitialIOTime;
int InitialDomLoads;
virtual void Execute(void);
virtual bool ContinueExecute() {return false;}
virtual void PreExecute(void);
virtual void PostExecute(void);
virtual avtContract_p ModifyContract(avtContract_p);
virtual void ExamineContract(avtContract_p);
virtual bool CheckOnDemandViability(void);
void AdvectParticle(avtStreamline *sl, int maxSteps=-1);
void IntegrateDomain(avtStreamline *sl,
vtkDataSet *ds,
double *extents,
int maxSteps=-1);
virtual vtkDataSet *GetDomain(const DomainType &, double = 0.0, double = 0.0, double = 0.0);
virtual int GetTimeStep(double &t) const;
virtual bool DomainLoaded(DomainType &) const;
void SetZToZero(vtkPolyData *) const;
int GetNextCurveID(){ int id = MaxID; MaxID++; return id;}
void CreateIntegralCurvesFromSeeds(std::vector<avtVector> &pts,
std::vector<avtStreamline *> &streamlines,
std::vector<std::vector<int> > &ids);
void GetIntegralCurvesFromInitialSeeds(std::vector<avtStreamline *> &sls);
void AddSeedpoints(std::vector<avtVector> &pts,
std::vector<std::vector<int> > &ids);
void DeleteIntegralCurves(std::vector<int> &slIDs);
virtual void CreateIntegralCurveOutput(vector<avtStreamline *> &streamlines)
= 0;
void GetTerminatedIntegralCurves(vector<avtStreamline *> &sls);
// Helper functions.
bool PointInDomain(avtVector &pt, DomainType &domain);
int DomainToRank(DomainType &domain);
void ComputeDomainToRankMapping();
bool OwnDomain(DomainType &domain);
void SetDomain(avtStreamline *sl);
void Initialize();
void ComputeRankList(const std::vector<int> &domList,
std::vector<int> &ranks,
std::vector<int> &doms );
vtkVisItCellLocator *SetupLocator(const DomainType &, vtkDataSet *);
friend class avtSLAlgorithm;
};
#endif
......@@ -66,12 +66,12 @@ using namespace std;
//
// ****************************************************************************
avtParDomSLAlgorithm::avtParDomSLAlgorithm(avtStreamlineFilter *slFilter,
avtParDomSLAlgorithm::avtParDomSLAlgorithm(avtPICSFilter *slFilter,
int maxCount)
: avtParSLAlgorithm(slFilter)
{
numSLChange = 0;
totalNumStreamlines = 0;
totalNumIntegralCurves = 0;
maxCnt = maxCount;
}
......@@ -117,6 +117,10 @@ avtParDomSLAlgorithm::~avtParDomSLAlgorithm()
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename method called in this function to reflect the new emphasis
// in particle advection, as opposed to streamlines.
//
// ****************************************************************************
void
......@@ -128,11 +132,11 @@ avtParDomSLAlgorithm::Initialize(vector<avtStreamline *> &seedPts)
avtParSLAlgorithm::Initialize(seedPts, 1, numRecvs);
numSLChange = 0;
AddStreamlines(seedPts);
AddIntegralCurves(seedPts);
}
// ****************************************************************************
// Method: avtParDomSLAlgorithm::AddStreamlines
// Method: avtParDomSLAlgorithm::AddIntegralCurves
//
// Purpose:
// Add streamlines
......@@ -145,10 +149,14 @@ avtParDomSLAlgorithm::Initialize(vector<avtStreamline *> &seedPts)
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename this method to reflect the new emphasis in particle advection, as
// opposed to streamlines.
//
// ****************************************************************************
void
avtParDomSLAlgorithm::AddStreamlines(std::vector<avtStreamline*> &sls)
avtParDomSLAlgorithm::AddIntegralCurves(std::vector<avtStreamline*> &sls)
{
//Get the SLs that I own.
for (int i = 0; i < sls.size(); i++)
......@@ -192,10 +200,10 @@ avtParDomSLAlgorithm::AddStreamlines(std::vector<avtStreamline*> &sls)
delete [] idBuffer2;
*/
totalNumStreamlines = activeSLs.size();
SumIntAcrossAllProcessors(totalNumStreamlines);
totalNumIntegralCurves = activeSLs.size();
SumIntAcrossAllProcessors(totalNumIntegralCurves);
/*
debug5<<"Init_totalNumStreamlines= "<<totalNumStreamlines<<endl;
debug5<<"Init_totalNumIntegralCurves= "<<totalNumIntegralCurves<<endl;
debug5<<"My SLs: "<<endl;
list<avtStreamline *>::iterator s;
for (s = activeSLs.begin(); s != activeSLs.end(); ++s)
......@@ -228,6 +236,10 @@ avtParDomSLAlgorithm::AddStreamlines(std::vector<avtStreamline*> &sls)
// Dave Pugmire, Fri Feb 6 08:43:00 EST 2009
// Change numTerminated to numSLChange.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename data members to reflect the new emphasis in particle advection, as
// opposed to streamlines.
//
// ****************************************************************************
void
......@@ -240,7 +252,7 @@ avtParDomSLAlgorithm::ExchangeTermination()
msg[0] = numSLChange;
SendAllMsg(msg);
totalNumStreamlines += numSLChange;
totalNumIntegralCurves += numSLChange;
numSLChange = 0;
}
......@@ -250,7 +262,7 @@ avtParDomSLAlgorithm::ExchangeTermination()
for (int i = 0; i < msgs.size(); i++)
{
debug2<<msgs[i][1]<<" slChange= "<<msgs[i][1]<<endl;
totalNumStreamlines += msgs[i][1];
totalNumIntegralCurves += msgs[i][1];
}
}
......@@ -271,7 +283,7 @@ avtParDomSLAlgorithm::ExchangeTermination()
void
avtParDomSLAlgorithm::PreRunAlgorithm()
{
streamlineFilter->InitializeLocators();
picsFilter->InitializeLocators();
}
// ****************************************************************************
......@@ -302,6 +314,10 @@ avtParDomSLAlgorithm::PreRunAlgorithm()
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename data members to reflect the new emphasis in particle advection, as
// opposed to streamlines.
//
// ****************************************************************************
void
......@@ -310,7 +326,7 @@ avtParDomSLAlgorithm::RunAlgorithm()
debug1<<"avtParDomSLAlgorithm::RunAlgorithm()\n";
int timer = visitTimer->StartTimer();
while (totalNumStreamlines > 0)
while (totalNumIntegralCurves > 0)
{
//Integrate upto maxCnt streamlines.
list<avtStreamline *>::iterator s;
......@@ -320,11 +336,11 @@ avtParDomSLAlgorithm::RunAlgorithm()
avtStreamline *s = activeSLs.front();
activeSLs.pop_front();
IntegrateStreamline(s);
AdvectParticle(s);
if (s->status == avtStreamline::STATUS_TERMINATE)
{
debug5<<"TerminatedSL: "<<s->id<<endl;
terminatedSLs.push_back(s);
terminatedICs.push_back(s);
numSLChange--;
}
else
......@@ -405,7 +421,7 @@ avtParDomSLAlgorithm::HandleOOBSL(avtStreamline *s)
}
// ****************************************************************************
// Method: avtParDomSLAlgorithm::ResetStreamlinesForContinueExecute
// Method: avtParDomSLAlgorithm::ResetIntegralCurvesForContinueExecute
//
// Purpose:
// Reset for continued streamline integration.
......@@ -418,15 +434,19 @@ avtParDomSLAlgorithm::HandleOOBSL(avtStreamline *s)
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:21:30 CDT 2010
// Rename this method to reflect the new emphasis in particle advection, as
// opposed to streamlines.
//
// ****************************************************************************
void
avtParDomSLAlgorithm::ResetStreamlinesForContinueExecute()
avtParDomSLAlgorithm::ResetIntegralCurvesForContinueExecute()
{
while (! terminatedSLs.empty())
while (! terminatedICs.empty())
{
avtStreamline *s = terminatedSLs.front();
terminatedSLs.pop_front();
avtStreamline *s = terminatedICs.front();
terminatedICs.pop_front();
activeSLs.push_back(s);
numSLChange++;
......
......@@ -80,17 +80,22 @@
// Hank Childs, Fri Jun 4 19:58:30 CDT 2010
// Use avtStreamlines, not avtStreamlineWrappers.
//
// Hank Childs, Sun Jun 6 12:25:31 CDT 2010
// Change the names of several methods to reflect the new emphasis in
// particle advection, as opposed to streamlines. Also change reference
// from avtStreamlineFilter to avtPICSFilter.
//
// ****************************************************************************
class avtParDomSLAlgorithm : public avtParSLAlgorithm
{
public:
avtParDomSLAlgorithm(avtStreamlineFilter *slFilter, int maxCount);
avtParDomSLAlgorithm(avtPICSFilter *slFilter, int maxCount);
virtual ~avtParDomSLAlgorithm();
virtual void Initialize(std::vector<avtStreamline *> &);
virtual void AddStreamlines(std::vector<avtStreamline*> &sls);
virtual void ResetStreamlinesForContinueExecute();
virtual void AddIntegralCurves(std::vector<avtStreamline*> &sls);
virtual void ResetIntegralCurvesForContinueExecute();
virtual const char* AlgoName() const {return "ParallelStaticDomains";}
protected:
......@@ -99,7 +104,7 @@ class avtParDomSLAlgorithm : public avtParSLAlgorithm
void ExchangeTermination();
void HandleOOBSL(avtStreamline *s);
int numSLChange, totalNumStreamlines;
int numSLChange, totalNumIntegralCurves;
std::list<avtStreamline *> activeSLs;
int maxCnt;
......
......@@ -67,7 +67,7 @@ int avtParSLAlgorithm::STREAMLINE_TAG = 420001;
//
// ****************************************************************************
avtParSLAlgorithm::avtParSLAlgorithm(avtStreamlineFilter *slFilter)
avtParSLAlgorithm::avtParSLAlgorithm(avtPICSFilter *slFilter)
: avtSLAlgorithm(slFilter),
CommTime("comT"), MsgCnt("msgC"), SLCommCnt("slcC"), BytesCnt("byteC")
{
......@@ -233,7 +233,7 @@ void
avtParSLAlgorithm::ExchangeSLSteps()
{
debug5<<"ExchangeSLSteps: communicatedSLs: "<<communicatedSLs.size();
debug5<<" terminatedSLs: "<<terminatedSLs.size()<<endl;
debug5<<" terminatedICs: "<<terminatedICs.size()<<endl;
//Communicate to everyone where the terminators are located.
//Do this "N" streamlines at a time, so we don't have a super big buffer.
......@@ -246,7 +246,7 @@ avtParSLAlgorithm::ExchangeSLSteps()
long *idBuffer = new long[2*N], *myIDs = new long[2*N];
//Sort the terminated/communicated SLs by id.
terminatedSLs.sort(avtStreamline::IdSeqCompare);
terminatedICs.sort(avtStreamline::IdSeqCompare);
communicatedSLs.sort(avtStreamline::IdSeqCompare);
vector<vector<avtStreamline *> >sendSLs(N);
......@@ -272,8 +272,8 @@ avtParSLAlgorithm::ExchangeSLSteps()
//Set array for SLs that terminated here. Update sequence counts for communicated
//SLs.
list<avtStreamline*>::iterator t = terminatedSLs.begin();
while (t != terminatedSLs.end() && (*t)->id <= maxId)
list<avtStreamline*>::iterator t = terminatedICs.begin();
while (t != terminatedICs.end() && (*t)->id <= maxId)
{
if ((*t)->id >= minId)
{
......@@ -318,7 +318,7 @@ avtParSLAlgorithm::ExchangeSLSteps()
int idx = s->id%N;
int owner = idBuffer[idx];
if (owner == rank)
terminatedSLs.push_back(s);
terminatedICs.push_back(s);
else
{
s->serializeFlags = avtStreamline::SERIALIZE_STEPS; //Write SL steps.
......@@ -347,14 +347,14 @@ avtParSLAlgorithm::ExchangeSLSteps()
bool seqGathered = false;
while (!seqGathered)
{
RecvSLs(terminatedSLs);
RecvSLs(terminatedICs);
//See if we have all the sequences we need.
terminatedSLs.sort(avtStreamline::IdSeqCompare);
terminatedICs.sort(avtStreamline::IdSeqCompare);
bool needMore = false;
for (int i = 0; i < N && !needMore; i++)
if (idBuffer[i] == rank)
needMore = (CountIDs(terminatedSLs, i+minId) < idBuffer[i+N]);
needMore = (CountIDs(terminatedICs, i+minId) < idBuffer[i+N]);
//Everyone done.
seqGathered = !needMore;
......@@ -392,14 +392,14 @@ void
avtParSLAlgorithm::MergeTerminatedSLSequences()
{
//Sort them by id and sequence so we can process them one at a time.
terminatedSLs.sort(avtStreamline::IdSeqCompare);
terminatedICs.sort(avtStreamline::IdSeqCompare);
//Split them up into sequences.
vector<vector<avtStreamline *> > seqs;
while (!terminatedSLs.empty())
while (!terminatedICs.empty())
{
avtStreamline *s = terminatedSLs.front();
terminatedSLs.pop_front();
avtStreamline *s = terminatedICs.front();
terminatedICs.pop_front();