forked from N-BodyShop/changa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MultistepOrbLB.h
62 lines (48 loc) · 1.61 KB
/
MultistepOrbLB.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*****************************************************************************
* $Source$
* $Author$
* $Date$
* $Revision$
*****************************************************************************/
/**
* \addtogroup CkLdb
*/
/*@{*/
#ifndef _MULTISTEPORBLB_H_
#define _MULTISTEPORBLB_H_
#define MCLBMS // multistepping enabled
#include "MultistepOrbLB.decl.h"
#include "TaggedVector3D.h"
#include "OrbLB.h"
void CreateMultistepOrbLB();
BaseLB * AllocateMultistepOrbLB();
/// @brief Multistep load balancer where no processor topology
/// information is used.
///
/// This balancer recognizes different "phases" (called rungs in other
/// parts of the code), and uses loads based on measurements of the
/// previous calculation at the same phase. For large phases, (i.e.,
/// when many particles are active, the TreePieces are divided among
/// by 3 dimensional ORB based on the centroids of the TreePieces.
/// For small phases, a greedy algorithm is used.
///
class MultistepOrbLB : public CBase_MultistepOrbLB {
private:
bool QueryBalanceNow(int step);
void init();
unsigned int determinePhase(unsigned int activeRung);
void makeActiveProcessorList(BaseLB::LDStats *stats, int numActiveObjs);
void mergeInstrumentedData(int phase, BaseLB::LDStats *phaseStats);
bool havePhaseData(int phase);
void printData(BaseLB::LDStats &stats, int phase, int *revObjMap);
public:
MultistepOrbLB(const CkLBOptions &);
MultistepOrbLB(CkMigrateMessage *m) : CBase_MultistepOrbLB(m) {
init();
}
void work(BaseLB::LDStats* stats);
public:
void pup(PUP::er &p);
};
#endif /* _MultistepOrbLB */
/*@}*/