LAMA
lama::NoCommunicator Class Reference

The class NoCommunicator stands for objects that are replicated on each partition or processor. More...

#include <NoCommunicator.hpp>

Inheritance diagram for lama::NoCommunicator:

Public Types

enum  ThreadSafetyLevel { Funneled = 1, Serialized = 2, Multiple = 3 }
 Enumeration type for supported thread safety levels. More...

Public Member Functions

 NoCommunicator ()
virtual ~NoCommunicator ()
virtual bool isEqual (const Communicator &other) const
 Virtual method used for the equality operator.
virtual ThreadSafetyLevel getThreadSafetyLevel () const
virtual PartitionId getSize () const
 Number of partitions.
virtual PartitionId getRank () const
 Id of this partitinon.
virtual void all2all (int *recvValues, const int *sendValues) const
 All-to-all exchange of an integer value between all processors.
virtual void exchangeByPlan (int *const recvData, const CommunicationPlan &recvPlan, const int *const sendData, const CommunicationPlan &sendPlan) const
 Exchange data between all processors by communication plans.
virtual void exchangeByPlan (float *const recvData, const CommunicationPlan &recvPlan, const float *const sendData, const CommunicationPlan &sendPlan) const
 Exchange of float values.
virtual void exchangeByPlan (double *const recvData, const CommunicationPlan &recvPlan, const double *const sendData, const CommunicationPlan &sendPlan) const
 Exchange of double values.
virtual std::auto_ptr< SyncTokenexchangeByPlanAsync (int *const recvData, const CommunicationPlan &recvPlan, const int *const sendData, const CommunicationPlan &sendPlan) const
virtual std::auto_ptr< SyncTokenexchangeByPlanAsync (float *const recvData, const CommunicationPlan &recvPlan, const float *const sendData, const CommunicationPlan &sendPlan) const
 Exchange of float values.
virtual std::auto_ptr< SyncTokenexchangeByPlanAsync (double *const recvData, const CommunicationPlan &recvPlan, const double *const sendData, const CommunicationPlan &sendPlan) const
 Exchange of double values.
virtual IndexType shift (double targetVals[], const IndexType targetSize, const double sourceVals[], const IndexType oldSize, const int direction) const
 This routine shifts data between neighbored processors.
virtual IndexType shift (float targetVals[], const IndexType targetSize, const float sourceVals[], const IndexType oldSize, const int direction) const
virtual IndexType shift (int targetVals[], const IndexType targetSize, const int sourceVals[], const IndexType oldSize, const int direction) const
virtual void bcast (double val[], const IndexType n, const PartitionId root) const
 Broadcast a typed array from root to all other processors.
virtual void bcast (float val[], const IndexType n, const PartitionId root) const
virtual void bcast (int val[], const IndexType n, const PartitionId root) const
virtual void scatter (double myvals[], const IndexType n, const PartitionId root, const double allvals[]) const
 Scatter of an array of values from root to all other processors.
virtual void scatter (float myvals[], const IndexType n, const PartitionId root, const float allvals[]) const
virtual void scatter (int myvals[], const IndexType n, const PartitionId root, const int allvals[]) const
virtual void scatter (double myvals[], const IndexType n, const PartitionId root, const double allvals[], const IndexType sizes[]) const
 Scatter of an array of values from root to all other processors.
virtual void scatter (float myvals[], const IndexType n, const PartitionId root, const float allvals[], const IndexType sizes[]) const
virtual void scatter (int myvals[], const IndexType n, const PartitionId root, const int allvals[], const IndexType sizes[]) const
virtual void gather (double allvals[], const IndexType n, const PartitionId root, const double myvals[]) const
 Gather of an array of values from all processors to root.
virtual void gather (float allvals[], const IndexType n, const PartitionId root, const float myvals[]) const
virtual void gather (int allvals[], const IndexType n, const PartitionId root, const int myvals[]) const
virtual void gather (double allvals[], const IndexType n, const PartitionId root, const double myvals[], const IndexType sizes[]) const
 Gather of an array of values from all processors to root.
virtual void gather (float allvals[], const IndexType n, const PartitionId root, const float myvals[], const IndexType sizes[]) const
virtual void gather (int allvals[], const IndexType n, const PartitionId root, const int myvals[], const IndexType sizes[]) const
virtual float sum (const float value) const
 Sum operations sum up one single value from each partition to a global value.
