https://github.com/N-BodyShop/changa
Revision f9aa0561beec30804f8b61d4e72bba24ad9d5fa1 authored by Tom Quinn on 14 August 2017, 22:41:05 UTC, committed by Tom Quinn on 30 August 2017, 22:34:50 UTC
Change-Id: Icb82cbd8a7e18f918a512d4385ed6412415d5500
1 parent 2c05d51
Raw File
Tip revision: f9aa0561beec30804f8b61d4e72bba24ad9d5fa1 authored by Tom Quinn on 14 August 2017, 22:41:05 UTC
Update to v3.3
Tip revision: f9aa056
Orb3dLB.h
/**
 * \addtogroup CkLdb
*/
/*@{*/

#ifndef _ORB3DLB_H_
#define _ORB3DLB_H_

#include "CentralLB.h"
#include "MapStructures.h"
#include "Orb3dLB.decl.h"
#include "TaggedVector3D.h"
#include <queue>

void CreateOrb3dLB();
BaseLB * AllocateOrb3dLB();

class Orb3dLB : public CBase_Orb3dLB {
  friend class MultistepLB;
private:
  bool firstRound;
  bool centroidsAllocated;
  ComparatorFn compares[NDIMS];
  ComparatorFn pc[NDIMS];
  // pointer to stats->to_proc
  CkVec<int> *mapping;

  int procsPerNode;

  CkVec<TPObject> tps;
  CkVec<Node> nodes;

  void init();
  bool QueryBalanceNow(int step);

  void printData(BaseLB::LDStats &stats, int phase, int *revObjMap);

public:
  Orb3dLB(const CkLBOptions &);
  Orb3dLB(CkMigrateMessage *m) : CBase_Orb3dLB(m) {init();}
  void work(BaseLB::LDStats* stats);
  void directMap(int tpstart, int tpend, int nodestart, int nodeend);
  void map(int tpstart, int tpend, int nodestart, int nodeend, int xs, int ys, int zs, int dim);
  int nextDim(int dim, int xs, int ys, int zs);
  void partitionEvenLoad(int tpstart, int tpend, int &tpmid);
  void halveNodes(int nodestart, int nodeend, int &nodemid);


};

#endif /* _ORB3DLB_H_ */

/*@}*/
back to top