LAMA
/home/brandes/workspace/LAMA/src/lama/mpi/MPISyncToken.hpp
Go to the documentation of this file.
00001 
00033 #ifndef LAMA_MPI_SYNC_TOKEN_HPP_
00034 #define LAMA_MPI_SYNC_TOKEN_HPP_
00035 
00036 #include <mpi.h>
00037 
00038 // for dll_import
00039 #include <lama/config.hpp>
00040 
00041 // base classes
00042 #include <lama/SyncToken.hpp>
00043 
00044 // others
00045 #include <lama/LAMATypes.hpp>
00046 
00047 // boost
00048 #include <boost/scoped_array.hpp>
00049 
00050 namespace lama
00051 {
00052 
00055 class LAMA_DLL_IMPORTEXPORT MPISyncToken : public SyncToken
00056 {
00057 public:
00058 
00066     MPISyncToken( PartitionId nRequests );
00067 
00070     virtual ~MPISyncToken();
00071 
00072     void pushRequest( const MPI_Request& request );
00073 
00076     virtual void wait();
00077 
00080     virtual bool probe() const;
00081 
00084     virtual void writeAt( std::ostream& stream ) const;
00085 
00086 private:
00087 
00088     MPISyncToken();
00089 
00090     PartitionId                      mNRequests;    // allocated size
00091     PartitionId                      mUsedRequests; // used size
00092 
00093     boost::scoped_array<MPI_Request> mRequests;
00094     boost::scoped_array<MPI_Status>  mStatuses;
00095 };
00096 
00097 }
00098 
00099 #endif // LAMA_MPI_SYNC_TOKEN_HPP_