![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Patch Tree : Tree structure organisation for an abstract list of patches Nb : this tree is compatible with multiple roots cf value in roots_id. More...
#include <shamrock/include/shamrock/scheduler/PatchTree.hpp>
Collaboration diagram for shamrock::scheduler::PatchTree:Public Types | |
| using | Patch = patch::Patch |
| using | Node = scheduler::PatchTreeNode |
Public Member Functions | |
| void | split_node (u64 id) |
| split a leaf node | |
| void | merge_node_dm1 (u64 idparent) |
| merge childs of idparent (id parent should have only leafs as childs) | |
| void | build_from_patchtable (std::vector< Patch > &plist, u64 max_val_1axis) |
| make tree from a patch table | |
| void | update_values_node (std::vector< Patch > &plist, const std::unordered_map< u64, u64 > &id_patch_to_global_idx) |
| update value in nodes (tree reduction) | |
| void | partial_values_reduction (std::vector< Patch > &plist, const std::unordered_map< u64, u64 > &id_patch_to_global_idx) |
| update values in leafs and parent_of_only_leaf_key only | |
| std::unordered_set< u64 > | get_split_request (u64 crit_load_split) |
| Get list of nodes id to split. | |
| std::unordered_set< u64 > | get_merge_request (u64 crit_load_merge) |
| Get list of nodes id to merge. | |
| void | insert_root_node (u32 patch_id, patch::PatchCoord< 3 > coords) |
| nlohmann::json | serialize_patch_metadata () const |
| Serialize the metadata of the patch tree. | |
| void | load_json (const nlohmann::json &j) |
| Load the metadata of the patch tree from a JSON object. | |
Public Attributes | |
| std::unordered_set< u64 > | roots_id |
| set of root nodes ids | |
| std::unordered_map< u64, Node > | tree |
| store the tree using a map | |
| std::unordered_set< u64 > | leaf_key |
| key of leaf nodes in tree | |
| std::unordered_set< u64 > | parent_of_only_leaf_key |
| key of nodes that have only leafs as child | |
Patch Tree : Tree structure organisation for an abstract list of patches Nb : this tree is compatible with multiple roots cf value in roots_id.
Definition at line 29 of file PatchTree.hpp.
Definition at line 32 of file PatchTree.hpp.
Definition at line 31 of file PatchTree.hpp.
| void shamrock::scheduler::PatchTree::build_from_patchtable | ( | std::vector< Patch > & | plist, |
| u64 | max_val_1axis | ||
| ) |
make tree from a patch table
| plist | |
| max_val_1axis |
Definition at line 140 of file PatchTree.cpp.
Here is the call graph for this function:Get list of nodes id to merge.
| crit_load_merge |
Definition at line 308 of file PatchTree.cpp.
Get list of nodes id to split.
| crit_load_split |
Definition at line 295 of file PatchTree.cpp.
| void shamrock::scheduler::PatchTree::insert_root_node | ( | u32 | patch_id, |
| patch::PatchCoord< 3 > | coords | ||
| ) |
Definition at line 126 of file PatchTree.cpp.
| void shamrock::scheduler::PatchTree::load_json | ( | const nlohmann::json & | j | ) |
Load the metadata of the patch tree from a JSON object.
| j | The JSON object containing the metadata. |
Definition at line 347 of file PatchTree.cpp.
| void shamrock::scheduler::PatchTree::merge_node_dm1 | ( | u64 | idparent | ) |
merge childs of idparent (id parent should have only leafs as childs)
| idparent |
Definition at line 66 of file PatchTree.cpp.
Here is the call graph for this function:| void shamrock::scheduler::PatchTree::partial_values_reduction | ( | std::vector< Patch > & | plist, |
| const std::unordered_map< u64, u64 > & | id_patch_to_global_idx | ||
| ) |
update values in leafs and parent_of_only_leaf_key only
| plist | |
| id_patch_to_global_idx |
Definition at line 281 of file PatchTree.cpp.
| nlohmann::json shamrock::scheduler::PatchTree::serialize_patch_metadata | ( | ) | const |
Serialize the metadata of the patch tree.
Definition at line 326 of file PatchTree.cpp.
| void shamrock::scheduler::PatchTree::split_node | ( | u64 | id | ) |
| void shamrock::scheduler::PatchTree::update_values_node | ( | std::vector< Patch > & | plist, |
| const std::unordered_map< u64, u64 > & | id_patch_to_global_idx | ||
| ) |
update value in nodes (tree reduction)
| plist | |
| id_patch_to_global_idx |
Definition at line 268 of file PatchTree.cpp.
| std::unordered_set<u64> shamrock::scheduler::PatchTree::leaf_key |
key of leaf nodes in tree
Definition at line 49 of file PatchTree.hpp.
| std::unordered_set<u64> shamrock::scheduler::PatchTree::parent_of_only_leaf_key |
key of nodes that have only leafs as child
Definition at line 55 of file PatchTree.hpp.
| std::unordered_set<u64> shamrock::scheduler::PatchTree::roots_id |
set of root nodes ids
Definition at line 37 of file PatchTree.hpp.
store the tree using a map
Definition at line 43 of file PatchTree.hpp.