Commit 79e27df9 authored by pugmire's avatar pugmire
Browse files

Various streamline algorithm tunings.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@6353 18c085ea-50e0-402c-830e-de6fd14e8384
parent c6c3c260
......@@ -157,7 +157,7 @@ avtMasterSlaveSLAlgorithm::avtMasterSlaveSLAlgorithm(avtStreamlineFilter *slFilt
: avtParSLAlgorithm(slFilter)
{
maxCnt = maxCount;
sleepMicroSec = 300;
sleepMicroSec = 100;
latencyTimer = -1;
// Msg type, numTerminated, domain vector.
......@@ -527,6 +527,10 @@ avtMasterSLAlgorithm::UpdateSlaveStatus(vector<int> &status)
int nTerm = status[2];
totalNumStreamlines -= nTerm;
debug5<<"Status: "<<rank<<" "<<nTerm<<" [";
for (int i = 3; i<status.size(); i++) debug5<<status[i]<<" ";
debug5<<"]\n";
for (int i = 0; i < slaveInfo.size(); i++)
{
......@@ -551,6 +555,11 @@ avtMasterSLAlgorithm::UpdateSlaveStatus(vector<int> &status)
// Programmer: Dave Pugmire
// Creation: January 27, 2009
//
// Modifications:
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Add call to check for sent buffers.
//
// ****************************************************************************
void
......@@ -566,7 +575,7 @@ avtMasterSLAlgorithm::Execute()
debug1<<"while ("<<totalNumStreamlines<<" > 0)\n";
if (UpdateStatus())
{
PrintStatus();
//PrintStatus();
/*
Case1(case1Cnt);
Case2(case2Cnt);
......@@ -587,7 +596,7 @@ avtMasterSLAlgorithm::Execute()
//Case5(2*maxCount, false, case5Bcnt);
debug1<<endl<<"Post-Mortem"<<endl;
PrintStatus();
//PrintStatus();
for (int i = 0; i < slaveInfo.size(); i++)
slaveInfo[i].Reset();
......@@ -597,6 +606,7 @@ avtMasterSLAlgorithm::Execute()
debug1<<"Nothing to do: "<<totalNumStreamlines<<endl;
Sleep();
}
CheckPendingSendRequests();
}
SendAllSlavesMsg(MSG_DONE);
......@@ -1043,6 +1053,11 @@ avtMasterSLAlgorithm::Case4(int oobThreshold,
// Programmer: Dave Pugmire
// Creation: January 27, 2009
//
// Modifications:
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Add timeout counter for slaves.
//
// ****************************************************************************
avtSlaveSLAlgorithm::avtSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
......@@ -1051,6 +1066,7 @@ avtSlaveSLAlgorithm::avtSlaveSLAlgorithm(avtStreamlineFilter *slFilter,
: avtMasterSlaveSLAlgorithm(slFilter, maxCount)
{
master = masterRank;
timeout = 0;
}
// ****************************************************************************
......@@ -1193,6 +1209,11 @@ avtSlaveSLAlgorithm::SendStatus(bool forceSend)
msg.push_back(numTerminated);
for (int i = 0; i < status.size(); i++)
msg.push_back(status[i]);
debug5<<"Send: [";
for(int i=0; i<msg.size();i++)debug5<<msg[i]<<" ";
debug5<<"]\n";
SendMsg(master, msg);
//Status just sent, reset.
......@@ -1285,9 +1306,26 @@ avtSlaveSLAlgorithm::Execute()
if (newSLs)
debug1<<"Recv some SLs. sz= "<<activeSLs.size()<<endl;
if (sendStatus || newSLs || newMsgs || numTerminated > 0)
SendStatus();
else
{
if (!workToDo)
{
timeout++;
if (timeout > 1000)
{
debug1<<"TIMEOUT FORCE SEND STATUS\n";
SendStatus(true);
Sleep();
timeout = 0;
}
else if (timeout % 200 == 0)
Sleep();
}
}
CheckPendingSendRequests();
}
#endif
......@@ -1353,6 +1391,8 @@ avtSlaveSLAlgorithm::ProcessMessages(bool &done, bool &newMsgs)
{
vector<vector<int> > msgs;
RecvMsgs(msgs);
debug5<<"avtSlave::ProcessMessages() msgs= "<<msgs.size()<<endl;
done = false;
newMsgs = (msgs.size() > 0);
......@@ -1400,7 +1440,6 @@ avtSlaveSLAlgorithm::ProcessMessages(bool &done, bool &newMsgs)
if (sendSLs.size() > 0)
SendSLs(dst, sendSLs);
}
}
}
......
......@@ -158,6 +158,11 @@ class avtMasterSLAlgorithm : public avtMasterSlaveSLAlgorithm
// Programmer: Dave Pugmire
// Creation: Mon Jan 26 13:25:58 EST 2009
//
// Modifications:
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Add timeout counter for slaves.
//
// ****************************************************************************
class avtSlaveSLAlgorithm : public avtMasterSlaveSLAlgorithm
......@@ -174,7 +179,7 @@ class avtSlaveSLAlgorithm : public avtMasterSlaveSLAlgorithm
virtual void UpdateStatus();
protected:
int master, numTerminated;
int master, numTerminated, timeout;
bool workToDo;
std::vector<int> status, prevStatus;
std::list<avtStreamlineWrapper *> activeSLs, oobSLs;
......
......@@ -383,14 +383,13 @@ avtParSLAlgorithm::SendMsg(int dst,
for (int i = 0; i < msg.size(); i++)
buff[i] = msg[i];
int err = MPI_Isend(buff, statusMsgSz, MPI_INT, dst,
avtParSLAlgorithm::STATUS_TAG,
VISIT_MPI_COMM, &req);
debug5<<"Send: "<<dst<<" [";
for(int i = 0; i < msg.size(); i++) debug5<<buff[i]<<" ";
debug5<<"]\n";
debug5<<"] err= "<<err<<endl;
MPI_Isend(buff, statusMsgSz, MPI_INT, dst,
avtParSLAlgorithm::STATUS_TAG,
VISIT_MPI_COMM, &req);
sendIntBufferMap[req] = buff;
BytesCnt.value += (sizeof(int) *statusMsgSz);
......@@ -452,6 +451,7 @@ avtParSLAlgorithm::RecvMsgs(std::vector<std::vector<int> > &msgs)
for (int i = 0; i < statusRecvRequests.size(); i++)
copy.push_back(statusRecvRequests[i]);
err = MPI_Testsome(nReq, &copy[0], &num, indices, status);
debug5<<"::RecvMsgs() err= "<<err<<" Testsome("<<nReq<<"); num= "<<num<<endl;
if (num > 0)
{
......
......@@ -139,12 +139,21 @@ avtSLAlgorithm::IntegrateStreamline(avtStreamlineWrapper *s)
// Programmer: Dave Pugmire
// Creation: January 27, 2009
//
// Modifications:
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Initialize the initial domain load count and timer.
//
// ****************************************************************************
void
avtSLAlgorithm::Initialize(vector<avtStreamlineWrapper *> &seedPts)
{
numSeedPoints = seedPts.size();
IOTime.value = streamlineFilter->InitialIOTime;
TotalTime.value = streamlineFilter->InitialIOTime;
DomLoadCnt.value = streamlineFilter->InitialDomLoads;
}
// ****************************************************************************
......@@ -164,7 +173,7 @@ avtSLAlgorithm::PostExecute()
debug1<<"avtSLAlgorithm::PostExecute()\n";
vector<avtStreamlineWrapper *> v;
while (! terminatedSLs.empty())
{
v.push_back(terminatedSLs.front());
......@@ -267,9 +276,9 @@ avtSLAlgorithm::CalculateStatistics()
ComputeStatistics(IntegrateTime);
ComputeStatistics(SortTime);
ComputeStatistics(IntegrateCnt);
DomLoadCnt.value = streamlineFilter->GetLoadDSCount();
DomPurgeCnt.value = streamlineFilter->GetPurgeDSCount();
DomLoadCnt.value += streamlineFilter->GetLoadDSCount();
DomPurgeCnt.value += streamlineFilter->GetPurgeDSCount();
ComputeStatistics(DomLoadCnt);
ComputeStatistics(DomPurgeCnt);
......@@ -468,13 +477,21 @@ avtSLAlgorithm::ReportStatistics(ostream &os)
// Programmer: Dave Pugmire
// Creation: January 28, 2009
//
// Modifications:
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Print total TOTAL time.
//
// ****************************************************************************
void
avtSLAlgorithm::ReportTimings(ostream &os, bool totals)
{
os<<"Timings: *********************************************"<<endl;
if (totals)
os<<"t_Time = "<<TotalTime.max<<endl;
{
os<<"t_Time = "<<TotalTime.max<<endl;
os<<"t_TotalTime = "<<TotalTime.total<<endl;
}
else
os<<"l_Time = "<<TotalTime.value<<endl;
......
......@@ -68,7 +68,7 @@ Consider the leaveDomains SLs and the balancing at the same time.
#include <vtkPolyData.h>
#include <vtkSphereSource.h>
#include <vtkPointSource.h>
#include <vtkVisItStreamline.h>
#include <vtkVisItStreamLine.h>
#include <vtkGlyph3D.h>
#include <vtkVisItCellLocator.h>
......@@ -136,6 +136,9 @@ Consider the leaveDomains SLs and the balancing at the same time.
//
// Dave Pugmire, Mon Feb 23, 09:11:34 EST 2009
// Added termination by number of steps.
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Initialize the initial domain load count and timer.
//
// ****************************************************************************
......@@ -176,6 +179,8 @@ avtStreamlineFilter::avtStreamlineFilter()
INIT_POINT(boxExtents, 0., 1., 0.);
INIT_POINT(boxExtents+3, 1., 0., 1.);
useWholeBox = false;
InitialIOTime = 0.0;
InitialDomLoads = 0;
}
......@@ -905,6 +910,9 @@ avtStreamlineFilter::CheckOnDemandViability(void)
// Dave Pugmire, Thu Dec 18 13:24:23 EST 2008
// Add MasterSlave method.
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Initialize the initial domain load count and timer.
//
// ****************************************************************************
void
......@@ -934,7 +942,7 @@ avtStreamlineFilter::Execute(void)
#else
slAlgo = new avtSerialSLAlgorithm(this);
#endif
InitialIOTime = visitTimer->LookupTimer("Reading dataset");
slAlgo->Initialize(seedpoints);
slAlgo->Execute();
slAlgo->PostExecute();
......@@ -996,6 +1004,9 @@ computeMeanStdDev( int nProcs, int rank, float val, float &mean, float &stdDev )
// Hank Childs, Tue Jan 20 13:06:33 CST 2009
// Add support for file formats that do their own domain decomposition.
//
// Dave Pugmire, Mon Feb 23 13:38:49 EST 2009
// Initialize the initial domain load count and timer.
//
// ****************************************************************************
void
......@@ -1084,6 +1095,7 @@ avtStreamlineFilter::Initialize()
ds->Register(NULL);
dataSets[ ds_list.domains[i] ] = ds;
}
InitialDomLoads = ds_list.domains.size();
}
#ifdef PARALLEL
......
......@@ -149,8 +149,11 @@ class avtStreamlineWrapper;
// Dave Pugmire, Thu Feb 5 12:23:33 EST 2009
// Add workGroupSize for masterSlave algorithm.
//
// Dave Pugmire, Mon Feb 23, 09:11:34 EST 2009
// Reworked the termination code. Added a type enum and value.
// Dave Pugmire, Mon Feb 23, 09:11:34 EST 2009
// Reworked the termination code. Added a type enum and value.
//
// Dave Pugmire, Mon Feb 23 13:40:28 EST 2009
// Initial IO time and domain load counter.
//
// ****************************************************************************
......@@ -226,7 +229,8 @@ class AVTFILTERS_API avtStreamlineFilter : public avtDatasetOnDemandFilter
int numSeedPts;
int method;
int maxCount, workGroupSz;
double InitialIOTime;
int InitialDomLoads;
virtual void Execute(void);
virtual void UpdateDataObjectInfo(void);
......
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