COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Classes | Namespaces | Functions
operations.hpp File Reference
#include <mpi.h>
#include <boost/type_traits/is_arithmetic.hpp>
#include "common/PE/types.hpp"

Go to the source code of this file.

Classes

class  get_mpi_op< T, Op, selector >
 ACCESS AND REGISTRATION MECHANISM. More...
 
struct  get_mpi_op< T, max, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, min, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, plus, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, multiplies, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, logical_and, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, logical_or, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, logical_xor, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, bitwise_and, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, bitwise_or, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 
struct  get_mpi_op< T, bitwise_xor, typename boost::enable_if< boost::is_arithmetic< T > >::type >
 

Namespaces

 cf3
 Top-level namespace for coolfluid.
 
 cf3::common
 Most basic kernel library.
 
 cf3::common::PE
 Classes offering a MPI interface for COOLFluiD.
 
 cf3::common::PE::detail
 Default of get_mpi_datatype_impl which returns nullptr.
 

Macros

#define MPI_CUSTOM_OPERATION(name, commutative, expression)
 

Functions

template<typename T , typename Op >
Operation get_mpi_op_impl ()
 
 MPI_CUSTOM_OPERATION (max, true,*out=*in > *out?*in:*out)
 BUILT-IN OPERATIONS. More...
 
 MPI_CUSTOM_OPERATION (min, true,*out=*in< *out?*in:*out)
 
 MPI_CUSTOM_OPERATION (plus, true,*out=*in+*out)
 
 MPI_CUSTOM_OPERATION (multiplies, true,*out=*in **out)
 
 MPI_CUSTOM_OPERATION (logical_and, true,*out=*in &&*out)
 
 MPI_CUSTOM_OPERATION (logical_or, true,*out=*in||*out)
 
 MPI_CUSTOM_OPERATION (logical_xor, true,*out=!*in^!*out)
 
 MPI_CUSTOM_OPERATION (bitwise_and, true,*out=*in &*out)
 
 MPI_CUSTOM_OPERATION (bitwise_or, true,*out=*in|*out)
 
 MPI_CUSTOM_OPERATION (bitwise_xor, true,*out=*in^*out)
 
 MPI_CUSTOM_OPERATION (customplus, true,*out=*in+*out)
 EXAMPLE ON HOW TO IMPLEMENT A CUSTOM OPERATION. More...
 

Detailed Description

Author
Tamas Banyai This header serves the necessary routines to interface C/C++ operationss to MPI types. Use the op member fuction of get_mpi_op class to acces Operation; An example is provided in this header how to implement a class for custom operations, registration vi Operation_create is automatized. If a custom operaton is incompatible with a type, itshould come out compile time.

Definition in file operations.hpp.

Macro Definition Documentation

#define MPI_CUSTOM_OPERATION (   name,
  commutative,
  expression 
)
Value:
class name \
{ \
public: \
static const bool is_commutative=commutative; \
template<typename T> static void func(void* in_, void* out_, int* len, Datatype* type) \
{ \
T *in=(T*)in_; \
T *out=(T*)out_; \
for (int i=0; i<*len; i++) \
{ \
expression; \
in++; \
out++; \
} \
} \
}
std::string name(ComponentWrapper &self)
MPI_Datatype Datatype
datatype
Definition: types.hpp:47

Macro for defining custom operations. It hides defining a class. An example for expression defining the plus operation: out = *out + *in, note that in and out are of type T.

Parameters
nameis the name of the class
commutativeboolean variable describing if operation is commutative across processors or not (if not sure, use false).
expressiondefining the atomic operation, names in and out are hardcoded.

Definition at line 75 of file operations.hpp.

Send comments to:
COOLFluiD Web Admin