Sierra Toolkit Version of the Day
sierra::MPI::Reduce< Op, LocalIt, GlobalIt > Struct Template Reference

Template class Reduce implements the ReduceInterface interface for any operator and type. The operator is a functor and the iterator specifies the access to the data and its type. More...

#include <MPI.hpp>

Inheritance diagram for sierra::MPI::Reduce< Op, LocalIt, GlobalIt >:
Collaboration diagram for sierra::MPI::Reduce< Op, LocalIt, GlobalIt >:

List of all members.

Public Types

typedef std::iterator_traits
< LocalIt >::value_type 
value_type
typedef std::iterator_traits
< LocalIt >::difference_type 
difference_type

Public Member Functions

 Reduce (LocalIt local_begin, LocalIt local_end, GlobalIt global_begin, GlobalIt global_end)
virtual void size (void *&inbuf) const
 Member function size returns the size in bytes needed to store the data for the reduction operation of this interface. The inbuf parameter should be advanced to provide enough aligned space for the data of the reduction.
virtual void copyin (void *&inbuf) const
 Member function copyin copies the data from the reduction interface to the inbuf pointer reference. The pointer should be advanced to point just beyond the space of the data. Be sure to align the pointer before storing the first element of data.
virtual void copyout (void *&outbuf) const
 Member function copyin copies the data from outbuf pointer reference to the reduction interface data. The pointer should be advanced to point just beyond the space of the data. Be sure to align the pointer before retrieving the first element of data.
virtual void op (void *&inbuf, void *&outbuf) const
 Member function op executes the operation on the data at inbuf pointer reference and outbuf pointer reference and placing the result in outbuf pointer reference. The pointers should be advanced to point just beyond the space of the correspondingdata. Be sure to align the pointer before retrieving the first element of data.

Public Attributes

LocalIt m_localBegin
LocalIt m_localEnd
GlobalIt m_globalBegin
GlobalIt m_globalEnd
difference_type m_length

Detailed Description

template<class Op, class LocalIt, class GlobalIt = LocalIt>
struct sierra::MPI::Reduce< Op, LocalIt, GlobalIt >

Template class Reduce implements the ReduceInterface interface for any operator and type. The operator is a functor and the iterator specifies the access to the data and its type.

The operator Op is a functor that accepts two pointers, one to the destination object of the iterator's value type and one to the source object of the iterator's value type. The It is an iterator for accessing the data. Remember that a pointer is an iterator, so using plain arrays, even of length one as in a pointer to a scalar meets the criteria.

Definition at line 564 of file MPI.hpp.


Member Function Documentation

template<class Op, class LocalIt, class GlobalIt = LocalIt>
virtual void sierra::MPI::Reduce< Op, LocalIt, GlobalIt >::size ( void *&  inbuf) const [inline, virtual]

Member function size returns the size in bytes needed to store the data for the reduction operation of this interface. The inbuf parameter should be advanced to provide enough aligned space for the data of the reduction.

Parameters:
inbufa void reference to a pointer to the be advanced by the size needed to store the data for the reduction.

Implements sierra::MPI::ReduceInterface.

Definition at line 583 of file MPI.hpp.

template<class Op, class LocalIt, class GlobalIt = LocalIt>
virtual void sierra::MPI::Reduce< Op, LocalIt, GlobalIt >::copyin ( void *&  inbuf) const [inline, virtual]

Member function copyin copies the data from the reduction interface to the inbuf pointer reference. The pointer should be advanced to point just beyond the space of the data. Be sure to align the pointer before storing the first element of data.

Parameters:
inbufa void reference to a pointer to start placing data after alignment and should be advance to just beyond the last element of stored data.

Implements sierra::MPI::ReduceInterface.

Definition at line 589 of file MPI.hpp.

template<class Op, class LocalIt, class GlobalIt = LocalIt>
virtual void sierra::MPI::Reduce< Op, LocalIt, GlobalIt >::copyout ( void *&  outbuf) const [inline, virtual]

Member function copyin copies the data from outbuf pointer reference to the reduction interface data. The pointer should be advanced to point just beyond the space of the data. Be sure to align the pointer before retrieving the first element of data.

Parameters:
outbufa void reference to a pointer to start retrieving data after alignment and should be advance to just beyond the last element of retrieved data.

Implements sierra::MPI::ReduceInterface.

Definition at line 596 of file MPI.hpp.

template<class Op, class LocalIt, class GlobalIt = LocalIt>
virtual void sierra::MPI::Reduce< Op, LocalIt, GlobalIt >::op ( void *&  inbuf,
void *&  outbuf 
) const [inline, virtual]

Member function op executes the operation on the data at inbuf pointer reference and outbuf pointer reference and placing the result in outbuf pointer reference. The pointers should be advanced to point just beyond the space of the correspondingdata. Be sure to align the pointer before retrieving the first element of data.

Parameters:
inbufa void reference to a pointer to start retrieving data after alignment and should be advance to just beyond the last element of stored data.
outbufa void reference to a pointer to start retrieving and storing data after alignment and should be advance to just beyond the last element of retrieved data.

Implements sierra::MPI::ReduceInterface.

Definition at line 603 of file MPI.hpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines