A Discrete-Event Network Simulator
mpi-test-fixtures.h File Reference

Common methods for MPI examples. More...

#include <iomanip>
#include <sstream>
#include <ios>
+ Include dependency graph for mpi-test-fixtures.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  ns3::SinkTracer


 Every class exported by the ns3 library is enclosed in the ns3 namespace.


#define RANK0COUT(x)
 Write to std::cout only from rank 0. More...

Detailed Description

Common methods for MPI examples.

Since MPI output is coming from multiple processors it is the ordering between the processors is non-deterministic. For regression testing the output is sorted to force a deterministic ordering. Methods include here add line number to support this sorting.

Testing output is also grepped so only lines with "TEST" are included. Some MPI launchers emit extra text to output which must be excluded for regression comparisons.

Definition in file mpi-test-fixtures.h.

Macro Definition Documentation


#define RANK0COUT (   x)
do \
if (SinkTracer::GetWorldRank () == 0) \
{ \
std::cout << "TEST : "; \
std::ios_base::fmtflags f( std::cout.flags() ); \
std::cout << std::setfill('0') << std::setw(5) << SinkTracer::GetLineCount (); \
std::cout.flags( f ); \
std::cout << " : " << x; \
} \
while (false)

Write to std::cout only from rank 0.

Number line for sorting output of parallel runs.

xThe output operators.

Definition at line 55 of file mpi-test-fixtures.h.


#define RANK0COUTAPPEND (   x)
do \
if (SinkTracer::GetWorldRank () == 0) \
{ \
std::cout << x ; \
} \
while (false)

Definition at line 67 of file mpi-test-fixtures.h.

double f(double x, void *params)
Definition: 80211b.c:70
list x
Definition: sample-rng-plot.py:34