Remove debugging information.

This commit is contained in:
Dave Pugmire 2023-03-30 13:34:03 -04:00
parent 42f183e81f
commit dc547de809
4 changed files with 1 additions and 62 deletions

@ -99,22 +99,18 @@ public:
vtkm::Id nLocal = static_cast<vtkm::Id>(this->Active.size() + this->Inactive.size());
this->ComputeTotalNumParticles(nLocal);
messenger.Log << "Begin" << std::endl;
while (this->TotalNumTerminatedParticles < this->TotalNumParticles)
{
messenger.Log << " TotNumTerminated= " << this->TotalNumTerminatedParticles << std::endl;
std::vector<ParticleType> v;
vtkm::Id numTerm = 0, blockId = -1;
if (this->GetActiveParticles(v, blockId))
{
messenger.Log << " Advect " << v.size() << " in block " << blockId << std::endl;
//make this a pointer to avoid the copy?
auto& block = this->GetDataSet(blockId);
DSIHelperInfoType bb =
DSIHelperInfo<ParticleType>(v, this->BoundsMap, this->ParticleBlockIDsMap);
block.Advect(bb, this->StepSize, this->NumberOfSteps);
numTerm = this->UpdateResult(bb.Get<DSIHelperInfo<ParticleType>>());
messenger.Log << " numTerm= " << numTerm << std::endl;
}
vtkm::Id numTermMessages = 0;
@ -124,7 +120,6 @@ public:
if (this->TotalNumTerminatedParticles > this->TotalNumParticles)
throw vtkm::cont::ErrorFilterExecution("Particle count error");
}
messenger.Log << "Done" << std::endl;
}
@ -204,8 +199,6 @@ public:
numTermMessages = 0;
bool block = this->GetBlockAndWait(messenger.UsingSyncCommunication(), numLocalTerminations);
messenger.Log << " Communicate: AI= " << this->Active.size() << " " << this->Inactive.size()
<< " localTerm= " << numLocalTerminations << " Block= " << block << std::endl;
messenger.Exchange(this->Inactive,
this->ParticleBlockIDsMap,
numLocalTerminations,
@ -217,8 +210,6 @@ public:
this->Inactive.clear();
this->UpdateActive(incoming, incomingIDs);
messenger.Log << " Communicate Done: AI= " << this->Active.size() << " "
<< this->Inactive.size() << " numTermMsg= " << numTermMessages << std::endl;
}
virtual void UpdateActive(const std::vector<ParticleType>& particles,

@ -145,7 +145,6 @@ protected:
vtkm::filter::flow::internal::ParticleMessenger<ParticleType> messenger(
this->Comm, useAsync, this->BoundsMap, 1, 128);
messenger.Log << "Begin" << std::endl;
while (this->TotalNumTerminatedParticles < this->TotalNumParticles)
{
std::unordered_map<vtkm::Id, std::vector<DSIHelperInfoType>> workerResults;
@ -157,8 +156,6 @@ protected:
for (auto& r : it.second)
numTerm += this->UpdateResult(r.Get<DSIHelperInfo<ParticleType>>());
}
messenger.Log << " Advected: " << workerResults.size() << " numTerm= " << numTerm
<< std::endl;
vtkm::Id numTermMessages = 0;
this->Communicate(messenger, numTerm, numTermMessages);
@ -168,7 +165,6 @@ protected:
throw vtkm::cont::ErrorFilterExecution("Particle count error");
}
messenger.Log << "DONE" << std::endl;
//Let the workers know that we are done.
this->SetDone();
}

