Commit 5ad68516 authored by Francois Tessier's avatar Francois Tessier

Redesign the memory abstraction interface

parent 0e899105
#ifndef TP_MEMORY_INTERFACE_H
#define TP_MEMORY_INTERFACE_H
#include <stdio.h>
#include <stdlib.h>
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
#ifndef TOPOLOGY_H #ifndef TP_NETWORK_INTERFACE_H
#define TOPOLOGY_H #define TP_NETWORK_INTERFACE_H
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -41,4 +41,4 @@ class iTopology { ...@@ -41,4 +41,4 @@ class iTopology {
//virtual int LinkToId ( int srcRank, int destRank ) = 0; //virtual int LinkToId ( int srcRank, int destRank ) = 0;
}; };
#endif // TOPOLOGY_H #endif // TP_NETWORK_INTERFACE_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment