65 std::array<bool, Dim>
periodic, MPI_Comm
comm = MPI_COMM_WORLD) {
67 MPI_Comm_rank(comm_, &rank_);
68 MPI_Comm_size(comm_, &size_);
71 globalGeo_ = globalGeo;
73 rootSpan_ = Index(1) << lmax_;
75 dec_.init(
static_cast<std::size_t
>(size_), globalRootSize_);
76 auto blk = dec_.block(
static_cast<std::size_t
>(rank_));
77 blockOriginRoot_ = blk.origin;
78 blockBrick_ = blk.size;
79 for (
int d = 0; d < Dim; ++d) {
80 blockFineOrigin_[d] = blockOriginRoot_[d] * rootSpan_;
81 blockFineSize_[d] = blockBrick_[d] * rootSpan_;
82 globalFineSize_[d] = globalRootSize_[d] * rootSpan_;
84 local_.init(blockBrick_, lmax_, blockOriginRoot_);
98 MPI_Comm_rank(comm_, &rank_);
99 MPI_Comm_size(comm_, &size_);
100 if (dec.numBlocks() !=
static_cast<std::size_t
>(size_))
101 throw std::invalid_argument(
102 "amr::DistributedOctree::initDecomposed: the decomposition needs one block per rank");
103 globalRootSize_ = dec.globalSize();
105 globalGeo_ = globalGeo;
107 rootSpan_ = Index(1) << lmax_;
109 auto blk = dec_.block(
static_cast<std::size_t
>(rank_));
110 blockOriginRoot_ = blk.origin;
111 blockBrick_ = blk.size;
112 for (
int d = 0; d < Dim; ++d) {
113 blockFineOrigin_[d] = blockOriginRoot_[d] * rootSpan_;
114 blockFineSize_[d] = blockBrick_[d] * rootSpan_;
115 globalFineSize_[d] = globalRootSize_[d] * rootSpan_;
117 local_.init(blockBrick_, lmax_, blockOriginRoot_);
123 int rank()
const {
return rank_; }
124 int size()
const {
return size_; }
125 MPI_Comm
comm()
const {
return comm_; }
126 unsigned lmax()
const {
return lmax_; }
132 const std::array<bool, Dim>&
periodic()
const {
return periodic_; }
141 const Vec<Dim>&
h0()
const {
return globalGeo_.h0; }
143 double h0Scalar()
const {
return globalGeo_.h0[0]; }
148 auto o = M::from_code(local_.code(i)).decode();
150 for (
int d = 0; d < Dim; ++d)
151 g[d] =
static_cast<Index
>(o[d]) / rootSpan_ + blockOriginRoot_[d];
158 std::array<Coord, Dim> lc{};
159 for (
int d = 0; d < Dim; ++d) {
160 long v = g[d] - blockOriginRoot_[d];
161 if (v < 0 || v >= blockBrick_[d])
163 lc[d] =
static_cast<Coord>(v * rootSpan_);
165 return local_.find(M::encode(lc).code());
176 for (
int d = 0; d < Dim; ++d)
177 if ((globalRootSize_[d] % 2) != 0 || (blockOriginRoot_[d] % 2) != 0 ||
178 (blockBrick_[d] % 2) != 0)
180 return local_.canLiftRoot();
204 for (
int d = 0; d < Dim; ++d)
206 dec_ = dec_.coarsened(ratio);
207 for (
int d = 0; d < Dim; ++d) {
208 globalRootSize_[d] /= 2;
209 blockOriginRoot_[d] /= 2;
220 for (
int d = 0; d < Dim; ++d)
222 globalGeo_.origin[d] +
static_cast<Real
>(blockFineOrigin_[d]) * globalGeo_.h0[d];
228 auto b = local_.bounds(i);
229 std::array<Coord, Dim> g{};
230 for (
int d = 0; d < Dim; ++d)
231 g[d] =
static_cast<Coord>(b[0][d] + blockFineOrigin_[d]);
232 return M::encode(g).code();
240 Index grandTotal = 0;
242 Index work = local_.balance2to1();
244 std::map<int, std::vector<char>> sendBufs;
245 std::vector<Code> toRefine;
246 auto consider = [&](
const std::array<Coord, Dim>& gc,
int Lf) {
247 Index leaf = locateGlobal(gc);
248 if (leaf >= 0 &&
static_cast<int>(local_.level(leaf)) >= Lf + 2)
249 toRefine.push_back(local_.code(leaf));
252 for (Index i = 0; i < local_.numLeaves(); ++i) {
253 const int Lf =
static_cast<int>(local_.level(i));
254 for (
int axis = 0; axis < Dim; ++axis)
255 for (
int dir = -1; dir <= 1; dir += 2) {
256 std::array<Coord, Dim> gc{};
259 if (neighborInfo(i, axis, dir, gc, owner, lnb) != Remote)
264 appendQuery(sendBufs[owner], gc, Lf);
268 halo::NbxEngine eng(comm_);
269 auto it = sendBufs.begin();
271 [&](std::vector<char>& out) ->
int {
272 if (it == sendBufs.end())
275 int dest = it->first;
279 [&](int, std::vector<char>& msg) {
280 parseQueries(msg, [&](
const std::array<Coord, Dim>& gc,
int Lf) { consider(gc, Lf); });
283 std::sort(toRefine.begin(), toRefine.end());
284 toRefine.erase(std::unique(toRefine.begin(), toRefine.end()), toRefine.end());
285 Index nref = local_.refineIf([&](
Code c,
unsigned) {
286 return std::binary_search(toRefine.begin(), toRefine.end(), c);
291 long lw =
static_cast<long>(work), gw = 0;
292 MPI_Allreduce(&lw, &gw, 1, MPI_LONG, MPI_SUM, comm_);
312 Index
rebalance(std::vector<std::vector<double>>& fields) {
313 const int K =
static_cast<int>(fields.size());
314 const Index n = local_.numLeaves();
319 std::size_t ncells = 1;
320 for (
int d = 0; d < Dim; ++d)
321 ncells *=
static_cast<std::size_t
>(globalRootSize_[d]);
322 std::vector<double> localWeight(ncells, 0.0), weight(ncells, 0.0);
323 for (Index i = 0; i < n; ++i)
324 localWeight[
static_cast<std::size_t
>(dec_.linearGlobal(
globalRootOf(i)))] += 1.0;
325 MPI_Allreduce(localWeight.data(), weight.data(),
static_cast<int>(ncells), MPI_DOUBLE, MPI_SUM,
335 decomp::chooseAlignedWeighted(
static_cast<std::size_t
>(size_), globalRootSize_, weight);
336 rebalanceAlign_ = choice.a;
337 rebalanceImbalance_ = choice.imbalance;
338 decomp::BlockDecomposer<Dim> newDec = std::move(choice.dec);
339 auto nblk = newDec.block(
static_cast<std::size_t
>(rank_));
340 const IVec<Dim> newOriginRoot = nblk.origin;
341 const IVec<Dim> newBrick = nblk.size;
342 IVec<Dim> newFineOrigin{};
343 for (
int d = 0; d < Dim; ++d)
344 newFineOrigin[d] = newOriginRoot[d] * rootSpan_;
348 std::vector<Code> codes;
349 std::vector<std::uint8_t> levels;
350 std::vector<std::vector<double>> cols(
static_cast<std::size_t
>(K));
351 std::map<int, std::vector<char>> sendBufs;
352 Index migratedOut = 0;
353 for (Index i = 0; i < n; ++i) {
355 const std::uint8_t lv =
static_cast<std::uint8_t
>(local_.level(i));
357 if (newOwner == rank_) {
359 levels.push_back(lv);
360 for (
int c = 0; c < K; ++c)
361 cols[
static_cast<std::size_t
>(c)].push_back(fields[c][
static_cast<std::size_t
>(i)]);
363 appendLeaf(sendBufs[newOwner], gc, lv, fields, i, K);
370 halo::NbxEngine eng(comm_);
371 auto it = sendBufs.begin();
373 [&](std::vector<char>& out) ->
int {
374 if (it == sendBufs.end())
377 int dest = it->first;
381 [&](int, std::vector<char>& msg) {
382 parseLeaves(msg, K, [&](
Code gc, std::uint8_t lv,
const double* comps) {
384 levels.push_back(lv);
385 for (
int c = 0; c < K; ++c)
386 cols[
static_cast<std::size_t
>(c)].push_back(comps[c]);
393 const std::size_t m = codes.size();
394 std::vector<Code> localCodes(m);
395 for (std::size_t j = 0; j < m; ++j) {
396 auto g = M::from_code(codes[j]).decode();
397 std::array<Coord, Dim> lc{};
398 for (
int d = 0; d < Dim; ++d)
399 lc[d] =
static_cast<Coord>(g[d] - newFineOrigin[d]);
400 localCodes[j] = M::encode(lc).code();
402 std::vector<std::size_t> ord(m);
403 for (std::size_t j = 0; j < m; ++j)
405 std::sort(ord.begin(), ord.end(),
406 [&](std::size_t a, std::size_t b) { return localCodes[a] < localCodes[b]; });
408 std::vector<Code> sortedCodes(m);
409 std::vector<std::uint8_t> sortedLevels(m);
410 std::vector<std::vector<double>> sortedCols(
static_cast<std::size_t
>(K),
411 std::vector<double>(m));
412 for (std::size_t j = 0; j < m; ++j) {
413 sortedCodes[j] = localCodes[ord[j]];
414 sortedLevels[j] = levels[ord[j]];
415 for (
int c = 0; c < K; ++c)
416 sortedCols[
static_cast<std::size_t
>(c)][j] = cols[
static_cast<std::size_t
>(c)][ord[j]];
420 local_.assign(newBrick, lmax_, newOriginRoot, std::move(sortedCodes), std::move(sortedLevels));
422 blockOriginRoot_ = newOriginRoot;
423 blockBrick_ = newBrick;
424 blockFineOrigin_ = newFineOrigin;
425 for (
int d = 0; d < Dim; ++d)
426 blockFineSize_[d] = newBrick[d] * rootSpan_;
428 for (
int c = 0; c < K; ++c)
429 fields[c].swap(sortedCols[
static_cast<std::size_t
>(c)]);
447 const Index n = local_.numLeaves();
448 const int F = 2 * Dim;
449 std::vector<double> out(
static_cast<std::size_t
>(n) * F, sentinel);
452 std::map<int, std::vector<char>> reqBufs;
453 for (Index i = 0; i < n; ++i)
454 for (
int axis = 0; axis < Dim; ++axis)
455 for (
int dir = -1; dir <= 1; dir += 2) {
456 const int slot = faceSlot(i, axis, dir, F);
457 std::array<Coord, Dim> gc{};
460 NbState st = neighborInfo(i, axis, dir, gc, owner, lnb);
463 out[
static_cast<std::size_t
>(slot)] = field[
static_cast<std::size_t
>(lnb)];
464 }
else if (st == Remote) {
465 if (owner == rank_) {
466 Index leaf = locateGlobal(gc);
468 out[
static_cast<std::size_t
>(slot)] = field[
static_cast<std::size_t
>(leaf)];
470 appendRequest(reqBufs[owner], gc,
static_cast<std::int64_t
>(slot));
476 std::map<int, std::vector<char>> replyBufs;
478 halo::NbxEngine eng(comm_);
479 auto it = reqBufs.begin();
481 [&](std::vector<char>& outb) ->
int {
482 if (it == reqBufs.end())
485 int dest = it->first;
489 [&](
int src, std::vector<char>& msg) {
490 parseRequests(msg, [&](
const std::array<Coord, Dim>& gc, std::int64_t reqId) {
491 Index leaf = locateGlobal(gc);
492 double v = (leaf >= 0) ? field[
static_cast<std::size_t
>(leaf)] : sentinel;
493 appendReply(replyBufs[src], reqId, v);
499 halo::NbxEngine eng(comm_);
500 auto it = replyBufs.begin();
502 [&](std::vector<char>& outb) ->
int {
503 if (it == replyBufs.end())
506 int dest = it->first;
510 [&](int, std::vector<char>& msg) {
511 parseReplies(msg, [&](std::int64_t reqId,
double v) {
512 out[
static_cast<std::size_t
>(reqId)] = v;
529 std::vector<std::array<Coord, Dim>>
536 const Index n = local_.numLeaves();
537 const int F = 2 * Dim;
540 for (Index i = 0; i < n; ++i)
541 for (
int axis = 0; axis < Dim; ++axis)
542 for (
int dir = -1; dir <= 1; dir += 2) {
543 const int slot = faceSlot(i, axis, dir, F);
544 std::array<Coord, Dim> gc{};
547 NbState st = neighborInfo(i, axis, dir, gc, owner, lnb);
550 p.directSlot.push_back(slot);
551 p.directLeaf.push_back(lnb);
553 }
else if (st == Remote) {
556 p.remoteCoords.push_back(gc);
557 p.remoteSlot.push_back(slot);
566 const std::vector<double>& field,
568 std::vector<double> out(
static_cast<std::size_t
>(plan.nFaces), sentinel);
569 for (std::size_t k = 0; k < plan.directSlot.size(); ++k)
570 out[
static_cast<std::size_t
>(plan.directSlot[k])] =
571 field[
static_cast<std::size_t
>(plan.directLeaf[k])];
572 std::vector<double> vals =
coverValues(plan.remoteCoords, field, sentinel);
573 for (std::size_t k = 0; k < plan.remoteSlot.size(); ++k)
574 out[
static_cast<std::size_t
>(plan.remoteSlot[k])] = vals[k];
603 GatherHaloTopology t;
604 t.nFaces = plan.nFaces;
605 t.localSlot = plan.directSlot;
606 t.localLeaf = plan.directLeaf;
609 std::map<int, std::vector<char>> req;
610 std::map<int, std::vector<Index>> recvSlotByOwner;
611 for (std::size_t k = 0; k < plan.remoteCoords.size(); ++k) {
612 const std::array<Coord, Dim>& gc = plan.remoteCoords[k];
613 const Index slot = plan.remoteSlot[k];
614 const int owner = ownerOfFine(gc);
615 if (owner == rank_) {
616 const Index leaf = locateGlobal(gc);
618 t.localSlot.push_back(slot);
619 t.localLeaf.push_back(leaf);
622 const std::int64_t reqId =
static_cast<std::int64_t
>(recvSlotByOwner[owner].size());
623 appendRequest(req[owner], gc, reqId);
624 recvSlotByOwner[owner].push_back(slot);
627 for (
auto& kv : recvSlotByOwner) {
628 t.recvRanks.push_back(kv.first);
629 t.recvCounts.push_back(
static_cast<int>(kv.second.size()));
630 for (Index s : kv.second)
631 t.recvSlot.push_back(s);
635 std::map<int, std::vector<Index>> sendLeafBySrc;
637 halo::NbxEngine eng(comm_);
638 auto it = req.begin();
640 [&](std::vector<char>& o) ->
int {
648 [&](
int src, std::vector<char>& msg) {
649 std::vector<Index>& leaves = sendLeafBySrc[src];
650 parseRequests(msg, [&](
const std::array<Coord, Dim>& gc, std::int64_t reqId) {
651 const Index leaf = locateGlobal(gc);
652 if (
static_cast<std::int64_t
>(leaves.size()) <= reqId)
653 leaves.resize(
static_cast<std::size_t
>(reqId) + 1, -1);
654 leaves[
static_cast<std::size_t
>(reqId)] = leaf;
659 for (
auto& kv : sendLeafBySrc) {
660 t.sendRanks.push_back(kv.first);
661 t.sendCounts.push_back(
static_cast<int>(kv.second.size()));
662 for (Index l : kv.second)
663 t.sendLeaf.push_back(l);
674 std::array<Coord, Dim>
gc{};
680 f.state =
static_cast<int>(neighborInfo(i, axis, dir, f.gc, f.owner, f.localNb));
686 std::vector<int>
coverLevels(
const std::vector<std::array<Coord, Dim>>& coords)
const {
687 std::vector<double> out(coords.size(), -1.0);
688 std::map<int, std::vector<char>> req;
689 for (std::size_t idx = 0; idx < coords.size(); ++idx) {
690 int owner = ownerOfFine(coords[idx]);
691 if (owner == rank_) {
692 Index leaf = locateGlobal(coords[idx]);
693 out[idx] = (leaf >= 0) ?
static_cast<double>(local_.level(leaf)) : -1.0;
695 appendRequest(req[owner], coords[idx],
static_cast<std::int64_t
>(idx));
700 [&](
const std::array<Coord, Dim>& gc) ->
double {
701 Index leaf = locateGlobal(gc);
702 return (leaf >= 0) ?
static_cast<double>(local_.level(leaf)) : -1.0;
705 std::vector<int> lv(coords.size());
706 for (std::size_t i = 0; i < out.size(); ++i)
707 lv[i] =
static_cast<int>(out[i]);
713 std::vector<double>
coverValues(
const std::vector<std::array<Coord, Dim>>& coords,
714 const std::vector<double>& field,
716 std::vector<double> out(coords.size(), sentinel);
717 std::map<int, std::vector<char>> req;
718 for (std::size_t idx = 0; idx < coords.size(); ++idx) {
719 int owner = ownerOfFine(coords[idx]);
720 if (owner == rank_) {
721 Index leaf = locateGlobal(coords[idx]);
723 out[idx] = field[
static_cast<std::size_t
>(leaf)];
725 appendRequest(req[owner], coords[idx],
static_cast<std::int64_t
>(idx));
730 [&](
const std::array<Coord, Dim>& gc) ->
double {
731 Index leaf = locateGlobal(gc);
732 return (leaf >= 0) ? field[
static_cast<std::size_t
>(leaf)] : sentinel;
739 enum NbState { InBlock, Remote, DomainNone };
741 int ownerOfFine(
const std::array<Coord, Dim>& gc)
const {
742 IVec<Dim> rootCell{};
743 for (
int d = 0; d < Dim; ++d)
744 rootCell[d] =
static_cast<Index
>(gc[d]) / rootSpan_;
745 return dec_.ownerOf(rootCell);
751 template <
class Responder>
752 void requestReply(std::map<
int, std::vector<char>>& req, Responder&& respond,
753 std::vector<double>& out,
int tagA,
int tagB)
const {
754 std::map<int, std::vector<char>> rep;
756 halo::NbxEngine eng(comm_);
757 auto it = req.begin();
759 [&](std::vector<char>& o) ->
int {
767 [&](
int src, std::vector<char>& msg) {
768 parseRequests(msg, [&](
const std::array<Coord, Dim>& gc, std::int64_t reqId) {
769 appendReply(rep[src], reqId, respond(gc));
775 halo::NbxEngine eng(comm_);
776 auto it = rep.begin();
778 [&](std::vector<char>& o) ->
int {
786 [&](int, std::vector<char>& msg) {
787 parseReplies(msg, [&](std::int64_t reqId,
double v) {
788 out[
static_cast<std::size_t
>(reqId)] = v;
795 static int faceSlot(Index i,
int axis,
int dir,
int F) {
796 return static_cast<int>(i) * F + 2 * axis + (dir > 0 ? 0 : 1);
802 NbState neighborInfo(Index i,
int axis,
int dir, std::array<Coord, Dim>& gc,
int& owner,
803 Index& localNb)
const {
804 auto b = local_.bounds(i);
805 const auto& lo = b[0];
807 const long pc = (dir > 0) ?
static_cast<long>(lo[axis]) +
static_cast<long>(
size)
808 : static_cast<long>(lo[axis]) - 1;
810 if (pc >= 0 && pc <
static_cast<long>(blockFineSize_[axis])) {
811 std::array<Coord, Dim> p = lo;
812 p[axis] =
static_cast<Coord>(pc);
813 localNb = local_.find(M::encode(p).code());
817 std::array<long, Dim> g{};
818 for (
int d = 0; d < Dim; ++d)
819 g[d] =
static_cast<long>(blockFineOrigin_[d]) +
static_cast<long>(lo[d]);
820 g[axis] =
static_cast<long>(blockFineOrigin_[axis]) + pc;
821 for (
int d = 0; d < Dim; ++d) {
822 const long gf =
static_cast<long>(globalFineSize_[d]);
823 if (g[d] < 0 || g[d] >= gf) {
826 g[d] = ((g[d] % gf) + gf) % gf;
829 IVec<Dim> rootCell{};
830 for (
int d = 0; d < Dim; ++d) {
831 gc[d] =
static_cast<Coord>(g[d]);
832 rootCell[d] =
static_cast<Index
>(g[d] /
static_cast<long>(rootSpan_));
834 owner = dec_.ownerOf(rootCell);
840 Index locateGlobal(
const std::array<Coord, Dim>& gc)
const {
841 std::array<Coord, Dim> lc{};
842 for (
int d = 0; d < Dim; ++d)
843 lc[d] =
static_cast<Coord>(gc[d] - blockFineOrigin_[d]);
844 return local_.find(M::encode(lc).code());
848 static void appendBytes(std::vector<char>& buf,
const void* p, std::size_t n) {
849 const char* c =
static_cast<const char*
>(p);
850 buf.insert(buf.end(), c, c + n);
852 static void appendQuery(std::vector<char>& buf,
const std::array<Coord, Dim>& gc,
int Lf) {
853 for (
int d = 0; d < Dim; ++d) {
854 std::int64_t v =
static_cast<std::int64_t
>(gc[d]);
855 appendBytes(buf, &v,
sizeof(v));
858 appendBytes(buf, &l,
sizeof(l));
861 static void parseQueries(
const std::vector<char>& buf, Fn&& fn) {
863 const std::size_t item = Dim *
sizeof(std::int64_t) +
sizeof(std::int32_t);
864 while (off + item <= buf.size()) {
865 std::array<Coord, Dim> gc{};
866 for (
int d = 0; d < Dim; ++d) {
868 std::memcpy(&v, buf.data() + off,
sizeof(v));
870 gc[d] =
static_cast<Coord>(v);
873 std::memcpy(&l, buf.data() + off,
sizeof(l));
875 fn(gc,
static_cast<int>(l));
878 static void appendRequest(std::vector<char>& buf,
const std::array<Coord, Dim>& gc,
879 std::int64_t reqId) {
880 for (
int d = 0; d < Dim; ++d) {
881 std::int64_t v =
static_cast<std::int64_t
>(gc[d]);
882 appendBytes(buf, &v,
sizeof(v));
884 appendBytes(buf, &reqId,
sizeof(reqId));
887 static void parseRequests(
const std::vector<char>& buf, Fn&& fn) {
889 const std::size_t item = (Dim + 1) *
sizeof(std::int64_t);
890 while (off + item <= buf.size()) {
891 std::array<Coord, Dim> gc{};
892 for (
int d = 0; d < Dim; ++d) {
894 std::memcpy(&v, buf.data() + off,
sizeof(v));
896 gc[d] =
static_cast<Coord>(v);
899 std::memcpy(&reqId, buf.data() + off,
sizeof(reqId));
900 off +=
sizeof(reqId);
906 static void appendLeaf(std::vector<char>& buf,
Code gc, std::uint8_t level,
907 const std::vector<std::vector<double>>& fields, Index i,
int K) {
908 std::int64_t c =
static_cast<std::int64_t
>(gc);
909 appendBytes(buf, &c,
sizeof(c));
910 std::int32_t l =
static_cast<std::int32_t
>(level);
911 appendBytes(buf, &l,
sizeof(l));
912 for (
int k = 0; k < K; ++k) {
913 double v = fields[
static_cast<std::size_t
>(k)][
static_cast<std::size_t
>(i)];
914 appendBytes(buf, &v,
sizeof(v));
918 static void parseLeaves(
const std::vector<char>& buf,
int K, Fn&& fn) {
920 const std::size_t item =
921 sizeof(std::int64_t) +
sizeof(std::int32_t) +
static_cast<std::size_t
>(K) *
sizeof(
double);
922 std::vector<double> comps(
static_cast<std::size_t
>(K));
923 while (off + item <= buf.size()) {
925 std::memcpy(&c, buf.data() + off,
sizeof(c));
928 std::memcpy(&l, buf.data() + off,
sizeof(l));
930 for (
int k = 0; k < K; ++k) {
931 std::memcpy(&comps[
static_cast<std::size_t
>(k)], buf.data() + off,
sizeof(
double));
932 off +=
sizeof(double);
934 fn(
static_cast<Code>(c),
static_cast<std::uint8_t
>(l), comps.data());
937 static void appendReply(std::vector<char>& buf, std::int64_t reqId,
double v) {
938 appendBytes(buf, &reqId,
sizeof(reqId));
939 appendBytes(buf, &v,
sizeof(v));
942 static void parseReplies(
const std::vector<char>& buf, Fn&& fn) {
944 const std::size_t item =
sizeof(std::int64_t) +
sizeof(
double);
945 while (off + item <= buf.size()) {
947 std::memcpy(&reqId, buf.data() + off,
sizeof(reqId));
948 off +=
sizeof(reqId);
950 std::memcpy(&v, buf.data() + off,
sizeof(v));
956 MPI_Comm comm_ = MPI_COMM_WORLD;
959 decomp::BlockDecomposer<Dim> dec_;
961 AmrGeometry<Dim> globalGeo_{};
962 IVec<Dim> globalRootSize_{};
963 IVec<Dim> blockOriginRoot_{};
964 IVec<Dim> blockBrick_{};
965 IVec<Dim> blockFineOrigin_{};
966 IVec<Dim> blockFineSize_{};
967 IVec<Dim> globalFineSize_{};
968 std::array<bool, Dim> periodic_{};
971 int rebalanceAlign_ = 0;
972 double rebalanceImbalance_ = 0.0;