changa 3.5
Loading...
Searching...
No Matches
MultistepLB_SFC.h
1#ifndef _MULTISTEPLB_SFC_H_
2#define _MULTISTEPLB_SFC_H_
3
4#include "MultistepLB_SFC.decl.h"
5#include "Vector3D.h"
6#include "cosmoType.h"
7#include "SFC.h"
8#include "CentralLB.h"
9
10void Orb_PrintLBStats(BaseLB::LDStats *stats, int numobjs);
11void write_LB_particles(BaseLB::LDStats* stats, const char *achFileName, bool bFrom);
12
22
23class MultistepLB_SFC : public CBase_MultistepLB_SFC {
24private:
25 void init();
26 bool QueryBalanceNow(int step);
27
28 decltype(BaseLB::LDStats::to_proc) *mapping;
29 decltype(BaseLB::LDStats::from_proc) *from;
31 double dTotalLoad;
33 double maxPieceProc;
34
35public:
36 MultistepLB_SFC(const CkLBOptions &);
37 MultistepLB_SFC(CkMigrateMessage *m) : CBase_MultistepLB_SFC(m) {
38 init();
39 }
40
41 class SFCObject
42 {
43 public:
47 Vector3D<cosmoType> centroid;
48 SFC::Key key;
50 double load;
51
52 SFCObject() : lbindex(-1), load(0) {}
53 SFCObject(int _lbindex, double _load) :
54 lbindex(_lbindex),
55 load(_load)
56 {
57 }
58 bool operator<(const SFCObject &o) const{
59 return key < o.key;
60 }
61 };
62
63 void work(BaseLB::LDStats* stats);
64 void work2(BaseLB::LDStats* stats);
65 void sfcPrepare(std::vector<SFCObject> &tp_array,
66 int nObjs, BaseLB::LDStats * stats,
67 bool node_partition=false);
68 void sfcPartition(int nProcs, std::vector<SFCObject> & tp,
69 BaseLB::LDStats *stats, bool node_partition=false);
70 void pup(PUP::er &p);
71};
72
73
74#endif /* _MultistepLB_notopo */
Definition MultistepLB_SFC.h:42
int lbindex
index into LB stats->objData
Definition MultistepLB_SFC.h:45
double load
computational cost of this object
Definition MultistepLB_SFC.h:50
Vector3D< cosmoType > centroid
Spacial location of TreePiece.
Definition MultistepLB_SFC.h:47
void work(BaseLB::LDStats *stats)
Implement load balancing: store loads and determine active processors and objects,...
Definition MultistepLB_SFC.cpp:44
void sfcPrepare(std::vector< SFCObject > &tp_array, int nObjs, BaseLB::LDStats *stats, bool node_partition=false)
Prepare structures for the ORB partition.
Definition MultistepLB_SFC.cpp:183
void sfcPartition(int nProcs, std::vector< SFCObject > &tp, BaseLB::LDStats *stats, bool node_partition=false)
Partition treepieces among processors by dividing the SFC as evenly as possible.
Definition MultistepLB_SFC.cpp:243
void work2(BaseLB::LDStats *stats)
SFC load balance.
Definition MultistepLB_SFC.cpp:115