Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamrock
include
shamrock
scheduler
HilbertLoadBalance.hpp
Go to the documentation of this file.
1
// -------------------------------------------------------//
2
//
3
// SHAMROCK code for hydrodynamics
4
// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5
// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6
// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7
//
8
// -------------------------------------------------------//
9
10
#pragma once
11
19
#include "
shammath/sfc/hilbert.hpp
"
20
#include "
shamrock/patch/Patch.hpp
"
21
#include <tuple>
22
#include <vector>
23
24
namespace
shamrock::scheduler {
25
26
struct
LoadBalancingChangeList
{
27
struct
ChangeOp
{
28
u64
patch_id;
29
u64
patch_idx;
30
i32
rank_owner_old;
31
i32
rank_owner_new;
32
i32
tag_comm;
33
};
34
35
std::vector<ChangeOp> change_ops;
36
};
37
42
template
<
class
hilbert_num>
43
class
HilbertLoadBalance
{
44
45
using
SFC
=
shamrock::sfc::HilbertCurve<hilbert_num, 3>
;
46
47
public
:
52
static
constexpr
u64
max_box_sz
=
shamrock::sfc::HilbertCurve<hilbert_num, 3>::max_val
;
53
62
static
LoadBalancingChangeList
make_change_list
(
63
std::vector<shamrock::patch::Patch> &global_patch_list);
64
};
65
66
using
HilbertLB
=
HilbertLoadBalance<u64>
;
67
using
HilbertLBQuad
=
HilbertLoadBalance<shamrock::sfc::quad_hilbert_num>
;
68
69
}
// namespace shamrock::scheduler
Patch.hpp
Header file for the patch struct and related function.
u64
std::uint64_t u64
64 bit unsigned integer
Definition
aliases_int.hpp:26
i32
std::int32_t i32
32 bit integer
Definition
aliases_int.hpp:23
shamrock::scheduler::HilbertLoadBalance
hilbert load balancing
Definition
HilbertLoadBalance.hpp:43
shamrock::scheduler::HilbertLoadBalance::make_change_list
static LoadBalancingChangeList make_change_list(std::vector< shamrock::patch::Patch > &global_patch_list)
generate the change list from the list of patch to run the load balancing
Definition
HilbertLoadBalance.cpp:50
shamrock::scheduler::HilbertLoadBalance::max_box_sz
static constexpr u64 max_box_sz
maximal value along an axis for the patch coordinate
Definition
HilbertLoadBalance.hpp:52
shamrock::sfc::HilbertCurve
Definition
hilbert.hpp:76
hilbert.hpp
hilbert curve implementation from killing J., 2004
shamrock::scheduler::LoadBalancingChangeList::ChangeOp
Definition
HilbertLoadBalance.hpp:27
shamrock::scheduler::LoadBalancingChangeList
Definition
HilbertLoadBalance.hpp:26
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8