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 {
27 class LoadBalancer;
28}
29#include "hemocell.h"
30namespace hemo {
32 public:
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;}
44 void restructureBlocks(bool checkpoint_available=true) {}
45#endif
46
48
53
54 //Functionals for gathering data
55 struct TOAB_t{
56 double fluid_time;
58 int n_lsp;
60 };
61 struct Box3D_simple {
63 inline Box3D_simple & operator=(const Box3D & box) {
64 x0 = box.x0;
65 x1 = box.x1;
66 y0 = box.y0;
67 y1 = box.y1;
68 z0 = box.z0;
69 z1 = box.z1;
70 return *this;
71 }
72 inline Box3D getBox3D() const {
73 return Box3D(x0,x1,y0,y1,z0,z1);
74 }
75 };
76
78 public:
80 void processGenericBlocks(Box3D, vector<AtomicBlock3D*>);
82 };
83 private:
84 bool FLI_iscalled = false;
85 map<int,TOAB_t> gatherValues;
88 SparseBlockStructure3D * original_block_structure = 0;
89 ThreadAttribution * original_thread_attribution = 0;
90};
91}
92#endif
Definition hemoCellFunctional.h:54
Definition hemocell.h:68
void processGenericBlocks(Box3D, vector< AtomicBlock3D * >)
GatherTimeOfAtomicBlocks * clone() const
Definition loadBalancer.h:31
void restructureBlocks(bool checkpoint_available=true)
Definition loadBalancer.h:44
LoadBalancer(HemoCell &hemocell_)
Definition loadBalancer.h:42
double calculateFractionalLoadImbalance()
Definition loadBalancer.h:43
ThreadAttribution * original_thread_attribution
Definition loadBalancer.h:89
bool FLI_iscalled
Definition loadBalancer.h:84
map< int, TOAB_t > gatherValues
Definition loadBalancer.h:85
HemoCell & hemocell
Definition loadBalancer.h:86
bool original_block_stored
Definition loadBalancer.h:87
SparseBlockStructure3D * original_block_structure
Definition loadBalancer.h:88
double T
Definition constant_defaults.h:118
long int plint
Definition constant_defaults.h:127
Definition config.cpp:34
Definition loadBalancer.h:61
plint y1
Definition loadBalancer.h:62
Box3D_simple & operator=(const Box3D &box)
Definition loadBalancer.h:63
plint z0
Definition loadBalancer.h:62
plint x1
Definition loadBalancer.h:62
plint z1
Definition loadBalancer.h:62
plint y0
Definition loadBalancer.h:62
plint x0
Definition loadBalancer.h:62
Box3D getBox3D() const
Definition loadBalancer.h:72
Definition loadBalancer.h:55
int mpi_proc
Definition loadBalancer.h:59
double particle_time
Definition loadBalancer.h:57
double fluid_time
Definition loadBalancer.h:56
int n_lsp
Definition loadBalancer.h:58