![]() |
Shamrock 2025.10.0
Astrophysical Code
|
The MPI scheduler. More...
#include <shamrock/include/shamrock/scheduler/PatchScheduler.hpp>
Collaboration diagram for PatchScheduler:Public Types | |
| using | PatchTree = shamrock::scheduler::PatchTree |
| using | SchedulerPatchData = shamrock::scheduler::SchedulerPatchData |
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 | |
| 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 85 of file PatchScheduler.hpp.
Definition at line 93 of file PatchScheduler.hpp.
Definition at line 94 of file PatchScheduler.hpp.
| PatchScheduler::PatchScheduler | ( | const std::shared_ptr< shamrock::patch::PatchDataLayerLayout > & | pdl_ptr, |
| u64 | crit_split, | ||
| u64 | crit_merge | ||
| ) |
Definition at line 208 of file PatchScheduler.cpp.
| PatchScheduler::~PatchScheduler | ( | ) |
Definition at line 221 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 192 of file PatchScheduler.cpp.
Here is the call graph for this function:| 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 100 of file PatchScheduler.cpp.
Here is the call graph for this function:| 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 166 of file PatchScheduler.cpp.
Here is the call graph for this function:| void PatchScheduler::check_patchdata_locality_correctness | ( | ) |
Definition at line 681 of file PatchScheduler.cpp.
|
inline |
Definition at line 493 of file PatchScheduler.hpp.
|
inline |
Definition at line 369 of file PatchScheduler.hpp.
|
inline |
Definition at line 356 of file PatchScheduler.hpp.
| void PatchScheduler::dump_local_patches | ( | std::string | filename | ) |
Definition at line 836 of file PatchScheduler.cpp.
| std::string PatchScheduler::dump_status | ( | ) |
Definition at line 568 of file PatchScheduler.cpp.
|
inline |
Definition at line 284 of file PatchScheduler.hpp.
|
inline |
Definition at line 293 of file PatchScheduler.hpp.
|
inline |
Definition at line 312 of file PatchScheduler.hpp.
|
inline |
Definition at line 302 of file PatchScheduler.hpp.
|
inline |
Definition at line 271 of file PatchScheduler.hpp.
|
inline |
for each macro for patchadata example usage
| Function | The functor that will be used |
| fct |
Definition at line 258 of file PatchScheduler.hpp.
Here is the call graph for this function:
|
inline |
Definition at line 330 of file PatchScheduler.hpp.
| std::string PatchScheduler::format_patch_coord | ( | shamrock::patch::Patch | p | ) |
Definition at line 640 of file PatchScheduler.cpp.
| void PatchScheduler::free_mpi_required_types | ( | ) |
Definition at line 46 of file PatchScheduler.cpp.
| std::vector< std::unique_ptr< shamrock::patch::PatchDataLayer > > PatchScheduler::gather_data | ( | u32 | rank | ) |
Definition at line 943 of file PatchScheduler.cpp.
| std::tuple< f32_3, f32_3 > PatchScheduler::get_box_tranform | ( | ) |
Definition at line 252 of file PatchScheduler.cpp.
| std::tuple< f64_3, f64_3 > PatchScheduler::get_box_tranform | ( | ) |
Definition at line 266 of file PatchScheduler.cpp.
| std::tuple< f32_3, f32_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 280 of file PatchScheduler.cpp.
| std::tuple< f64_3, f64_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 289 of file PatchScheduler.cpp.
| std::tuple< i64_3, i64_3 > PatchScheduler::get_box_volume | ( | ) |
Definition at line 298 of file PatchScheduler.cpp.
|
inline |
Definition at line 113 of file PatchScheduler.hpp.
|
inline |
Definition at line 511 of file PatchScheduler.hpp.
Definition at line 324 of file PatchScheduler.hpp.
|
inline |
Definition at line 234 of file PatchScheduler.hpp.
|
inline |
Definition at line 417 of file PatchScheduler.hpp.
|
inline |
Definition at line 532 of file PatchScheduler.hpp.
|
inline |
Definition at line 428 of file PatchScheduler.hpp.
| void PatchScheduler::init_mpi_required_types | ( | ) |
Definition at line 39 of file PatchScheduler.cpp.
| template void PatchScheduler::make_patch_base_grid< 3 > | ( | std::array< u32, dim > | patch_count | ) |
Definition at line 54 of file PatchScheduler.cpp.
|
inline |
Definition at line 343 of file PatchScheduler.hpp.
|
inline |
Definition at line 393 of file PatchScheduler.hpp.
|
inline |
Definition at line 380 of file PatchScheduler.hpp.
|
inline |
Definition at line 412 of file PatchScheduler.hpp.
|
inline |
Definition at line 406 of file PatchScheduler.hpp.
|
inline |
Definition at line 109 of file PatchScheduler.hpp.
|
inline |
Definition at line 435 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 307 of file PatchScheduler.cpp.
Here is the call graph for this function:| nlohmann::json PatchScheduler::serialize_patch_metadata | ( | ) |
Definition at line 1018 of file PatchScheduler.cpp.
|
inline |
modify the bounding box of the patch domain
| vectype |
| box |
Definition at line 194 of file PatchScheduler.hpp.
Here is the call graph for this function:
|
inline |
modify the bounding box of the patch domain
| vectype |
| bmin | |
| bmax |
Definition at line 162 of file PatchScheduler.hpp.
Here is the call graph for this function:| bool PatchScheduler::should_resize_box | ( | bool | node_in | ) |
Definition at line 223 of file PatchScheduler.cpp.
| void PatchScheduler::sync_build_LB | ( | bool | global_patch_sync, |
| bool | balance_load | ||
| ) |
Definition at line 231 of file PatchScheduler.cpp.
|
inline |
Definition at line 138 of file PatchScheduler.hpp.
| u64 PatchScheduler::crit_patch_merge |
merging limit (if load value < crit_patch_merge => patch merge)
Definition at line 99 of file PatchScheduler.hpp.
| u64 PatchScheduler::crit_patch_split |
splitting limit (if load value > crit_patch_split => patch split)
Definition at line 98 of file PatchScheduler.hpp.
|
staticconstexpr |
Definition at line 90 of file PatchScheduler.hpp.
|
staticconstexpr |
Definition at line 91 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 106 of file PatchScheduler.hpp.
| SchedulerPatchData PatchScheduler::patch_data |
handle the data of the patches of the scheduler
Definition at line 102 of file PatchScheduler.hpp.
| SchedulerPatchList PatchScheduler::patch_list |
handle the list of the patches of the scheduler
Definition at line 101 of file PatchScheduler.hpp.
| PatchTree PatchScheduler::patch_tree |
handle the tree structure of the patches
Definition at line 103 of file PatchScheduler.hpp.
| std::shared_ptr<shamrock::patch::PatchDataLayerLayout> PatchScheduler::pdl_ptr |
Definition at line 96 of file PatchScheduler.hpp.