Migrate complete marker records between toroidal spatial subdomains. More...
#include "parmove.hpp"
Public Member Functions | |
| void | diag (int iter, int isp) |
| Record statistics from the most recently built migration plan. | |
| void | exec_i8 (Kokkos::View< Int8 * > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to flattened 64-bit integer storage. | |
| void | exec_i8 (Kokkos::View< Int8 **, Kokkos::LayoutStride > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to 2-D signed 64-bit marker attributes. | |
| void | exec_logical (Kokkos::View< bool * > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to flattened attribute-major logical storage. | |
| void | exec_logical (Kokkos::View< bool **, Kokkos::LayoutStride > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to 2-D logical marker attributes. | |
| void | exec_r4 (Kokkos::View< Real32 * > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to flattened single-precision storage. | |
| void | exec_r4 (Kokkos::View< Real32 **, Kokkos::LayoutStride > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to 2-D single-precision attributes. | |
| void | exec_real (Kokkos::View< Real * > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active plan to flattened attribute-major real storage. | |
| void | exec_real (Kokkos::View< Real **, Kokkos::LayoutStride > arr, int natts, int npmax, int np, bool run_on_device) |
| Apply the active migration plan to a 2-D real attribute array. | |
| void | exec_real_batch (const std::vector< Kokkos::View< Real **, Kokkos::LayoutStride > > &arrs, const std::vector< int > &natts_per_arr, int npmax, int np, bool run_on_device) |
| Apply the active migration plan to several 2-D real attribute arrays in one combined MPI exchange, instead of one exchange per array. | |
| int | get_ndest (int substep, int ispecies) const |
| Read a stored non-empty-destination count. | |
| int | get_np_leaving (int substep, int ispecies) const |
| Read a stored outgoing-marker count. | |
| void | init (Kokkos::View< Real *, Kokkos::LayoutStride > pos, int np, int &np_new, int npmax, bool run_on_device) |
| Build the migration plan from marker ownership coordinates. | |
| void | init_module (Real ld_, int nsd_, int me_sd_, MPI_Comm comm_sd_, int natts_max_, int nspecies, int nsubstep, int p_nthreads_, int natts_max_l_=-1, int natts_max_i8_=-1, int natts_max_r4_=-1) |
| Configure topology, capacities, and diagnostic storage. | |
Public Attributes | |
| Kokkos::View< int ** > | ndest |
Non-empty destination count [substep][species]. | |
| Kokkos::View< int ** > | np_leaving |
Outgoing marker count [substep][species]. | |
Migrate complete marker records between toroidal spatial subdomains.
Particle ownership is determined from a periodic position coordinate. A call to init() first computes one migration plan—send/receive counts, holes, and local backfill moves. Every attribute array belonging to those markers must then be passed through the matching exec_* overload using the same old particle count. This preserves alignment between positions, weights, identifiers, flags, and diagnostic attributes while compacting local storage.
Communication is collective over the supplied spatial-domain communicator. Data are currently staged through host mirrors even when Kokkos Views reside in accelerator memory.
| void orb5x::ParMove::diag | ( | int | iter, |
| int | isp | ||
| ) |
Record statistics from the most recently built migration plan.
| [in] | iter | Zero-based substep row. |
| [in] | isp | Zero-based species column. |
| void orb5x::ParMove::exec_i8 | ( | Kokkos::View< Int8 * > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to flattened 64-bit integer storage.
| [in,out] | arr | Attribute-major storage. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Marker stride and capacity. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_i8 | ( | Kokkos::View< Int8 **, Kokkos::LayoutStride > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to 2-D signed 64-bit marker attributes.
| [in,out] | arr | Marker-major integer attributes. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Compatibility capacity argument; ignored for 2-D storage. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_logical | ( | Kokkos::View< bool * > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to flattened attribute-major logical storage.
| [in,out] | arr | Storage addressed as attribute*npmax + marker. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Marker stride and capacity. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_logical | ( | Kokkos::View< bool **, Kokkos::LayoutStride > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to 2-D logical marker attributes.
| [in,out] | arr | Marker-major logical attributes. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Compatibility capacity argument; ignored for 2-D storage. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_r4 | ( | Kokkos::View< Real32 * > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to flattened single-precision storage.
| [in,out] | arr | Attribute-major storage. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Marker stride and capacity. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_r4 | ( | Kokkos::View< Real32 **, Kokkos::LayoutStride > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to 2-D single-precision attributes.
| [in,out] | arr | Marker-major single-precision attributes. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Compatibility capacity argument; ignored for 2-D storage. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_real | ( | Kokkos::View< Real * > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active plan to flattened attribute-major real storage.
| [in,out] | arr | Storage addressed as attribute*npmax + marker. |
| [in] | natts | Number of attributes to migrate. |
| [in] | npmax | Marker stride and storage capacity. |
| [in] | np | Marker count used in init(). |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_real | ( | Kokkos::View< Real **, Kokkos::LayoutStride > | arr, |
| int | natts, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active migration plan to a 2-D real attribute array.
| [in,out] | arr | Marker-major array [capacity][attribute]. |
| [in] | natts | Number of leading attributes to migrate. |
| [in] | npmax | Compatibility capacity argument; ignored for 2-D storage. |
| [in] | np | Marker count used in the preceding init() call. |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| void orb5x::ParMove::exec_real_batch | ( | const std::vector< Kokkos::View< Real **, Kokkos::LayoutStride > > & | arrs, |
| const std::vector< int > & | natts_per_arr, | ||
| int | npmax, | ||
| int | np, | ||
| bool | run_on_device | ||
| ) |
Apply the active migration plan to several 2-D real attribute arrays in one combined MPI exchange, instead of one exchange per array.
| [in,out] | arrs | Marker-major arrays [capacity][attribute], same migration plan (same particle set) applies to all. |
| [in] | natts_per_arr | Number of leading attributes to migrate from each corresponding array in arrs. |
| [in] | npmax | Compatibility capacity argument; ignored for 2-D storage. |
| [in] | np | Marker count used in the preceding init() call. |
| [in] | run_on_device | Compatibility flag; currently ignored. |
| std::runtime_error | if the combined attribute count exceeds the capacity init_module was configured with. |
| int orb5x::ParMove::get_ndest | ( | int | substep, |
| int | ispecies | ||
| ) | const |
Read a stored non-empty-destination count.
| [in] | substep | Zero-based diagnostic row. |
| [in] | ispecies | Zero-based species column. |
| int orb5x::ParMove::get_np_leaving | ( | int | substep, |
| int | ispecies | ||
| ) | const |
Read a stored outgoing-marker count.
| [in] | substep | Zero-based diagnostic row. |
| [in] | ispecies | Zero-based species column. |
| void orb5x::ParMove::init | ( | Kokkos::View< Real *, Kokkos::LayoutStride > | pos, |
| int | np, | ||
| int & | np_new, | ||
| int | npmax, | ||
| bool | run_on_device | ||
| ) |
Build the migration plan from marker ownership coordinates.
| [in] | pos | Ownership coordinate for the first np local markers. |
| [in] | np | Current number of local markers. |
| [out] | np_new | Local count after outgoing and incoming migrations. |
| [in] | npmax | Storage capacity of each marker attribute array. |
| [in] | run_on_device | Compatibility flag; currently does not alter the Kokkos/host-staging implementation. |
| std::runtime_error | If the resulting local count exceeds npmax or the computed hole/backfill lists are inconsistent. |
| void orb5x::ParMove::init_module | ( | Real | ld_, |
| int | nsd_, | ||
| int | me_sd_, | ||
| MPI_Comm | comm_sd_, | ||
| int | natts_max_, | ||
| int | nspecies, | ||
| int | nsubstep, | ||
| int | p_nthreads_, | ||
| int | natts_max_l_ = -1, |
||
| int | natts_max_i8_ = -1, |
||
| int | natts_max_r4_ = -1 |
||
| ) |
Configure topology, capacities, and diagnostic storage.
| [in] | ld_ | Periodic length of the ownership coordinate. |
| [in] | nsd_ | Number of toroidal spatial subdomains. |
| [in] | me_sd_ | This rank's zero-based index in comm_sd_. |
| [in] | comm_sd_ | Communicator containing the spatial subdomains. |
| [in] | natts_max_ | Maximum double-precision attributes per marker. |
| [in] | nspecies | Number of species columns in migration diagnostics. |
| [in] | nsubstep | Number of substep rows in migration diagnostics. |
| [in] | p_nthreads_ | Logical host partitions used when counting markers. |
| [in] | natts_max_l_ | Maximum logical attributes, or negative to reuse natts_max_ for all auxiliary types. |
| [in] | natts_max_i8_ | Maximum 64-bit integer attributes. |
| [in] | natts_max_r4_ | Maximum single-precision attributes. |
| Kokkos::View<int**> orb5x::ParMove::ndest |
Non-empty destination count [substep][species].
| Kokkos::View<int**> orb5x::ParMove::np_leaving |
Outgoing marker count [substep][species].