https://github.com/N-BodyShop/changa
Revision 9ee829f600da797891e861ab5916bf81225d799d authored by Cambridge on 30 April 2018, 06:07:45 UTC, committed by Tom Quinn on 05 July 2018, 23:23:35 UTC
Change-Id: I1c58c774f3b21e3fdf085809bb49381f963ab52b
1 parent d84c8e1
Raw File
Tip revision: 9ee829f600da797891e861ab5916bf81225d799d authored by Cambridge on 30 April 2018, 06:07:45 UTC
All the changes for GPU local tree walk
Tip revision: 9ee829f
MultistepNodeLB_notopo.h
/*****************************************************************************
 * $Source$
 * $Author$
 * $Date$
 * $Revision$
 *****************************************************************************/

/**
 * \addtogroup CkLdb
*/
/*@{*/

#ifndef _MULTISTEPNODELB_NOTOPO_H_
#define _MULTISTEPNODELB_NOTOPO_H_

#define MCLBMS          // multistepping enabled
#define MCLB_ORBSMOOTH  // orbsmooth for large steps
#define MCLB_RR         // round robin otherwise

#include "Orb3dLBCommon.h"

#include "MultistepNodeLB_notopo.decl.h"

void CreateMultistepLB_notopo();
BaseLB * AllocateMultistepNodeLB_notopo();


/// @brief Multistep load balancer where no processor topology
/// information is used. This first performs orb partition at the node level and
/// assigns the partitioned TreePieces to the PEs belonging to the node. Finally
/// after this assignment, a refinement is done.
class MultistepNodeLB_notopo : public CBase_MultistepNodeLB_notopo, public Orb3dCommon {
private:

  int prevMaxPredPe;

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

public:
  MultistepNodeLB_notopo(const CkLBOptions &);
  MultistepNodeLB_notopo(CkMigrateMessage *m) : CBase_MultistepNodeLB_notopo(m) {
    init();
  }
    
  void work(BaseLB::LDStats* stats);
  void balanceTPs(BaseLB::LDStats* stats);
  void balanceTPsNode(BaseLB::LDStats* stats);

private:  
  
  enum {XDIR=0, YDIR, ZDIR};
  
public:
  
//**************************************
// ORB3DLB functions
//**************************************
//
  void work2(BaseLB::LDStats* stats, int count);
  void greedy(BaseLB::LDStats* stats, int count);
 
  void pup(PUP::er &p);
};

#endif /* _MultistepNodeLB_notopo */

/*@}*/
back to top