LAMA
|
00001 00033 #ifndef LAMA_OPENSHMEMINTERFACE_HPP_ 00034 #define LAMA_OPENSHMEMINTERFACE_HPP_ 00035 //#define OSH_VERBOSE_DEBUG 00036 00037 #include <lama/pgas/PGASInterface.hpp> 00038 #include <lama/pgas/PGASSyncToken.hpp> 00039 00040 namespace lama{ 00041 class OpenShMemInterface: public lama::PGASInterface 00042 { 00043 public: 00044 OpenShMemInterface(); 00045 virtual ~OpenShMemInterface(); 00046 virtual void* allocate(size_t size) const; 00047 virtual void free(void* ptr, const size_t size) const; 00048 virtual void syncronizeAll() const; 00049 virtual bool isPinned(const void* const ptr) const; 00050 virtual PGASSyncToken* getSyncToken(int arg1) const; 00051 virtual PartitionId getRank() const; 00052 virtual PartitionId getSize() const; 00053 00054 virtual PGASCommunicationKind getPreferredCommunicationKind() const; 00055 00056 virtual void get(void* dst, const void* src, size_t length, int srcpe) const; 00057 virtual void put(void* dst, const void* src, size_t length, int srcpe) const; 00058 00059 virtual void writeAt( std::ostream& stream ) const; 00060 PartitionId mRank; 00061 PartitionId mSize; 00062 private: 00063 void initSync() const; 00064 static long mAllocated; 00065 static long mBarrierNum; 00066 #ifdef OSH_VERBOSE_DEBUG 00067 static std::ostringstream mProtocol; 00068 #endif 00069 long* pSync; 00070 void* pWork; 00071 LAMA_LOG_DECL_STATIC_LOGGER( logger ); 00072 }; 00073 } 00074 00075 #endif // LAMA_OPENSHMEMINTERFACE_HPP_