https://github.com/N-BodyShop/changa
Raw File
Tip revision: bf7d27caa7f59402ddd2cccb425c3c249e61c223 authored by Michael Robson on 24 April 2018, 21:44:12 UTC
dirty! Minor hack-y changes to get things compiled
Tip revision: bf7d27c
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