hemocell
Loading...
Searching...
No Matches
loadBalancer.h
Go to the documentation of this file.
1/*
2This file is part of the HemoCell library
3
4HemoCell is developed and maintained by the Computational Science Lab
5in the University of Amsterdam. Any questions or remarks regarding this library
6can be sent to: info@hemocell.eu
7
8When using the HemoCell library in scientific work please cite the
9corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11The HemoCell library is free software: you can redistribute it and/or
12modify it under the terms of the GNU Affero General Public License as
13published by the Free Software Foundation, either version 3 of the
14License, or (at your option) any later version.
15
16The library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Affero General Public License for more details.
20
21You should have received a copy of the GNU Affero General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>.
23*/
24#ifndef LOADBALANCER_H
25#define LOADBALANCER_H
26namespace hemo {
27class LoadBalancer;
28}
29#include "hemocell.h"
30namespace hemo {
32public:
33#ifdef HEMO_PARMETIS
34 LoadBalancer(HemoCell & hemocell_);
40 void restructureBlocks(bool checkpoint_available = true);
41#else
42 LoadBalancer(HemoCell & hemocell_) : hemocell(hemocell_){};
43 double calculateFractionalLoadImbalance() { return 0.0; }
45 void restructureBlocks(bool checkpoint_available = true) {
46 hlog
47 << "(LoadBalancer) WARNING: doRestructure() has no effect, HemoCell was built without ParMETIS (HEMO_PARMETIS)."
48 << std::endl;
49 }
50#endif
51
53
58
59 //Functionals for gathering data
60 struct TOAB_t {
61 double fluid_time;
63 int n_lsp;
65 };
66 struct Box3D_simple {
68 inline Box3D_simple & operator=(const plb::Box3D & box) {
69 x0 = box.x0;
70 x1 = box.x1;
71 y0 = box.y0;
72 y1 = box.y1;
73 z0 = box.z0;
74 z1 = box.z1;
75 return *this;
76 }
77 inline plb::Box3D getBox3D() const { return plb::Box3D(x0, x1, y0, y1, z0, z1); }
78 };
79
81 public:
82 using HemoCellGatheringFunctional<TOAB_t>::HemoCellGatheringFunctional; //Inherit Constructor
83 void processGenericBlocks(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
85 };
86
87private:
88 bool FLI_iscalled = false;
89 std::map<int, TOAB_t> gatherValues;
92 plb::SparseBlockStructure3D * original_block_structure = 0;
93 plb::ThreadAttribution * original_thread_attribution = 0;
94};
95}
96#endif
Definition hemoCellFunctional.h:50
Definition hemocell.h:66
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
GatherTimeOfAtomicBlocks * clone() const
Definition loadBalancer.h:31
void restructureBlocks(bool checkpoint_available=true)
Without ParMETIS restructuring is unavailable; say so instead of silently doing nothing.
Definition loadBalancer.h:45
LoadBalancer(HemoCell &hemocell_)
Definition loadBalancer.h:42
std::map< int, TOAB_t > gatherValues
Definition loadBalancer.h:89
double calculateFractionalLoadImbalance()
Definition loadBalancer.h:43
bool FLI_iscalled
Definition loadBalancer.h:88
HemoCell & hemocell
Definition loadBalancer.h:90
bool original_block_stored
Definition loadBalancer.h:91
plb::SparseBlockStructure3D * original_block_structure
Definition loadBalancer.h:92
plb::ThreadAttribution * original_thread_attribution
Definition loadBalancer.h:93
double T
Definition constant_defaults.h:137
long int plint
Definition constant_defaults.h:149
Definition config.cpp:37
Logfile hlog
Definition logfile.cpp:26
Definition loadBalancer.h:66
plint y1
Definition loadBalancer.h:67
plint z0
Definition loadBalancer.h:67
Box3D_simple & operator=(const plb::Box3D &box)
Definition loadBalancer.h:68
plint x1
Definition loadBalancer.h:67
plint z1
Definition loadBalancer.h:67
plb::Box3D getBox3D() const
Definition loadBalancer.h:77
plint y0
Definition loadBalancer.h:67
plint x0
Definition loadBalancer.h:67
Definition loadBalancer.h:60
int mpi_proc
Definition loadBalancer.h:64
double particle_time
Definition loadBalancer.h:62
double fluid_time
Definition loadBalancer.h:61
int n_lsp
Definition loadBalancer.h:63