MPIStats.h File Reference

#include <iostream>
#include <string>
#include "MPIHelper.h"
Include dependency graph for MPIStats.h:
This graph shows which files directly or indirectly include this file:

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 Documentation

#define MPI_BCAST ( data,
count,
dataType,
senderRank   ) 
Value:
{                 \
        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 ..
    }
Note:
This macro calls MPI::COMM_WORD.Bcast only if MPI is enabled. If MPI is not enabled (or is unavailable) then this macro reduces to nothing and the actual broadcast call is never made.

Definition at line 393 of file MPIStats.h.

Referenced by FilterChain::allToAllBroadcast().

#define MPI_PROBE ( rank,
tag,
statusInfo   ) 
Value:
{                \
        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 ..
    }
Note:
This macro call checks the statsInfo after the Probe call to ensure that the MPI call completed successfully. If errors are found, then this method throws an exception.

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   ) 
Value:
{           \
        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 ..
    }
Note:
This macro calls MPI::COMM_WORD.Send only if MPI is enabled. If MPI is not enabled (or is unavailable) then this macro reduces to nothing and the actual receive call is never made.

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   ) 
Value:
{ \
        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 ..
    }
Note:
This macro calls MPI::COMM_WORD.Reduce only if MPI is enabled. If MPI is not enabled (or is unavailable) then this macro reduces to nothing and the actual broadcast call is never made.

Definition at line 429 of file MPIStats.h.

#define MPI_SEND ( data,
count,
dataType,
rank,
tag   ) 
Value:
{           \
        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 ..
    }
Note:
This macro calls MPI::COMM_WORD.Send only if MPI is enabled. If MPI is not enabled (or is unavailable) then this macro reduces to nothing and the actual send call is never made.

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   ) 
Value:
{                        \
        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));
    }
Note:
If you are tracking idle time for the Probe method, use MPI_PROBE macro directly as it automatically tracks the idle time too.

Definition at line 239 of file MPIStats.h.

Referenced by PMSTClusterMaker::computeNextESTidx(), MSTClusterMaker::computeNextESTidx(), PMSTClusterMaker::makeClusters(), PMSTClusterMaker::managerUpdateCaches(), MSTClusterMaker::managerUpdateCaches(), and TransMSTClusterMaker::populateCache().


Generated on 19 Mar 2010 for PEACE by  doxygen 1.6.1