https://github.com/N-BodyShop/changa
Revision 681d06a26fdcdc6df5f5d4d0307fb16289dd5eaa authored by Tom Quinn on 30 June 2012, 03:38:54 UTC, committed by Tom Quinn on 02 September 2016, 04:47:24 UTC
Change-Id: I015dbaa04d68b44e8c9bbc04c99ea0fd7fe72ccb
1 parent 8be9a92
Raw File
Tip revision: 681d06a26fdcdc6df5f5d4d0307fb16289dd5eaa authored by Tom Quinn on 30 June 2012, 03:38:54 UTC
Move cosmoType into separate header for inclusion into C files.
Tip revision: 681d06a
MultistepOrbLB.h
/*****************************************************************************
 * $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 */

/*@}*/
back to top