LAMA
|
Class for MPI synchronization that waits on pending messages. More...
#include <MPISyncToken.hpp>
Public Member Functions | |
MPISyncToken (PartitionId nRequests) | |
Constructor for an MPI synchronization token. | |
virtual | ~MPISyncToken () |
Destructor, will also wait for synchronization and cleanup. | |
void | pushRequest (const MPI_Request &request) |
virtual void | wait () |
This method waits for all requests. | |
virtual bool | probe () const |
Method to check wheter communications have already been finished. | |
virtual void | writeAt (std::ostream &stream) const |
Write representation of this object into an output stream. | |
bool | isSynchronized () const |
Query whether token has already been synchronized. | |
void | pushAccess (std::auto_ptr< BaseAccess > access) |
Add a read/write access to the token so that LAMA arrays will be locked until synchronization. | |
void | pushArray (std::auto_ptr< _LAMAArray > array) |
Add a LAMA array that will be free after synchronization. | |
void | pushSyncToken (std::auto_ptr< SyncToken > syncToken) |
Add a Synctoken that will be synchronized after synchronization. | |
Protected Member Functions | |
void | setSynchronized () |
This method should be called by base classes after a successful wait. | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
logger for this class | |
Private Member Functions | |
MPISyncToken () | |
Private Attributes | |
PartitionId | mNRequests |
PartitionId | mUsedRequests |
boost::scoped_array< MPI_Request > | mRequests |
boost::scoped_array< MPI_Status > | mStatuses |
Class for MPI synchronization that waits on pending messages.
lama::MPISyncToken::MPISyncToken | ( | PartitionId | nRequests | ) |
Constructor for an MPI synchronization token.
nRequests | is the number of requests to be allocated |
Each pending send and receive will have its own request.
References mNRequests.
lama::MPISyncToken::~MPISyncToken | ( | ) | [virtual] |
Destructor, will also wait for synchronization and cleanup.
References lama::SyncToken::isSynchronized(), and wait().
lama::MPISyncToken::MPISyncToken | ( | ) | [private] |
bool lama::SyncToken::isSynchronized | ( | ) | const [inherited] |
Query whether token has already been synchronized.
References lama::SyncToken::mSynchronized.
Referenced by lama::PGASSyncToken::probe(), lama::CUDAStreamSyncToken::probe(), lama::NoSyncToken::wait(), lama::PGASSyncToken::wait(), lama::TaskSyncToken::wait(), wait(), lama::CUDAStreamSyncToken::wait(), lama::NoSyncToken::writeAt(), lama::PGASSyncToken::writeAt(), lama::TaskSyncToken::writeAt(), writeAt(), CUDATracerSyncToken::~CUDATracerSyncToken(), ~MPISyncToken(), lama::NoSyncToken::~NoSyncToken(), and lama::PGASSyncToken::~PGASSyncToken().
lama::SyncToken::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [protected, inherited] |
logger for this class
Reimplemented in lama::TaskSyncToken, and CUDATracerSyncToken.
bool lama::MPISyncToken::probe | ( | ) | const [virtual] |
Method to check wheter communications have already been finished.
Implements lama::SyncToken.
References LAMA_MPICALL, mRequests, mStatuses, and mUsedRequests.
void lama::SyncToken::pushAccess | ( | std::auto_ptr< BaseAccess > | access | ) | [inherited] |
Add a read/write access to the token so that LAMA arrays will be locked until synchronization.
References LAMA_ASSERT_ERROR, lama::SyncToken::mAccesses, and lama::SyncToken::mSynchronized.
Referenced by lama::ELLStorage< T >::matrixTimesVectorAsync(), lama::CSRStorage< T >::matrixTimesVectorAsync(), and lama::COOStorage< T >::matrixTimesVectorAsyncToDo().
void lama::SyncToken::pushArray | ( | std::auto_ptr< _LAMAArray > | array | ) | [inherited] |
Add a LAMA array that will be free after synchronization.
References LAMA_ASSERT_ERROR, lama::SyncToken::mArrays, and lama::SyncToken::mSynchronized.
void lama::MPISyncToken::pushRequest | ( | const MPI_Request & | request | ) |
References LAMA_ASSERT_ERROR, mNRequests, mRequests, and mUsedRequests.
Referenced by lama::MPICommunicator::exchangeByPlanAsyncImpl().
void lama::SyncToken::pushSyncToken | ( | std::auto_ptr< SyncToken > | syncToken | ) | [inherited] |
Add a Synctoken that will be synchronized after synchronization.
References LAMA_ASSERT_ERROR, lama::SyncToken::mChilds, and lama::SyncToken::mSynchronized.
Referenced by CUDATracerHelper< Tracer >::CUDATracerHelper().
void lama::SyncToken::setSynchronized | ( | ) | [protected, inherited] |
This method should be called by base classes after a successful wait.
References LAMA_THROWEXCEPTION, lama::SyncToken::mAccesses, lama::SyncToken::mArrays, lama::SyncToken::mChilds, and lama::SyncToken::mSynchronized.
Referenced by lama::NoSyncToken::wait(), CUDATracerSyncToken::wait(), lama::PGASSyncToken::wait(), lama::TaskSyncToken::wait(), wait(), lama::CUDAStreamSyncToken::wait(), and lama::NoSyncToken::~NoSyncToken().
void lama::MPISyncToken::wait | ( | ) | [virtual] |
This method waits for all requests.
Implements lama::SyncToken.
References lama::SyncToken::isSynchronized(), LAMA_MPICALL, mRequests, mStatuses, mUsedRequests, and lama::SyncToken::setSynchronized().
Referenced by ~MPISyncToken().
void lama::MPISyncToken::writeAt | ( | std::ostream & | stream | ) | const [virtual] |
Write representation of this object into an output stream.
Reimplemented from lama::SyncToken.
References lama::SyncToken::isSynchronized(), and mUsedRequests.
PartitionId lama::MPISyncToken::mNRequests [private] |
Referenced by MPISyncToken(), and pushRequest().
boost::scoped_array<MPI_Request> lama::MPISyncToken::mRequests [private] |
Referenced by probe(), pushRequest(), and wait().
boost::scoped_array<MPI_Status> lama::MPISyncToken::mStatuses [private] |
PartitionId lama::MPISyncToken::mUsedRequests [private] |
Referenced by probe(), pushRequest(), wait(), and writeAt().