Sierra Toolkit  Version of the Day
Parallel_module

Typedefs

typedef MPI_Comm stk_classic::ParallelMachine
 
typedef MPI_Datatype stk_classic::ParallelDatatype
 

Functions

ParallelMachine stk_classic::parallel_machine_null ()
 parallel_machine_null returns MPI_COMM_NULL if MPI is enabled. More...
 
ParallelMachine stk_classic::parallel_machine_init (int *argc, char ***argv)
 parallel_machine_init calls MPI_Init. More...
 
void stk_classic::parallel_machine_finalize ()
 parallel_machine_finalize calls MPI_Finalize.
 
void stk_classic::all_write_string (ParallelMachine, std::ostream &, const std::string &)
 Write string from any or all processors to the ostream on the root processor. More...
 
void stk_classic::all_reduce_sum (ParallelMachine, const double *local, double *global, unsigned count)
 Parallel summation to all processors.
 
void stk_classic::all_reduce_sum (ParallelMachine, const float *local, float *global, unsigned count)
 Parallel summation to all processors.
 
void stk_classic::all_reduce_sum (ParallelMachine, const int *local, int *global, unsigned count)
 Parallel summation to all processors.
 
void stk_classic::all_reduce_sum (ParallelMachine, const size_t *local, size_t *global, unsigned count)
 Parallel summation to all processors.
 
void stk_classic::all_reduce_bor (ParallelMachine, const unsigned *local, unsigned *global, unsigned count)
 Parallel bitwise-or to all processors.
 
template<class ReduceOp >
void stk_classic::all_reduce (ParallelMachine, const ReduceOp &)
 

Detailed Description

Typedef Documentation

◆ ParallelMachine

typedef MPI_Comm stk_classic::ParallelMachine
Todo:
REFACTOR: Figure out a better way to typedef for non-MPI builds

Definition at line 32 of file Parallel.hpp.

◆ ParallelDatatype

typedef MPI_Datatype stk_classic::ParallelDatatype
Todo:
REFACTOR: Figure out a better way to typedef for non-MPI builds

Definition at line 36 of file Parallel.hpp.

Function Documentation

◆ parallel_machine_null()

ParallelMachine stk_classic::parallel_machine_null ( )
inline

parallel_machine_null returns MPI_COMM_NULL if MPI is enabled.

Returns
a ParallelMachine ...

Definition at line 43 of file Parallel.hpp.

◆ parallel_machine_init()

ParallelMachine stk_classic::parallel_machine_init ( int *  argc,
char ***  argv 
)
inline

parallel_machine_init calls MPI_Init.

Parameters
argc
argv
Returns
ParallelMachine (MPI_COMM_WORLD)

Definition at line 54 of file Parallel.hpp.

◆ all_write_string()

void stk_classic::all_write_string ( ParallelMachine  arg_comm,
std::ostream &  arg_root_os,
const std::string &  arg_msg 
)

Write string from any or all processors to the ostream on the root processor.

Todo:
REFACTOR The per-processor separator needs to be addressed. Already created a duplicate for deferred error messages which could be replacement.

Definition at line 23 of file ParallelReduce.cpp.

◆ all_reduce()

template<class ReduceOp >
void stk_classic::all_reduce ( ParallelMachine  ,
const ReduceOp &   
)

Aggregated parallel in-place reduce-to-all-processors operations.

example:

   ParallelMachine comm = ... ;
   double a[5] ;
   int    b[3] ;
   all_reduce( comm , ReduceSum < 5 >( a ) & ReduceMax < 3 >( b ) );
 Reduction options include:
   ReduceSum    < N > ( T * )   // Summation
   ReduceProd   < N > ( T * )   // Product
   ReduceMax    < N > ( T * )   // Maximum
   ReduceMin    < N > ( T * )   // Minimum
   ReduceBitOr  < N > ( T * )   // Bit-wise OR
   ReduceBitAnd < N > ( T * )   // Bit-wise AND