virtual double sum (const double value) const
virtual int sum (const int value) const
virtual size_t sum (const size_t value) const
virtual float min (const float value) const
virtual float max (const float value) const
virtual double min (const double value) const
virtual double max (const double value) const
virtual int min (const int value) const
virtual int max (const int value) const
virtual void maxloc (double &val, int &location, const PartitionId root) const
 Maximal value combined with a location value where maximum was found.
virtual void maxloc (float &val, int &location, const PartitionId root) const
virtual void maxloc (int &val, int &location, const PartitionId root) const
virtual void swap (double val[], const IndexType n, const PartitionId partner) const
 Swap of an array with another processor.
virtual void swap (float val[], const IndexType n, const PartitionId partner) const
virtual void swap (int val[], const IndexType n, const PartitionId partner) const
virtual void gather (std::vector< float > &values, float value) const
 Gather single float value from each processor into a vector.
virtual void synchronize () const
 Barrier synchronization between all processors.
virtual void writeAt (std::ostream &stream) const
 Override virtual method of base class Printable.
void factorize2 (const double sizeX, const double sizeY, PartitionId procgrid[2]) const
void factorize3 (const double sizeX, const double sizeY, const double sizeZ, PartitionId procgrid[3]) const
void getGrid2Rank (PartitionId pos[2], const PartitionId procgrid[2]) const
void getGrid3Rank (PartitionId pos[3], const PartitionId procgrid[3]) const
bool operator== (const Communicator &other) const
 Equality operator for two communicators.
bool operator!= (const Communicator &other) const
PartitionId getNeighbor (int pos) const
 Help routine to get the rank of a neighbored position.
template<typename T >
void exchangeByPlan (LAMAArray< T > &recvArray, const CommunicationPlan &recvPlan, const LAMAArray< T > &sendArray, const CommunicationPlan &sendPlan) const
template<typename T >
std::auto_ptr< SyncTokenexchangeByPlanAsync (LAMAArray< T > &recvArray, const CommunicationPlan &recvPlan, const LAMAArray< T > &sendArray, const CommunicationPlan &sendPlan) const
template<typename T >
void updateHalo (LAMAArray< T > &haloValues, const LAMAArray< T > &localValues, const Halo &halo) const
 Update of halo array via Halo object.
template<typename T >
std::auto_ptr< SyncTokenupdateHaloAsync (LAMAArray< T > &haloValues, const LAMAArray< T > &localValues, const Halo &halo) const
 Asynchronous update of halo array via Halo object.
template<typename T >
void shift (LAMAArray< T > &recv, const LAMAArray< T > &send, const int direction) const
 Shift on LAMA arrays.
template<typename T >
std::auto_ptr< SyncTokenshiftAsync (LAMAArray< T > &recvArray, const LAMAArray< T > &sendArray, const int direction) const
 Asychronous shift on LAMA arrays.
virtual std::auto_ptr< SyncTokenshiftAsync (double newVals[], const double oldVals[], const IndexType size, const int direction) const
 Asynchronous version of shift.
virtual std::auto_ptr< SyncTokenshiftAsync (float newVals[], const float oldVals[], const IndexType size, const int direction) const
virtual std::auto_ptr< SyncTokenshiftAsync (int newVals[], const int oldVals[], const IndexType size, const int direction) const
void computeOwners (const std::vector< IndexType > &requiredIndexes, const Distribution &distribution, std::vector< PartitionId > &owners) const
 Ownership computation for indexes where only each partition individually can determine whether an index is local or not.
const std::string & getType () const
 getter for the type of a communicator.

Protected Member Functions

 LAMA_LOG_DECL_STATIC_LOGGER (logger)
template<typename T >
IndexType shift0 (T newVals[], const IndexType newSize, const T oldVals[], const IndexType oldSize) const
 Shift implementation for direction == 0, just copies values.
template<typename T >
std::auto_ptr< SyncTokendefaultShiftAsync (T newVals[], const T oldVals[], const IndexType size, const int direction) const
 Default asynchronous shift uses synchronous shift.

Static Protected Member Functions

static void getUserProcArray (PartitionId userProcArray[3])
 Read in the environment variable NP4LAMA for user processor array.

Protected Attributes

std::string mCommunicatorType

Private Member Functions

void exchangeByPlanImpl (void *const recvData, const CommunicationPlan &recvPlan, const void *const sendData, const CommunicationPlan &sendPlan, int elemSize) const
virtual ContextPtr getCommunicationContext () const
 getter for Context needed for Communication

Detailed Description

The class NoCommunicator stands for objects that are replicated on each partition or processor.


Member Enumeration Documentation

Enumeration type for supported thread safety levels.

