#include <iostream>
#include <string>
#include "MPIHelper.h"
Go to the source code of this file.
Classes | |
class | MPIStats |
A non-instantiable wrapper class to track MPI-related statistics. More... | |
Defines | |
#define | TRACK_IDLE_TIME(MPIMethodCall) |
Convenience macro to track time spent in calling a MPI method (only if MPI is available). | |
#define | MPI_PROBE(rank, tag, statusInfo) |
Convenience macro to track time spent in calling a MPI::COMM_WORLD.Probe() method only if MPI is enabled. | |
#define | MPI_SEND(data, count, dataType, rank, tag) |
Convenience macro to track number of calls to MPI::COMM_WORLD.Send() method. | |
#define | MPI_RECV(data, count, dataType, rank, tag) |
Convenience macro to track number of calls to MPI::COMM_WORLD.Recv() method. | |
#define | MPI_BCAST(data, count, dataType, senderRank) |
A simple, convenience macro to track number of calls to MPI::COMM_WORLD.Bcast() method. | |
#define | MPI_REDUCE(srcBufr, destBufr, count, dataType, op, destRank) |
A simple, convenience macro to track number of calls to MPI::COMM_WORLD.Reduce() method. |
#define MPI_BCAST | ( | data, | |||
count, | |||||
dataType, | |||||
senderRank | ) |
{ \ MPI::COMM_WORLD.Bcast(data, count, dataType, senderRank); \ MPIStats::bcastCount++; \ }
A simple, convenience macro to track number of calls to MPI::COMM_WORLD.Bcast() method.
This macro provides a convenient wrapper around MPI's Bcast method call to update MPIStats::bcastCount variable. This macro can be used as shown below:
#include "MPIHelper.h" void someMethod() { // ... some code goes here .. MPI_BCAST(data, count, mpiDataType, senderRank); // ... more code goes here .. }
Definition at line 393 of file MPIStats.h.
Referenced by FilterChain::allToAllBroadcast().
#define MPI_PROBE | ( | rank, | |||
tag, | |||||
statusInfo | ) |
{ \ const double startTime = MPI::Wtime(); \ MPI::COMM_WORLD.Probe(rank, tag, statusInfo); \ if ((statusInfo.Get_error() != MPI::SUCCESS) || \ (statusInfo.Is_cancelled())) { \ throw MPI::Exception(statusInfo.Get_error()); \ } \ MPIStats::idleTime += (MPI::Wtime() - startTime); \ MPIStats::probeCount++; \ }
Convenience macro to track time spent in calling a MPI::COMM_WORLD.Probe() method only if MPI is enabled.
If MPI is not enabled, then this macro does nothing and call to MPI_Probe is never made.
This macro provides a convenient wrapper around MPI's Probe method call to update MPIStats::probeCount variable and update the MPIStats::idleTime variable with the spent in the blocking Probe method. This macro assumes that the Probe call being made must be accounted as idle time for the process and uses the Wtime() method to appropriately time the method call and adds the elapsed time to MPIStats::idleTime variable. This macro must be used as shown below:
#include "MPIHelper.h" void someMethod() { // ... some code goes here .. MPI::Status statusInfo; MPI_PROBE(MPI_ANY_SOURCE, MPI_ANY_TAG, statusInfo)); // ... more code goes here .. }
Definition at line 283 of file MPIStats.h.
Referenced by PMSTClusterMaker::estAdded(), MSTClusterMaker::estAdded(), PMSTClusterMaker::mergeManager(), TransMSTClusterMaker::populateCache(), PMSTClusterMaker::populateCache(), MSTClusterMaker::populateCache(), PMSTClusterMaker::worker(), and MSTClusterMaker::worker().
#define MPI_RECV | ( | data, | |||
count, | |||||
dataType, | |||||
rank, | |||||
tag | ) |
{ \ MPI::COMM_WORLD.Recv(data, count, dataType, rank, tag); \ MPIStats::recvCount++; \ }
Convenience macro to track number of calls to MPI::COMM_WORLD.Recv() method.
This macro provides a convenient wrapper around MPI's Recv method call to update MPIStats::recvCount variable. This macro can be used as shown below:
#include "MPIHelper.h" void someMethod() { // ... some code goes here .. MPI_RECV(data, count, mpiDataType, rank, tag); // ... more code goes here .. }
Definition at line 359 of file MPIStats.h.
Referenced by PMSTClusterMaker::computeNextESTidx(), MSTClusterMaker::computeNextESTidx(), PMSTClusterMaker::estAdded(), MSTClusterMaker::estAdded(), PMSTClusterMaker::makeClusters(), PMSTClusterMaker::managerUpdateCaches(), MSTClusterMaker::managerUpdateCaches(), PMSTClusterMaker::mergeManager(), TransMSTClusterMaker::populateCache(), PMSTClusterMaker::populateCache(), MSTClusterMaker::populateCache(), PMSTClusterMaker::worker(), and MSTClusterMaker::worker().
#define MPI_REDUCE | ( | srcBufr, | |||
destBufr, | |||||
count, | |||||
dataType, | |||||
op, | |||||
destRank | ) |
{ \ MPI::COMM_WORLD.Reduce(srcBufr, destBufr, count, dataType, \ op, destRank); \ MPIStats::reduceCount++; \ }
A simple, convenience macro to track number of calls to MPI::COMM_WORLD.Reduce() method.
This macro provides a convenient wrapper around MPI's Reduce method call to update MPIStats::reduceCount variable. This macro can be used as shown below:
#include "MPIHelper.h" void someMethod() { // ... some code goes here .. int localSuccess = 10, totalSuccess = 0; MPI_REDUCE(&localSuccess, &totalSuccess, 1, MPI::INT, MPI::SUM, 0); // ... more code goes here .. }
Definition at line 429 of file MPIStats.h.
#define MPI_SEND | ( | data, | |||
count, | |||||
dataType, | |||||
rank, | |||||
tag | ) |
{ \ MPI::COMM_WORLD.Send(data, count, dataType, rank, tag); \ MPIStats::sendCount++; \ }
Convenience macro to track number of calls to MPI::COMM_WORLD.Send() method.
This macro provides a convenient wrapper around MPI's Send method call to update MPIStats::sendCount variable. This macro can be used as shown below:
#include "MPIHelper.h" void someMethod() { // ... some code goes here .. MPI_SEND(data, count, mpiDataType, rank, tag); // ... more code goes here .. }
Definition at line 324 of file MPIStats.h.
Referenced by PMSTClusterMaker::makeClusters(), PMSTClusterMaker::mergeWorker(), TransMSTClusterMaker::populateCache(), PMSTClusterMaker::populateCache(), MSTClusterMaker::populateCache(), PMSTClusterMaker::sendToWorkers(), MSTClusterMaker::sendToWorkers(), PMSTClusterMaker::worker(), and MSTClusterMaker::worker().
#define TRACK_IDLE_TIME | ( | MPIMethodCall | ) |
{ \ const double startTime = MPI::Wtime(); \ MPIMethodCall; \ MPIStats::idleTime += (MPI::Wtime() - startTime); \ }
Convenience macro to track time spent in calling a MPI method (only if MPI is available).
This macro provides a convenient wrapper around a given MPI method call to track the time spent in calling a MPI method. This macro assumes that the MPI call being made must be accounted as idle time for the process and uses the Wtime() method to appropriately time the method call and adds the elapsed time to MPIStats::idleTime variable. This macro must be used as shown below:
#include "MPIHelper.h" void someMethod() { MPI::Status statusInfo; TRACK_IDLE_TIME(MPI::COMM_WORLD.Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, statusInfo)); }
Definition at line 239 of file MPIStats.h.
Referenced by PMSTClusterMaker::computeNextESTidx(), MSTClusterMaker::computeNextESTidx(), PMSTClusterMaker::makeClusters(), PMSTClusterMaker::managerUpdateCaches(), MSTClusterMaker::managerUpdateCaches(), and TransMSTClusterMaker::populateCache().