67 int globalSumSuccessInt = -1;
68 int localSuccessInt = (success ? 0 : 1);
69 MPI_Allreduce(&localSuccessInt, &globalSumSuccessInt, 1,
70 MPI_INT, MPI_SUM, MPI_COMM_WORLD);
80 ECHO(::MPI_Comm_size(MPI_COMM_WORLD, &numProcs));
83 ECHO(::MPI_Comm_rank(MPI_COMM_WORLD, &procRank));
96 out <<
"*** Just make sure the basic barrier does not hang or something.\n";
123 for (
int k = 0; k < numProcs; ++k) {
124 allInts_expected[k] = k+1;
static int getRank()
Returns the process rank relative to MPI_COMM_WORLD
static int getNProc()
Returns the number of processors relative to MPI_COMM_WORLD
#define ECHO(statement)
Echo the given statement before it is executed.
Initialize, finalize, and query the global MPI session.
TEUCHOS_UNIT_TEST(ConstNonconstObjectContainer, create)
void globalReduceSuccess(bool &success, FancyOStream &out)
static bool mpiIsFinalized()
Return whether MPI was already finalized.
std::ostream subclass that performs the magic of indenting data sent to an std::ostream object among ...
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
void resize(size_type new_size, const value_type &x=value_type())
TEST_EQUALITY(rcp_dynamic_cast< const EnhancedNumberValidator< double > >( castedDep1->getValuesAndValidators().find("val1") ->second, true) ->getMax(), double1Vali->getMax())
static int sum(int localVal)
Sum a set of integers across processes.
Templated array class derived from the STL std::vector.
A MPI utilities class, providing methods for initializing, finalizing, and querying the global MPI se...
TEST_ASSERT(castedDep1->getValuesAndValidators().size()==2)
static void barrier()
Perform a barrier so that all processes line up.
static bool mpiIsInitialized()
Return whether MPI was initialized.
static void allGather(int localVal, const ArrayView< int > &allVals)
Global all-to-all of a set of integers across processes.
#define TEST_THROW(code, ExceptType )
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails)...