#include <vector>
#include <iostream>
#include <bitset>
#include <diy/decomposition.hpp>
#include <diy/assigner.hpp>
void create(int gid, const Bounds& core, const Bounds& bounds, const Bounds& domain,
{
std::cout << " "
<< "Creating block (" << gid << "): "
<< core.min[0] << ' ' << core.min[1] << ' ' << core.min[2] << " - "
<< core.max[0] << ' ' << core.max[1] << ' ' << core.max[2] << " : "
<< bounds.min[0] << ' ' << bounds.min[1] << ' ' << bounds.min[2] << " - "
<< bounds.max[0] << ' ' << bounds.max[1] << ' ' << bounds.max[2] << " : "
<< std::dec
<< std::endl;
for (
int i = 0; i < l.
size(); ++i)
{
std::cout <<
" " << l.
target(i).gid
<< "; direction = "
<< l.
direction(i)[0] <<
' '
<< l.direction(i)[1] << ' '
<< l.direction(i)[2] << ' '
<< "; wrap = "
<< l.wrap(i)[1] << ' '
<< l.wrap(i)[2]
<< std::endl;
}
}
int main(int argc, char* argv[])
{
int size = 8;
int nblocks = 32;
Bounds domain;
domain.
min[0] = domain.min[1] = domain.min[2] = 0;
domain.max[0] = domain.max[1] = domain.max[2] = 255;
for (int rank = 0; rank < size; ++ rank)
{
std::cout << "Rank " << rank << ":" << std::endl;
diy::RegularDecomposer<Bounds>::BoolVector share_face;
share_face.push_back(true);
diy::RegularDecomposer<Bounds>::BoolVector wrap;
wrap.push_back(true);
wrap.push_back(true);
diy::RegularDecomposer<Bounds>::CoordinateVector ghosts;
ghosts.push_back(1); ghosts.push_back(2);
diy::decompose(3, rank, domain, assigner, create, share_face, wrap, ghosts);
}
}