@ -43,8 +43,6 @@ Messenger::Messenger(vtkmdiy::mpi::communicator& comm, bool useAsyncComm)
Messenger::Messenger(vtkmdiy::mpi::communicator& vtkmNotUsed(comm), bool vtkmNotUsed(useAsyncComm))
#endif
{
std::string fname = "out." + std::to_string(this->Rank) + ".log";
this->Log.open(fname, std::ofstream::out);
}
#ifdef VTKM_ENABLE_MPI
@ -274,9 +272,6 @@ void Messenger::SendDataAsync(int dst, int tag, const vtkmdiy::MemoryBuffer& buf
void Messenger::SendDataSync(int dst, int tag, vtkmdiy::MemoryBuffer& buff)
{
this->Log << " SendDataSync: sendTo= " << dst << " tag= " << tag << " sz= " << buff.size()
<< std::endl;
auto entry = std::make_pair(dst, std::move(buff));
auto it = this->SyncSendBuffers.find(tag);
if (it == this->SyncSendBuffers.end())
@ -289,7 +284,6 @@ void Messenger::SendDataSync(int dst, int tag, vtkmdiy::MemoryBuffer& buff)
it->second.emplace_back(std::move(entry));
it = this->SyncSendBuffers.find(tag);
this->Log << " SendDataSync: SyncSendBuffs[tag] = " << it->second.size() << std::endl;
}
bool Messenger::RecvDataAsync(const std::set<int>& tags,
@ -331,7 +325,6 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
bool blockAndWait)
{
buffers.resize(0);
this->Log << " RecvDataSync: block= " << blockAndWait << std::endl;
if (!blockAndWait)
return false;
@ -363,16 +356,12 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
if (err != MPI_SUCCESS)
throw vtkm::cont::ErrorFilterExecution("Error in MPI_Isend inside Messenger::RecvDataSync");
this->Log << " tag= " << tag << std::endl;
this->Log << " numMessages= " << numMessages << std::endl;
this->Log << " maxBuffSize= " << maxBuffSize << std::endl;
MPI_Status status;
std::vector<char> recvBuff;
for (int r = 0; r < this->NumRanks; r++)
{
int numMsgs = numMessages[r];
this->Log << " R= " << r << " nMsgs= " << numMsgs << std::endl;
if (numMsgs == 0)
continue;
@ -383,15 +372,12 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
recvBuff.resize(maxSz);
for (int n = 0; n < numMsgs; n++)
{
this->Log << " Recv " << n << " of " << numMsgs << " sz= " << maxSz << std::endl;
err =
MPI_Recv(recvBuff.data(), maxSz, MPI_BYTE, MPI_ANY_SOURCE, 0, this->MPIComm, &status);
if (err != MPI_SUCCESS)
throw vtkm::cont::ErrorFilterExecution(
"Error in MPI_Recv inside Messenger::RecvDataSync");
this->Log << " Recv " << n << " of " << numMsgs << " sz= " << maxSz << std::endl;
this->Log << " Recv complete: " << status.MPI_SOURCE << " " << status.MPI_TAG << " "
<< status.MPI_ERROR << std::endl;
std::pair<int, vtkmdiy::MemoryBuffer> entry;
entry.first = tag;
entry.second.buffer = recvBuff;
@ -403,13 +389,10 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
if (it != this->SyncSendBuffers.end())
{
//it = <tag, <dst,buffer>>
this->Log << " Send to: " << r << " I have " << it->second.size() << std::endl;
for (const auto& dst_buff : it->second)
{
this->Log << " SendDst= " << dst_buff.first << std::endl;
if (dst_buff.first == r)
{
this->Log << " Send to " << r << " sz= " << dst_buff.second.size() << std::endl;
err = MPI_Send(dst_buff.second.buffer.data(),
dst_buff.second.size(),
MPI_BYTE,
@ -419,7 +402,6 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
if (err != MPI_SUCCESS)
throw vtkm::cont::ErrorFilterExecution(
"Error in MPI_Send inside Messenger::RecvDataSync");
this->Log << " Send complete" << std::endl;
}
}
}
@ -431,10 +413,7 @@ bool Messenger::RecvDataSync(const std::set<int>& tags,
this->SyncSendBuffers.erase(it);
}
this->Log << " Barrier Begin" << std::endl;
MPI_Barrier(this->MPIComm);
this->Log << " Barrier End" << std::endl;
this->Log << " buffers.size() = " << buffers.size() << std::endl;
return !buffers.empty();
}

@ -33,27 +33,6 @@ namespace flow
namespace internal
{
#ifdef NDEBUG
namespace
{
struct NullStream
{
void open(const std::string&, std::ios_base::openmode) {}
};
template <typename T>
NullStream& operator<<(NullStream& s, T const&)
{
return s;
}
NullStream& operator<<(NullStream& s, std::ostream&(std::ostream&))
{
return s;
}
}
#endif
class VTKM_FILTER_FLOW_EXPORT Messenger
{
public:
@ -74,12 +53,6 @@ public:
bool UsingSyncCommunication() const { return !this->UsingAsyncCommunication(); }
bool UsingAsyncCommunication() const { return this->UseAsynchronousCommunication; }
#ifdef NDEBUG
NullStream Log;
#else
std::ofstream Log;
#endif
protected:
static std::size_t CalcMessageBufferSize(std::size_t msgSz);