![]() |
Shamrock 2025.10.0
Astrophysical Code
|
The MPI scheduler. More...
#include <shamrock/include/shamrock/scheduler/PatchScheduler.hpp>
Public Types | |
| using | PatchTree = shamrock::scheduler::PatchTree |
| using | SchedulerPatchData = shamrock::scheduler::SchedulerPatchData |
| using | SynchronizedData = shamrock::solvergraph::SolverGraphSerializable |
Public Member Functions | |
| shamrock::patch::PatchDataLayerLayout & | pdl_old () |
| std::shared_ptr< shamrock::patch::PatchDataLayerLayout > | get_layout_ptr_old () const |
| void | scheduler_step (bool do_split_merge, bool do_load_balancing) |
| scheduler step | |
| void | init_mpi_required_types () |
| void | free_mpi_required_types () |
| PatchScheduler (const std::shared_ptr< shamrock::patch::PatchDataLayerLayout > &pdl_ptr, u64 crit_split, u64 crit_merge) | |
| std::string | dump_status () |
| void | update_local_load_value (std::function< u64(shamrock::patch::Patch)> load_function) |
| template<class vectype> | |
| std::tuple< vectype, vectype > | get_box_tranform () |
| template<class vectype> | |
| std::tuple< vectype, vectype > | get_box_volume () |
| bool | should_resize_box (bool node_in) |
| template<class vectype> | |
| void | set_coord_domain_bound (vectype bmin, vectype bmax) |
| modify the bounding box of the patch domain | |
| void | allpush_data (shamrock::patch::PatchDataLayer &pdat) |
| push data in the scheduler The content of pdat as to be the same for each node | |
| template<u32 dim> | |
| void | make_patch_base_grid (std::array< u32, dim > patch_count) |
| template<class vectype> | |
| void | set_coord_domain_bound (std::tuple< vectype, vectype > box) |
| modify the bounding box of the patch domain | |
| std::string | format_patch_coord (shamrock::patch::Patch p) |
| void | check_patchdata_locality_correctness () |
| void | dump_local_patches (std::string filename) |
| std::vector< std::unique_ptr< shamrock::patch::PatchDataLayer > > | gather_data (u32 rank) |
| void | add_root_patch () |
| add patch to the scheduler | |
| void | sync_build_LB (bool global_patch_sync, bool balance_load) |
| template<class vec> | |
| shamrock::patch::PatchCoordTransform< vec > | get_patch_transform () |
| template<class Function> | |
| void | for_each_patch_data (Function &&fct) |
| for each macro for patchadata example usage | |
| template<class Function> | |
| void | for_each_patch (Function &&fct) |
| void | for_each_global_patch (const std::function< void(const shamrock::patch::Patch &)> &fct) |
| void | for_each_local_patch (const std::function< void(const shamrock::patch::Patch &)> &fct) |
| void | for_each_local_patchdata (const std::function< void(const shamrock::patch::Patch &, shamrock::patch::PatchDataLayer &)> &fct) |
| void | for_each_local_patch_nonempty (std::function< void(const shamrock::patch::Patch &)> fct) |
| u32 | get_patch_rank_owner (u64 patch_id) |
| void | for_each_patchdata_nonempty (std::function< void(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &)> fct) |
| template<class T> | |
| shambase::DistributedData< T > | map_owned_patchdata (std::function< T(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &pdat)> fct) |
| template<class T> | |
| shambase::DistributedData< T > | distrib_data_local_to_all_simple (shambase::DistributedData< T > &src) |
| template<class T> | |
| shambase::DistributedData< T > | distrib_data_local_to_all_load_store (shambase::DistributedData< T > &src) |
| template<class T> | |
| shambase::DistributedData< T > | map_owned_patchdata_fetch_simple (std::function< T(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &pdat)> fct) |
| template<class T> | |
| shambase::DistributedData< T > | map_owned_patchdata_fetch_load_store (std::function< T(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &pdat)> fct) |
| template<class T> | |
| shamrock::patch::PatchField< T > | map_owned_to_patch_field_simple (std::function< T(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &pdat)> fct) |
| template<class T> | |
| shamrock::patch::PatchField< T > | map_owned_to_patch_field_load_store (std::function< T(const shamrock::patch::Patch, shamrock::patch::PatchDataLayer &pdat)> fct) |
| u64 | get_rank_count () |
| u64 | get_total_obj_count () |
| template<class T> | |
| std::unique_ptr< sycl::buffer< T > > | rankgather_field (u32 field_idx) |
| template<class Function, class Pfield> | |
| void | compute_patch_field (Pfield &field, MPI_Datatype &dtype, Function &&lambda) |
| auto | get_node_set_edge_patchdata_layer_refs () |
| std::vector< u64 > | add_root_patches (std::vector< shamrock::patch::PatchCoord< 3 > > coords) |
| add a root patch to the scheduler | |
| shamrock::patch::SimulationBoxInfo & | get_sim_box () |
| nlohmann::json | serialize_patch_metadata () |
| template<> | |
| std::tuple< f32_3, f32_3 > | get_box_tranform () |
| template<> | |
| std::tuple< f64_3, f64_3 > | get_box_tranform () |
| template<> | |
| std::tuple< f32_3, f32_3 > | get_box_volume () |
| template<> | |
| std::tuple< f64_3, f64_3 > | get_box_volume () |
| template<> | |
| std::tuple< i64_3, i64_3 > | get_box_volume () |
Public Attributes | |
| std::shared_ptr< shamrock::patch::PatchDataLayerLayout > | pdl_ptr |
| u64 | crit_patch_split |
| splitting limit (if load value > crit_patch_split => patch split) | |
| u64 | crit_patch_merge |
| merging limit (if load value < crit_patch_merge => patch merge) | |
| SchedulerPatchList | patch_list |
| handle the list of the patches of the scheduler | |
| SchedulerPatchData | patch_data |
| handle the data of the patches of the scheduler | |
| PatchTree | patch_tree |
| handle the tree structure of the patches | |
| SynchronizedData | synchronized_data |
| data that is synchroneous across all ranks | |
| std::unordered_set< u64 > | owned_patch_id |
| (owned_patch_id = patch_list.build_local()) | |
Static Public Attributes | |
| static constexpr u64 | max_axis_patch_coord = LoadBalancer::max_box_sz |
| static constexpr u64 | max_axis_patch_coord_length = LoadBalancer::max_box_sz + 1 |
The MPI scheduler.
Definition at line 86 of file PatchScheduler.hpp.
| using PatchScheduler::PatchTree = shamrock::scheduler::PatchTree |
Definition at line 94 of file PatchScheduler.hpp.
| using PatchScheduler::SchedulerPatchData = shamrock::scheduler::SchedulerPatchData |
Definition at line 95 of file PatchScheduler.hpp.
| using PatchScheduler::SynchronizedData = shamrock::solvergraph::SolverGraphSerializable |
Definition at line 96 of file PatchScheduler.hpp.
| PatchScheduler::PatchScheduler | ( | const std::shared_ptr< shamrock::patch::PatchDataLayerLayout > & | pdl_ptr, |
| u64 | crit_split, | ||
| u64 | crit_merge ) |
Definition at line 209 of file PatchScheduler.cpp.
| PatchScheduler::~PatchScheduler | ( | ) |
Definition at line 222 of file PatchScheduler.cpp.
| void PatchScheduler::add_root_patch | ( | ) |
add patch to the scheduler
//TODO find a better way to do this it is too error prone
| p | |
| pdat |
Definition at line 193 of file PatchScheduler.cpp.
| std::vector< u64 > PatchScheduler::add_root_patches | ( | std::vector< shamrock::patch::PatchCoord< 3 > > | coords | ) |
add a root patch to the scheduler
| coords | coordinates of the patch |
Definition at line 101 of file PatchScheduler.cpp.
| void PatchScheduler::allpush_data | ( | shamrock::patch::PatchDataLayer & | pdat | ) |
push data in the scheduler The content of pdat as to be the same for each node
| pdat | the data to push |
Definition at line 167 of file PatchScheduler.cpp.
| void PatchScheduler::check_patchdata_locality_correctness | ( | ) |
Definition at line 682 of file PatchScheduler.cpp.
|
inline |
Definition at line 496 of file PatchScheduler.hpp.
|
inline |
Definition at line 372 of file PatchScheduler.hpp.
|
inline |
Definition at line 359 of file PatchScheduler.hpp.
| void PatchScheduler::dump_local_patches | ( | std::string | filename | ) |
Definition at line 837 of file PatchScheduler.cpp.
| std::string PatchScheduler::dump_status | ( | ) |
Definition at line 569 of file PatchScheduler.cpp.
|
inline |
Definition at line 287 of file PatchScheduler.hpp.
|
inline |
Definition at line 296 of file PatchScheduler.hpp.
|
inline |
Definition at line 315 of file PatchScheduler.hpp.
|
inline |
Definition at line 305 of file PatchScheduler.hpp.
|
inline |
Definition at line 274 of file PatchScheduler.hpp.
|
inline |
for each macro for patchadata example usage
| Function | The functor that will be used |
| fct |
Definition at line 261 of file PatchScheduler.hpp.
|
inline |
Definition at line 333 of file PatchScheduler.hpp.
| std::string PatchScheduler::format_patch_coord | ( | shamrock::patch::Patch | p | ) |
Definition at line 641 of file PatchScheduler.cpp.
| void PatchScheduler::free_mpi_required_types | ( | ) |
Definition at line 47 of file PatchScheduler.cpp.
| std::vector< std::unique_ptr< shamrock::patch::PatchDataLayer > > PatchScheduler::gather_data | ( | u32 | rank | ) |
Definition at line 944 of file PatchScheduler.cpp.
| std::tuple< f64_3, f64_3 > PatchScheduler::get_box_tranform | ( | ) |
Definition at line 267 of file PatchScheduler.cpp.
| std::tuple< f32_3, f32_3 > PatchScheduler::get_box_tranform | ( | ) |
Definition at line 253 of file PatchScheduler.cpp.
| std::tuple< i64_3, i64_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 299 of file PatchScheduler.cpp.
| std::tuple< f64_3, f64_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 290 of file PatchScheduler.cpp.
| std::tuple< f32_3, f32_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 281 of file PatchScheduler.cpp.
|
inline |
Definition at line 116 of file PatchScheduler.hpp.
|
inline |
Definition at line 514 of file PatchScheduler.hpp.
Definition at line 327 of file PatchScheduler.hpp.
|
inline |
Definition at line 237 of file PatchScheduler.hpp.
|
inline |
Definition at line 420 of file PatchScheduler.hpp.
|
inline |
Definition at line 535 of file PatchScheduler.hpp.
|
inline |
Definition at line 431 of file PatchScheduler.hpp.
| void PatchScheduler::init_mpi_required_types | ( | ) |
Definition at line 40 of file PatchScheduler.cpp.
| template void PatchScheduler::make_patch_base_grid< 3 > | ( | std::array< u32, dim > | patch_count | ) |
Definition at line 55 of file PatchScheduler.cpp.
|
inline |
Definition at line 346 of file PatchScheduler.hpp.
|
inline |
Definition at line 396 of file PatchScheduler.hpp.
|
inline |
Definition at line 383 of file PatchScheduler.hpp.
|
inline |
Definition at line 415 of file PatchScheduler.hpp.
|
inline |
Definition at line 409 of file PatchScheduler.hpp.
|
inline |
Definition at line 112 of file PatchScheduler.hpp.
|
inline |
Definition at line 438 of file PatchScheduler.hpp.
| void PatchScheduler::scheduler_step | ( | bool | do_split_merge, |
| bool | do_load_balancing ) |
scheduler step
| do_split_merge | |
| do_load_balancing |
Definition at line 308 of file PatchScheduler.cpp.
| nlohmann::json PatchScheduler::serialize_patch_metadata | ( | ) |
Definition at line 1019 of file PatchScheduler.cpp.
|
inline |
modify the bounding box of the patch domain
| vectype |
| box |
Definition at line 197 of file PatchScheduler.hpp.
|
inline |
modify the bounding box of the patch domain
| vectype |
| bmin | |
| bmax |
Definition at line 165 of file PatchScheduler.hpp.
| bool PatchScheduler::should_resize_box | ( | bool | node_in | ) |
Definition at line 224 of file PatchScheduler.cpp.
| void PatchScheduler::sync_build_LB | ( | bool | global_patch_sync, |
| bool | balance_load ) |
Definition at line 232 of file PatchScheduler.cpp.
|
inline |
Definition at line 141 of file PatchScheduler.hpp.
| u64 PatchScheduler::crit_patch_merge |
merging limit (if load value < crit_patch_merge => patch merge)
Definition at line 101 of file PatchScheduler.hpp.
| u64 PatchScheduler::crit_patch_split |
splitting limit (if load value > crit_patch_split => patch split)
Definition at line 100 of file PatchScheduler.hpp.
|
staticconstexpr |
Definition at line 91 of file PatchScheduler.hpp.
|
staticconstexpr |
Definition at line 92 of file PatchScheduler.hpp.
| std::unordered_set<u64> PatchScheduler::owned_patch_id |
(owned_patch_id = patch_list.build_local())
list of owned patch ids updated with
Definition at line 109 of file PatchScheduler.hpp.
| SchedulerPatchData PatchScheduler::patch_data |
handle the data of the patches of the scheduler
Definition at line 104 of file PatchScheduler.hpp.
| SchedulerPatchList PatchScheduler::patch_list |
handle the list of the patches of the scheduler
Definition at line 103 of file PatchScheduler.hpp.
| PatchTree PatchScheduler::patch_tree |
handle the tree structure of the patches
Definition at line 105 of file PatchScheduler.hpp.
| std::shared_ptr<shamrock::patch::PatchDataLayerLayout> PatchScheduler::pdl_ptr |
Definition at line 98 of file PatchScheduler.hpp.
| SynchronizedData PatchScheduler::synchronized_data |
data that is synchroneous across all ranks
Definition at line 106 of file PatchScheduler.hpp.