Enumerator:
Funneled 

The Program can be multithreaded but only the master thread should communicate.

Serialized 

The Program can be multithreaded but the communicator usage is serialized.

Multiple 

The Program can be multithreaded and the communicator can be used by all threads concurrently.


Constructor & Destructor Documentation


Member Function Documentation

void lama::NoCommunicator::all2all ( int *  recvValues,
const int *  sendValues 
) const [virtual]

All-to-all exchange of an integer value between all processors.

Parameters:
[out]recvValueswill contain one value from each processor
[in]sendValuesmust contain one value for each processor

recvValues and sendValues must both have a size of communicator size. recvValues[i] on processor j contains sendValues[j] of processor i.

Implements lama::Communicator.

void lama::NoCommunicator::bcast ( double  val[],
const IndexType  n,
const PartitionId  root 
) const [virtual]

Broadcast a typed array from root to all other processors.

Parameters:
[in,out]valin on root, out on all other processors
[in]nnumber of elements in vector val
[in]rootprocessor with correct values of val

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::bcast ( float  val[],
const IndexType  n,
const PartitionId  root 
) const [virtual]
void lama::NoCommunicator::bcast ( int  val[],
const IndexType  n,
const PartitionId  root 
) const [virtual]
void lama::Communicator::computeOwners ( const std::vector< IndexType > &  requiredIndexes,
const Distribution distribution,
std::vector< PartitionId > &  owners 
) const [inherited]

Ownership computation for indexes where only each partition individually can determine whether an index is local or not.

This method should not be called for distributions where the owner can be computed by a closed formula.

References lama::WriteAccess< T >::get(), lama::Distribution::getCommunicator(), lama::Communicator::getRank(), lama::Communicator::getSize(), lama::Distribution::isLocal(), LAMA_ASSERT_ERROR, LAMA_THROWEXCEPTION, lama::Communicator::max(), lama::WriteAccess< T >::release(), lama::Communicator::shift(), and lama::LAMAArray< T >::swap().

Referenced by lama::HaloBuilder::build().

