26 #ifndef TILEDARRAY_PMAP_CYCLIC_PMAP_H__INCLUDED 27 #define TILEDARRAY_PMAP_CYCLIC_PMAP_H__INCLUDED 77 Pmap(world, rows * cols), rows_(rows), cols_(cols),
78 proc_cols_(proc_cols), proc_rows_(proc_rows)
90 if(
rank_ < (proc_rows_ * proc_cols_)) {
96 (rows_ / proc_rows_) + ((rows_ % proc_rows_) < rank_row ? 1ul : 0ul);
98 (cols_ / proc_cols_) + ((cols_ % proc_cols_) < rank_col ? 1ul : 0ul);
101 local_.reserve(local_rows * local_cols);
104 for(
size_type i = rank_row; i < rows_; i += proc_rows_) {
105 const size_type row_end = (i + 1) * cols_;
106 for(
size_type tile = i * cols_ + rank_col; tile < row_end; tile += proc_cols_) {
135 const size_type proc_row = tile_row % proc_rows_;
136 const size_type proc_col = tile_col % proc_cols_;
138 const size_type proc = proc_row * proc_cols_ + proc_col;
160 #endif // TILEDARRAY_PMAP_CYCLIC_PMAP_H__INCLUDED
size_type ncols() const
Access number of columns in the tile index matrix.
const size_type procs_
The number of processes.
CyclicPmap(World &world, size_type rows, size_type cols, size_type proc_rows, size_type proc_cols)
Construct process map.
size_type nrows() const
Access number of rows in the tile index matrix.
const size_type rank_
The rank of this process.
Maps cyclically a sequence of indices onto a 2-d matrix of processes.
Pmap::size_type size_type
Size type.
virtual bool is_local(const size_type tile) const
Check that the tile is owned by this process.
virtual size_type owner(const size_type tile) const
Maps tile to the processor that owns it.
const size_type size_
The number of tiles mapped among all processes.
size_type nrows_proc() const
Access number of rows in the process matrix.
size_type ncols_proc() const
Access number of columns in the process matrix.
std::size_t size_type
Size type.
std::vector< size_type > local_
A list of local tiles.