38 #ifndef GRID_LEVEL_BLOCKED_H
39 #define GRID_LEVEL_BLOCKED_H
76 :
Level<Type>(comm, numa, type),
94 grid::ValuePosition valuePos)
101 if (timeDimension >= static_cast<int>(this->
dimensions())) {
102 logWarning(this->
comm().rank()) <<
"Time dimension is not valid.";
107 if ((timeDimension >= 0) && (blockSize[timeDimension] == 0)) {
108 logDebug(this->
comm().rank()) <<
"Setting block size in time dimension to 1";
116 for (
unsigned int i = 0; i < this->
dimensions(); i++) {
117 if (blockSize[this->
dimensions() - i - 1] == 0)
120 else if (blockSize[this->
dimensions() - i - 1] < 0)
129 logDebug(this->
comm().rank()) <<
"Shrinking block size in dimension"
204 for (
int i = this->
dimensions()-1; i >= 0; i--) {
215 unsigned long blockId = 0;
217 for (
unsigned int i = 0; i < this->
dimensions(); i++) {
235 #endif // ROUND_ROBIN
248 #endif // ROUND_ROBIN
261 #endif // ROUND_ROBIN
289 #endif // ROUND_ROBIN
300 unsigned long offset = 0;
301 for (
unsigned int i = 0; i < this->
dimensions(); i++) {
316 #endif // GRID_LEVEL_BLOCKED_H
unsigned long size(unsigned int n) const
unsigned long blockByCoords(const size_t *index) const
Base class for all grid levels that work on blocks.
unsigned long m_totalBlocks
void calcBlockPosition(unsigned long block, size_t *pos) const
unsigned long local2global(unsigned long id) const
unsigned int dimensions() const
Base class for a grid level.
unsigned int numaDomainId() const
const size_t * blockSize() const
unsigned long nodeBlockCount() const
unsigned long totalBlockSize() const
unsigned long m_blocks[MAX_DIMENSIONS]
unsigned long calcOffsetInBlock(const size_t *index)
size_t m_blockSize[MAX_DIMENSIONS]
unsigned long blockNodeOffset(unsigned long id) const
unsigned int blockDomain(unsigned long id) const
unsigned long totalBlockCount() const
const Type & type() const
unsigned int totalDomains() const
size_t blockSize(unsigned int i) const
asagi::Grid::Error open(const char *filename, const char *varname, grid::ValuePosition valuePos)
int blockRank(unsigned long id) const
Blocked(mpi::MPIComm &comm, const numa::Numa &numa, Type &type)
asagi::Grid::Error open(const char *filename, const char *varname, const int *blockSize, int timeDimension, grid::ValuePosition valuePos)
unsigned long blockOffset(unsigned long id) const
unsigned long localBlockCount() const