diff --git a/architectures/tp_memory_interface.hpp b/architectures/tp_memory_interface.hpp index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5add8e0eb5d0f184bd03d704b85d192c9d1eadc8 100644 --- a/architectures/tp_memory_interface.hpp +++ b/architectures/tp_memory_interface.hpp @@ -0,0 +1,52 @@ +#ifndef TP_MEMORY_INTERFACE_H +#define TP_MEMORY_INTERFACE_H + +#include +#include + +typedef enum { DDR, HBM, SSD, HDD } mem_t; + +class iMemory { +public: + /************************/ + /* |-- Allocation */ + /************************/ + virtual void memAlloc ( int64_t buffSize, mem_t mem, int masterRank, char* fileName, MPI_Comm comm ); + virtual void memFree ( ); + + /************************/ + /* |-- I/O */ + /************************/ + //virtual int memWrite ( iMemory srcMem, int64_t srcSize, int64_t offset ); + //virtual int memRead ( iMemory srcMem, int64_t srcSize, int64_t offset ); + virtual int memWrite ( void* srcBuffer, int64_t srcSize, int64_t offset ); + virtual int memRead ( void* srcBuffer, int64_t srcSize, int64_t offset ); + virtual int memFlush ( ); + + /************************/ + /* |-- Utils */ + /************************/ + virtual char* memName ( ); + virtual mem_t memType ( char* name ); + + /************************/ + /* |-- Characteristics */ + /************************/ + virtual int64_t memBandwidth ( ); + virtual int64_t memLatency ( ); + virtual int64_t memCapacity ( ); + +protected: + mem_t mem_; + int masterRank_; + MPI_Comm comm_; + + void *buffer_; + int64_t buffSize_; + MPI_Win RMAWin_; + + MPI_File fileHandle_; + char fileName_[4096]; +}; + +#endif // TP_MEMORY_INTERFACE_H diff --git a/architectures/tp_network_interface.hpp b/architectures/tp_network_interface.hpp index a6139b01a980219a07b8c18555de5cdd0042b0d5..c3634db197d5578907e4ff49f7efdc4a09050252 100644 --- a/architectures/tp_network_interface.hpp +++ b/architectures/tp_network_interface.hpp @@ -1,5 +1,5 @@ -#ifndef TOPOLOGY_H -#define TOPOLOGY_H +#ifndef TP_NETWORK_INTERFACE_H +#define TP_NETWORK_INTERFACE_H #include #include @@ -41,4 +41,4 @@ class iTopology { //virtual int LinkToId ( int srcRank, int destRank ) = 0; }; -#endif // TOPOLOGY_H +#endif // TP_NETWORK_INTERFACE_H