template<typename T >
template LAMA_DLL_IMPORTEXPORT auto_ptr< SyncToken > lama::Communicator::defaultShiftAsync ( newVals[],
const T  oldVals[],
const IndexType  size,
const int  direction 
) const [protected, inherited]
void lama::NoCommunicator::exchangeByPlan ( int *const  recvData,
const CommunicationPlan recvPlan,
const int *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Exchange data between all processors by communication plans.

Parameters:
[out]recvDatabuffer for data received from other processors
[in]recvPlannumber of elements and offsets for receiving
[in]sendDatabuffer for data to send to other processors
[in]sendPlancontains number of elements and offsets for sending data

All send and receive data between each pair of processors must be a contiguous part of the sendData or recvData.

The size of recvData must be recvPlan.totalQuantity(). The size of sendData must be sendPlan.totalQuantity().

Implements lama::Communicator.

References exchangeByPlanImpl().

void lama::NoCommunicator::exchangeByPlan ( float *const  recvData,
const CommunicationPlan recvPlan,
const float *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Exchange of float values.

Implements lama::Communicator.

References exchangeByPlanImpl().

void lama::NoCommunicator::exchangeByPlan ( double *const  recvData,
const CommunicationPlan recvPlan,
const double *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Exchange of double values.

Implements lama::Communicator.

References exchangeByPlanImpl().

std::auto_ptr< SyncToken > lama::NoCommunicator::exchangeByPlanAsync ( int *const  recvData,
const CommunicationPlan recvPlan,
const int *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Implements lama::Communicator.

References exchangeByPlanImpl().

std::auto_ptr< SyncToken > lama::NoCommunicator::exchangeByPlanAsync ( float *const  recvData,
const CommunicationPlan recvPlan,
const float *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Exchange of float values.

Implements lama::Communicator.

References exchangeByPlanImpl().

std::auto_ptr< SyncToken > lama::NoCommunicator::exchangeByPlanAsync ( double *const  recvData,
const CommunicationPlan recvPlan,
const double *const  sendData,
const CommunicationPlan sendPlan 
) const [virtual]

Exchange of double values.

Implements lama::Communicator.

References exchangeByPlanImpl().

template<typename T >
std::auto_ptr< SyncToken > lama::Communicator::exchangeByPlanAsync ( LAMAArray< T > &  recvArray,
const CommunicationPlan recvPlan,
const LAMAArray< T > &  sendArray,
const CommunicationPlan sendPlan 
) const [inherited]
void lama::NoCommunicator::exchangeByPlanImpl ( void *const  recvData,
const CommunicationPlan recvPlan,
const void *const  sendData,
const CommunicationPlan sendPlan,
int  elemSize 
) const [private]
void lama::Communicator::factorize2 ( const double  sizeX,
const double  sizeY,
PartitionId  procgrid[2] 
) const [inherited]
void lama::Communicator::factorize3 ( const double  sizeX,
const double  sizeY,
const double  sizeZ,
PartitionId  procgrid[3] 
) const [inherited]
void lama::NoCommunicator::gather ( double  allvals[],
const IndexType  n,
const PartitionId  root,
const double  myvals[] 
) const [virtual]

Gather of an array of values from all processors to root.

Parameters:
[out]allvalsvalues that I receive (size must be n * size() )
[in]nnumber of elements in vector val
[in]rootprocessor with values for all processors
[in]myvalsvalues for all processors

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::gather ( float  allvals[],
const IndexType  n,
const PartitionId  root,
const float  myvals[] 
) const [virtual]
void lama::NoCommunicator::gather ( int  allvals[],
const IndexType  n,
const PartitionId  root,
const int  myvals[] 
) const [virtual]
void lama::NoCommunicator::gather ( double  allvals[],
const IndexType  n,
const PartitionId  root,
const double  myvals[],
const IndexType  sizes[] 
) const [virtual]

Gather of an array of values from all processors to root.

Parameters:
[out]allvalsvalues that I receive (size must be sum(sizes) )
[in]nnumber of elements in vector val
[in]rootprocessor with values for all processors
[in]myvalsvalues for all processors
[in]sizesnumber of total values for all processors

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::gather ( float  allvals[],
const IndexType  n,
const PartitionId  root,
const float  myvals[],
const IndexType  sizes[] 
) const [virtual]
void lama::NoCommunicator::gather ( int  allvals[],
const IndexType  n,
const PartitionId  root,
const int  myvals[],
const IndexType  sizes[] 
) const [virtual]
void lama::NoCommunicator::gather ( std::vector< float > &  values,
float  value 
) const [virtual]

Gather single float value from each processor into a vector.

Implements lama::Communicator.

getter for Context needed for Communication

Returns:
the ContextPtr

Implements lama::Communicator.

References lama::ContextFactory::getContext(), and lama::Context::Host.

PartitionId lama::Communicator::getNeighbor ( int  pos) const [inline, inherited]

Help routine to get the rank of a neighbored position.

Parameters:
[in]posis the distance to the neighbor (also negative)
Returns:
rank of the neighbored processor

This method assumes a circular ring formed by all processors.

References lama::abs(), lama::Communicator::getRank(), lama::Communicator::getSize(), and LAMA_ASSERT.

Referenced by lama::DenseMatrix< T >::matrixTimesVectorImpl(), lama::PGASCommunicator::shift(), lama::MPICommunicator::shift(), lama::PGASCommunicator::shiftAsync(), and lama::MPICommunicator::shiftAsync().

Id of this partitinon.

Returns:
rank of this partition, 0 <= rank < getSize()

Implements lama::Communicator.

Number of partitions.

Implements lama::Communicator.

const std::string& lama::Communicator::getType ( ) const [inline, inherited]

getter for the type of a communicator.

void lama::Communicator::getUserProcArray ( PartitionId  userProcArray[3]) [static, protected, inherited]

Read in the environment variable NP4LAMA for user processor array.

Parameters:
[out]userProcArrayspecifies the user processor array.

Referenced by lama::Communicator::factorize2(), and lama::Communicator::factorize3().

bool lama::NoCommunicator::isEqual ( const Communicator other) const [virtual]

Virtual method used for the equality operator.

Implements lama::Communicator.

lama::Communicator::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [protected, inherited]
float lama::NoCommunicator::max ( const float  value) const [virtual]

Implements lama::Communicator.

double lama::NoCommunicator::max ( const double  value) const [virtual]

Implements lama::Communicator.

int lama::NoCommunicator::max ( const int  value) const [virtual]

Implements lama::Communicator.

void lama::NoCommunicator::maxloc ( double &  val,
int &  location,
const PartitionId  root 
) const [virtual]

Maximal value combined with a location value where maximum was found.

Parameters:
[in,out]valis a value on each processor, only out for root with maximal value
[in,out]locationis an additional int value, only out for root

Only root processor will contain the maximal value and the location loc.

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::maxloc ( float &  val,
int &  location,
const PartitionId  root 
) const [virtual]
void lama::NoCommunicator::maxloc ( int &  val,
int &  location,
const PartitionId  root 
) const [virtual]
float lama::NoCommunicator::min ( const float  value) const [virtual]

Implements lama::Communicator.

double lama::NoCommunicator::min ( const double  value) const [virtual]

Implements lama::Communicator.

int lama::NoCommunicator::min ( const int  value) const [virtual]

Implements lama::Communicator.

bool lama::Communicator::operator!= ( const Communicator other) const [inherited]
bool lama::Communicator::operator== ( const Communicator other) const [inherited]

Equality operator for two communicators.

Parameters:
[in]othercommunicator for comparison
Returns:
true if this communicator is equal to other communicator.

Note: Logic of this operator is implemented via the virtual functions isEqual.

References lama::Communicator::isEqual().

void lama::NoCommunicator::scatter ( double  myvals[],
const IndexType  n,
const PartitionId  root,
const double  allvals[] 
) const [virtual]

Scatter of an array of values from root to all other processors.

Parameters:
[out]myvalsvalues that I receive
[in]nnumber of elements in vector val
[in]rootprocessor with values for all processors
[in]allvalsvalues for all processors (size must be n * size() )

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::scatter ( float  myvals[],
const IndexType  n,
const PartitionId  root,
const float  allvals[] 
) const [virtual]
void lama::NoCommunicator::scatter ( int  myvals[],
const IndexType  n,
const PartitionId  root,
const int  allvals[] 
) const [virtual]
void lama::NoCommunicator::scatter ( double  myvals[],
const IndexType  n,
const PartitionId  root,
const double  allvals[],
const IndexType  sizes[] 
) const [virtual]

Scatter of an array of values from root to all other processors.

Parameters:
[out]myvalsvalues that I receive
[in]nnumber of elements in vector val
[in]rootprocessor with values for all processors
[in]allvalsvalues for all processors (size must be sum(sizes) )
[in]sizesnumber of total values for all processors

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::scatter ( float  myvals[],
const IndexType  n,
const PartitionId  root,
const float  allvals[],
const IndexType  sizes[] 
) const [virtual]
void lama::NoCommunicator::scatter ( int  myvals[],
const IndexType  n,
const PartitionId  root,
const int  allvals[],
const IndexType  sizes[] 
) const [virtual]
IndexType lama::NoCommunicator::shift ( double  newVals[],
const IndexType  newSize,
const double  oldVals[],
const IndexType  oldSize,
const int  direction 
) const [virtual]

This routine shifts data between neighbored processors.

Parameters:
[out]newValsarray with data this partition get from neighbored partition
[in]newSizeallocated size of array newVals
[in]oldValsarray with data this partition sends to neighbored partition
[in]oldSizenumber of elements of array oldVals that will be sent
[in]directionspecifies the neighbored partitions to send and receive
Returns:
number of values received in newVals (newSize must have been larger before)

Each partition sends to rank() + direction and receives from rank() - direction.

Implements lama::Communicator.

References lama::Communicator::shift0().

IndexType lama::NoCommunicator::shift ( float  targetVals[],
const IndexType  targetSize,
const float  sourceVals[],
const IndexType  oldSize,
const int  direction 
) const [virtual]
IndexType lama::NoCommunicator::shift ( int  targetVals[],
const IndexType  targetSize,
const int  sourceVals[],
const IndexType  oldSize,
const int  direction 
) const [virtual]
template<typename T >
void lama::Communicator::shift ( LAMAArray< T > &  recv,
const LAMAArray< T > &  send,
const int  direction 
) const [inherited]

Shift on LAMA arrays.

Parameters:
[in]recvarray to receive for this partition
[out]sendarray to send from this partition
[in]directionnumber of positions to shift, e.g. 1 or -1

Note: The recv array must have a capacity that is sufficent to receive all the data.

References lama::WriteAccess< T >::capacity(), lama::ReadAccess< T >::get(), lama::WriteAccess< T >::get(), lama::Communicator::getSize(), LAMA_ASSERT_ERROR, lama::WriteAccess< T >::resize(), and lama::ReadAccess< T >::size().

Referenced by lama::Communicator::computeOwners(), lama::Communicator::defaultShiftAsync(), lama::DenseMatrix< T >::matrixTimesVectorImpl(), lama::Distribution::replicate(), and lama::Distribution::replicateN().

template<typename T >
template LAMA_DLL_IMPORTEXPORT IndexType lama::Communicator::shift0 ( newVals[],
const IndexType  newSize,
const T  oldVals[],
const IndexType  oldSize 
) const [protected, inherited]

Shift implementation for direction == 0, just copies values.

References LAMA_ASSERT_ERROR.

Referenced by shift(), lama::PGASCommunicator::shift(), and lama::MPICommunicator::shift().

template<typename T >
auto_ptr< SyncToken > lama::Communicator::shiftAsync ( LAMAArray< T > &  recvArray,
const LAMAArray< T > &  sendArray,
const int  direction 
) const [inherited]

Asychronous shift on LAMA arrays.

Parameters:
[out]recvArrayarray to receive for this partition
[in]sendArrayarray to send from this partition
[in]directionnumber of positions to shift, e.g. 1 or -1

Note: All partitions must have the same size for send/recv array

References lama::LAMAArray< T >::clear(), LAMA_ASSERT_DEBUG, and LAMA_ASSERT_ERROR.

Referenced by lama::DenseMatrix< T >::matrixTimesVectorImpl().

std::auto_ptr< SyncToken > lama::Communicator::shiftAsync ( double  newVals[],
const double  oldVals[],
const IndexType  size,
const int  direction 
) const [virtual, inherited]

Asynchronous version of shift.

As there is no information about the received size this routine can only be called for arrays that have the same size on all partitions.

A default implementation is provided that returns a NoSyncToken. Derived classes should override this method if there is a benefit of using asynchronous transfers.

Reimplemented in lama::MPICommunicator, and lama::PGASCommunicator.

References lama::Communicator::defaultShiftAsync().

std::auto_ptr< SyncToken > lama::Communicator::shiftAsync ( float  newVals[],
const float  oldVals[],
const IndexType  size,
const int  direction 
) const [virtual, inherited]
std::auto_ptr< SyncToken > lama::Communicator::shiftAsync ( int  newVals[],
const int  oldVals[],
const IndexType  size,
const int  direction 
) const [virtual, inherited]
float lama::NoCommunicator::sum ( const float  value) const [virtual]

Sum operations sum up one single value from each partition to a global value.

Parameters:
[in]valuevalue on the calling partition
Returns:
global value, available for all partitions.

Implements lama::Communicator.

double lama::NoCommunicator::sum ( const double  value) const [virtual]

Implements lama::Communicator.

int lama::NoCommunicator::sum ( const int  value) const [virtual]

Implements lama::Communicator.

size_t lama::NoCommunicator::sum ( const size_t  value) const [virtual]

Implements lama::Communicator.

void lama::NoCommunicator::swap ( double  val[],
const IndexType  n,
const PartitionId  partner 
) const [virtual]

Swap of an array with another processor.

Parameters:
[in,out]valis the data array to be swapped
[in]nis the number of entries in array val
[in]partneris the rank of partition with which this partition swaps

This method can also be used if partner is same as this processor.

Implements lama::Communicator.

References LAMA_ASSERT_EQUAL_ERROR.

void lama::NoCommunicator::swap ( float  val[],
const IndexType  n,
const PartitionId  partner 
) const [virtual]
void lama::NoCommunicator::swap ( int  val[],
const IndexType  n,
const PartitionId  partner 
) const [virtual]
void lama::NoCommunicator::synchronize ( ) const [virtual]

Barrier synchronization between all processors.

Implements lama::Communicator.

template<typename T >
template LAMA_DLL_IMPORTEXPORT void lama::Communicator::updateHalo ( LAMAArray< T > &  haloValues,
const LAMAArray< T > &  localValues,
const Halo halo 
) const [inherited]

Update of halo array via Halo object.

Parameters:
[out]haloValueswill contain the non-local values from other processors
[in]localValuesis the local part of the array on each processor
[in]halois the Halo object containing all information about exchange

This method is not virtual but will use the pure virtual methods of base classes.

< temporary array for send communication

References lama::CommunicationPlan::allocated(), lama::Communicator::exchangeByPlan(), lama::Communicator::gather(), lama::Halo::getProvidesIndexes(), lama::Halo::getProvidesPlan(), lama::Halo::getRequiredPlan(), lama::Communicator::getSize(), LAMA_ASSERT_ERROR, LAMA_REGION, and lama::CommunicationPlan::size().

void lama::NoCommunicator::writeAt ( std::ostream &  stream) const [virtual]

Override virtual method of base class Printable.

Reimplemented from lama::Communicator.


Field Documentation

std::string lama::Communicator::mCommunicatorType [protected, inherited]

The documentation for this class was generated from the following files: