47 [[nodiscard]]
bool isWired()
const {
return _targetMapping !=
nullptr; }
65 "markGlobal: expected Adj_Unknown or Adj_PointToGlobal state");
79 "markLocal: expected Adj_Unknown state");
82 "markLocal: target mapping must be wired before marking local");
99 "wireTargetMapping called while indices are local — "
100 "convert to global first, or the stored mapping will "
101 "be inconsistent with the index values");
104 "wireTargetMapping: mapping must be non-null");
127 DNDS_assert_info(globalMapping,
"makeFatherOnlyMapping: globalMapping must be non-null");
128 std::vector<index> emptyGhosts;
129 return std::make_shared<OffsetAscendIndexMapping>(
130 (*globalMapping)(mpi.rank, 0),
146 template <
class TAdj>
150 "toLocal: expected Adj_PointToGlobal state");
152 "toLocal: target mapping not wired");
161 if (_targetMapping->search_indexAppend(
v, rank, val))
170 template <
class TAdj>
174 "toGlobal: expected Adj_PointToLocal state");
176 "toGlobal: target mapping not wired");
186 v = _targetMapping->operator()(-1,
v);
192 template <
class TAdj>
196 "toLocalOMP: expected Adj_PointToGlobal state");
198 "toLocalOMP: target mapping not wired");
200# pragma omp parallel for
210 if (_targetMapping->search_indexAppend(
v, rank, val))
219 template <
class TAdj>
223 "toGlobalOMP: expected Adj_PointToLocal state");
225 "toGlobalOMP: target mapping not wired");
227# pragma omp parallel for
238 v = _targetMapping->operator()(-1,
v);
253 template <
class TAdj>
258 "bootstrapToLocal: expected Adj_Unknown or Adj_PointToGlobal state");
265 template <
class TAdj>
270 "bootstrapToLocalOMP: expected Adj_Unknown or Adj_PointToGlobal state");
287 template <
class TPair>
301 idx.bootstrapToLocal(
mapping, *
this, this->Size());
305 idx.bootstrapToLocalOMP(
mapping, *
this, this->Size());
332 template <DeviceBackend B>
337 template <DeviceBackend B>
345 template <DeviceBackend B>
#define DNDS_assert_info(expr, info)
Debug-only assertion with an extra std::string info message.
ssp< OffsetAscendIndexMapping > t_pLGhostMapping
Shared pointer to an OffsetAscendIndexMapping (per-rank ghost layout).
DNDS_CONSTANT const index UnInitIndex
Sentinel "not initialised" index value (= INT64_MIN).
int32_t rowsize
Row-width / per-row element-count type (signed 32-bit).
constexpr MPI_int UnInitMPIInt
Sentinel "not initialised" MPI_int value (= -1, invalid rank).
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).
std::shared_ptr< T > ssp
Shortened alias for std::shared_ptr used pervasively in DNDSR.
int MPI_int
MPI counterpart type for MPI_int (= C int). Used for counts and ranks in MPI calls.
Device-side state for an adjacency (trivially copyable).
Per-adjacency index state tracking.
void toGlobalOMP(TAdj &adj, index nRows)
OMP-parallelized variant of toGlobal.
void bootstrapToLocalOMP(const t_pLGhostMapping &mapping, TAdj &adj, index nRows)
OMP variant of bootstrapToLocal.
void toLocal(TAdj &adj, index nRows)
Bulk-convert all entries in [0, nRows) from global to local.
void markLocal()
Mark this adjacency as containing local indices.
void bootstrapToLocal(const t_pLGhostMapping &mapping, TAdj &adj, index nRows)
Wire target mapping and convert to local in one step.
static t_pLGhostMapping makeFatherOnlyMapping(const ssp< GlobalOffsetsMapping > &globalMapping, index fatherSize, const MPIInfo &mpi)
Create a ghost mapping with no ghost entries (father-only).
MeshAdjState state() const
void toGlobal(TAdj &adj, index nRows)
Bulk-convert all entries in [0, nRows) from local to global.
void toLocalOMP(TAdj &adj, index nRows)
OMP-parallelized variant of toLocal.
void wireTargetMapping(const t_pLGhostMapping &mapping)
Attach the target entity's ghost mapping.
const t_pLGhostMapping & mapping() const
Read-only access to the stored mapping (for assertions/comparisons).
void markGlobal()
Mark this adjacency as containing global indices.
Flattened wrapper: inherits from TPair and adds AdjIndexInfo.
AdjPairTrackedDeviceView< B, typename TPair::t_arr > t_deviceView
const t_pLGhostMapping & mapping() const
MeshAdjState state() const
void bootstrapToLocal(const t_pLGhostMapping &mapping)
Bootstrap: wire mapping + convert to local (solves chicken-and-egg).
void bootstrapToLocalOMP(const t_pLGhostMapping &mapping)
Lightweight bundle of an MPI communicator and the calling rank's coordinates.
Eigen::Matrix< real, 5, 1 > v