38 #ifndef GRID_LEVEL_CACHEDIST_H
39 #define GRID_LEVEL_CACHEDIST_H
64 template<
class MPITrans,
class NumaTrans,
class Type,
class Allocator>
84 :
Cache<Type, Allocator>(comm, numa, type),
101 unsigned int cacheSize,
103 grid::ValuePosition valuePos)
107 blockSize, timeDimension,
108 cacheSize, cacheHandSpread,
135 void getAt(T* buf,
const double* pos)
140 size_t index[MAX_DIMENSIONS];
146 unsigned long cacheOffset;
148 long oldGlobalBlockId = this->
cacheManager().
get(globalBlockId, cacheOffset, data);
152 if (static_cast<long>(globalBlockId) != oldGlobalBlockId) {
175 bool received =
false;
181 long entry =
m_mpiTrans.startTransfer(globalBlockId,
187 if (
m_mpiTrans.transfer(entry, globalBlockId, data, retry)) {
210 this->
type().convert(&data[this->
typeSize() * offset], buf);
void loadBlock(const size_t *index, unsigned char *data)
unsigned long blockByCoords(const size_t *index) const
void incCounter(perf::Counter::CounterType type)
asagi::Grid::Error open(const char *filename, const char *varname, const int *blockSize, int timeDimension, unsigned int cacheSize, int cacheHandSpread, grid::ValuePosition valuePos)
unsigned int typeSize() const
unsigned int numaDomainId() const
const size_t * blockSize() const
unsigned long totalBlockSize() const
cache::CacheManager & cacheManager()
unsigned long calcOffsetInBlock(const size_t *index)
void pos2index(const double *pos, size_t *index)
unsigned long blockNodeOffset(unsigned long id) const
const Type & type() const
CacheDist(mpi::MPIComm &comm, const numa::Numa &numa, Type &type)
void getAt(T *buf, const double *pos)
int blockRank(unsigned long id) const
asagi::Grid::Error open(const char *filename, const char *varname, const int *blockSize, int timeDimension, unsigned int cacheSize, int cacheHandSpread, grid::ValuePosition valuePos)
long get(unsigned long blockId, unsigned long &cacheOffset, unsigned char *&data)
void unlock(unsigned long cacheOffset)
unsigned long localBlockCount() const