ck-ldb: New analog of RotateLB
authorAbhinav S Bhatele <bhatele@illinois.edu>
Wed, 10 Nov 2010 19:33:32 +0000 (13:33 -0600)
committerAbhinav S Bhatele <bhatele@illinois.edu>
Wed, 10 Nov 2010 19:36:50 +0000 (13:36 -0600)
This is a example load balancer which demonstrates the use of ckgraph data
structures (the new ObjGraph). Checking in skeleton first.

src/ck-ldb/EveryLB.ci
src/ck-ldb/GraphBFTLB.C [new file with mode: 0644]
src/ck-ldb/GraphBFTLB.ci [new file with mode: 0644]
src/ck-ldb/GraphBFTLB.h [new file with mode: 0644]
src/ck-ldb/Make.lb
src/ck-ldb/Makefile_lb.sh
src/scripts/Make.cidepends
src/scripts/Make.depends

index 4281a17f839f744aa5aef69fd1476a524d165d1d..ea6959c49e3a53e1d56b682f8ee561d2801d76a6 100644 (file)
@@ -6,6 +6,7 @@ module EveryLB {
   extern module CommLB;
   extern module DummyLB;
   extern module GraphPartLB;
+  extern module GraphBFTLB;
   extern module GreedyAgentLB;
   extern module GreedyCommLB;
   extern module GreedyLB;
diff --git a/src/ck-ldb/GraphBFTLB.C b/src/ck-ldb/GraphBFTLB.C
new file mode 100644 (file)
index 0000000..3f5fb13
--- /dev/null
@@ -0,0 +1,42 @@
+/** \file GraphBFTLB.C
+ *  Author: Abhinav S Bhatele
+ *  Date Created: November 10th, 2010
+ *  E-mail: bhatele@illinois.edu
+ *
+ */
+
+/**
+ *  \addtogroup CkLdb
+ */
+
+/*@{*/
+
+#include "GraphBFTLB.h"
+#include "ckgraph.h"
+
+CreateLBFunc_Def(GraphBFTLB, "Algorithm which does breadth first traversal for communication aware load balancing")
+
+GraphBFTLB::GraphBFTLB(const CkLBOptions &opt) : CentralLB(opt) {
+  lbname = "GraphBFTLB";
+  if(CkMyPe() == 0)
+    CkPrintf("GraphBFTLB created\n");
+}
+
+CmiBool GraphBFTLB::QueryBalanceNow(int _step) {
+  return CmiTrue;
+}
+
+void GraphBFTLB::work(LDStats *stats) {
+  /** ========================== INITIALIZATION ============================= */
+  ProcArray *parr = new ProcArray(stats);
+  ObjGraph *ogr = new ObjGraph(stats);
+
+  /** ============================= STRATEGY ================================ */
+
+  /** ============================== CLEANUP ================================ */
+  ogr->convertDecisions(stats);
+}
+
+#include "GraphBFTLB.def.h"
+
+/*@}*/
diff --git a/src/ck-ldb/GraphBFTLB.ci b/src/ck-ldb/GraphBFTLB.ci
new file mode 100644 (file)
index 0000000..d3303eb
--- /dev/null
@@ -0,0 +1,8 @@
+module GraphBFTLB {
+  extern module CentralLB;
+  initnode void lbinit (void);
+
+  group [migratable] GraphBFTLB : CentralLB {
+    entry void GraphBFTLB(const CkLBOptions &);
+  };
+};
diff --git a/src/ck-ldb/GraphBFTLB.h b/src/ck-ldb/GraphBFTLB.h
new file mode 100644 (file)
index 0000000..2f48f41
--- /dev/null
@@ -0,0 +1,36 @@
+/** \file GraphBFTLB.h
+ *  Author: Abhinav S Bhatele
+ *  Date Created: November 10th, 2010
+ *  E-mail: bhatele@illinois.edu
+ *
+ */
+
+/**
+ *  \addtogroup CkLdb
+ */
+
+/*@{*/
+
+#ifndef _GRAPHBFTLB_H_
+#define _GRAPHBFTLB_H_
+
+#include "CentralLB.h"
+#include "GraphBFTLB.decl.h"
+
+void CreateGraphBFTLB();
+
+class GraphBFTLB : public CentralLB {
+  public:
+    GraphBFTLB(const CkLBOptions &opt);
+    GraphBFTLB(CkMigrateMessage *m) : CentralLB (m) { };
+
+    void work(LDStats *stats);
+    void pup(PUP::er &p) { CentralLB::pup(p); }
+
+  private:
+    CmiBool QueryBalanceNow(int _step);
+};
+
+#endif /* _GRAPHBFTLB_H_ */
+
+/*@}*/
index deb354b34a4c066d0bc4d6313a9868052e105887..9e75180e2712a81a4593866201e9745215544ccd 100644 (file)
@@ -1,13 +1,14 @@
 # Automatically generated by script Makefile_lb.sh
 #  by uid=21543(bhatele) gid=80(kale) groups=80(kale),400(ppladmin)
 #  at panache
-#  on Fri Oct 29 14:54:13 CDT 2010
+#  on Wed Nov 10 13:22:08 CST 2010
 ALL_LDBS=\
    $(L)/libmoduleBlockLB.a \
    $(L)/libmoduleComboCentLB.a \
    $(L)/libmoduleCommLB.a \
    $(L)/libmoduleDummyLB.a \
    $(L)/libmoduleGraphPartLB.a \
+   $(L)/libmoduleGraphBFTLB.a \
    $(L)/libmoduleGreedyAgentLB.a \
    $(L)/libmoduleGreedyCommLB.a \
    $(L)/libmoduleGreedyLB.a \
@@ -65,6 +66,12 @@ $(L)/libmoduleGraphPartLB.a: GraphPartLB.o
 LBHEADERS += GraphPartLB.h GraphPartLB.decl.h
 
 
+$(L)/libmoduleGraphBFTLB.a: GraphBFTLB.o 
+       $(CHARMC) -o $(L)/libmoduleGraphBFTLB.a GraphBFTLB.o 
+       
+LBHEADERS += GraphBFTLB.h GraphBFTLB.decl.h
+
+
 $(L)/libmoduleGreedyAgentLB.a: GreedyAgentLB.o 
        $(CHARMC) -o $(L)/libmoduleGreedyAgentLB.a GreedyAgentLB.o 
        
@@ -216,6 +223,7 @@ ALL_LB_OBJS=EveryLB.o \
     CommLB.o \
     DummyLB.o \
     GraphPartLB.o \
+    GraphBFTLB.o \
     GreedyAgentLB.o \
     GreedyCommLB.o \
     GreedyLB.o \
@@ -248,6 +256,7 @@ EVERYLB_DEPS=EveryLB.o \
     CommLB.o \
     DummyLB.o \
     GraphPartLB.o \
+    GraphBFTLB.o \
     GreedyAgentLB.o \
     GreedyCommLB.o \
     GreedyLB.o \
index d8b23d27355194101d3deb1333aeb8b1b0646d02..29f039111865f20dae228779e204d9f081420392 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-ALL_LDBS="BlockLB ComboCentLB CommLB DummyLB GraphPartLB GreedyAgentLB GreedyCommLB GreedyLB GridCommLB GridCommRefineLB GridHybridLB GridHybridSeedLB GridMetisLB HbmLB HybridLB MetisLB NeighborCommLB NeighborLB OrbLB PhasebyArrayLB RandCentLB RefineLB RefineCommLB RefineKLB RefineTopoLB RotateLB TopoCentLB TopoLB WSLB"
+ALL_LDBS="BlockLB ComboCentLB CommLB DummyLB GraphPartLB GraphBFTLB GreedyAgentLB GreedyCommLB GreedyLB GridCommLB GridCommRefineLB GridHybridLB GridHybridSeedLB GridMetisLB HbmLB HybridLB MetisLB NeighborCommLB NeighborLB OrbLB PhasebyArrayLB RandCentLB RefineLB RefineCommLB RefineKLB RefineTopoLB RotateLB TopoCentLB TopoLB WSLB"
 COMMON_LDBS="BlockLB CommLB DummyLB GreedyAgentLB GreedyCommLB GreedyLB NeighborCommLB NeighborLB OrbLB PhasebyArrayLB RandCentLB RefineLB RefineCommLB RotateLB"
 
 out="Make.lb"
index 105a2bc2c119ec7d3ffbdcc55adc6927711bd36d..003497bd2add39ab590e5e27d84b1a5e979978c1 100644 (file)
@@ -22,6 +22,7 @@ ControlPointsNoTrace.decl.h ControlPointsNoTrace.def.h: controlPointsNoTrace.ci.
 DummyLB.decl.h DummyLB.def.h: DummyLB.ci.stamp
 EveryLB.decl.h EveryLB.def.h: EveryLB.ci.stamp
 f90main.decl.h f90main.def.h: f90main.ci.stamp
+GraphBFTLB.decl.h GraphBFTLB.def.h: GraphBFTLB.ci.stamp
 GraphPartLB.decl.h GraphPartLB.def.h: GraphPartLB.ci.stamp
 GreedyAgentLB.decl.h GreedyAgentLB.def.h: GreedyAgentLB.ci.stamp
 GreedyCommLB.decl.h GreedyCommLB.def.h: GreedyCommLB.ci.stamp
index c5cac1c4f57d24c09c660c4f49c8b360d2402266..d9d448c885924063c7f97d2d1fa207b7d90609d5 100644 (file)
@@ -1079,7 +1079,21 @@ WSLB.o: WSLB.C charm++.h charm.h converse.h conv-config.h \
  elements.h ckset.h WSLB.h BaseLB.h WSLB.decl.h topology.h WSLB.def.h
        $(CHARMC) -c -I. WSLB.C
 
-ckgraph.o: ckgraph.C ckgraph.h
+ckgraph.o: ckgraph.C ckgraph.h BaseLB.h LBDatabase.h lbdb.h converse.h \
+ conv-config.h conv-autoconfig.h conv-common.h conv-mach.h \
+ conv-mach-opt.h pup_c.h queueing.h conv-cpm.h conv-cpath.h conv-qd.h \
+ conv-random.h conv-lists.h conv-trace.h persistent.h debug-conv.h \
+ charm.h pup.h middle.h middle-conv.h LBDBManager.h cklists.h LBObj.h \
+ LBOM.h LBComm.h LBMachineUtil.h lbdb++.h LBDatabase.decl.h charm++.h \
+ ckbitvector.h ckstream.h init.h ckhashtable.h debug-charm.h simd.h \
+ CkMarshall.decl.h cksection.h ckcallback.h conv-ccs.h sockRoutines.h \
+ ccs-server.h ckobjQ.h ckreduction.h CkReduction.decl.h \
+ cknodegroupreduction.h CkArrayReductionMgr.decl.h ckmemcheckpoint.h \
+ CkMemCheckpoint.decl.h readonly.h ckarray.h cklocation.h \
+ CkLocation.decl.h CkArray.decl.h CkFutures.decl.h charisma.h \
+ charisma.decl.h tempo.h tempo.decl.h waitqd.h waitqd.decl.h sdag.h \
+ ckcheckpoint.h CkCheckpoint.decl.h ckevacuation.h ckarrayreductionmgr.h \
+ trace.h trace-bluegene.h envelope.h NullLB.decl.h BaseLB.decl.h
        $(CHARMC) -c -I. ckgraph.C
 
 graph.o: graph.c converse.h conv-config.h conv-autoconfig.h conv-common.h \
@@ -1422,11 +1436,11 @@ EveryLB.o: EveryLB.C charm++.h charm.h converse.h conv-config.h \
  trace-bluegene.h envelope.h LBDatabase.h EveryLB.decl.h charm++.h \
  BlockLB.decl.h CentralLB.decl.h BaseLB.decl.h LBDatabase.decl.h \
  CentralLBMsg.h ComboCentLB.decl.h CommLB.decl.h DummyLB.decl.h \
- GraphPartLB.decl.h GreedyAgentLB.decl.h GreedyCommLB.decl.h \
- GreedyLB.decl.h GridCommLB.decl.h GridCommRefineLB.decl.h \
- GridHybridLB.decl.h GridHybridSeedLB.decl.h GridMetisLB.decl.h \
HbmLB.decl.h NeighborLBMsg.h HybridLBMsg.h HybridLB.decl.h \
- HybridBaseLB.decl.h MetisLB.decl.h NeighborCommLB.decl.h \
+ GraphPartLB.decl.h GraphBFTLB.decl.h GreedyAgentLB.decl.h \
+ GreedyCommLB.decl.h GreedyLB.decl.h GridCommLB.decl.h \
+ GridCommRefineLB.decl.h GridHybridLB.decl.h GridHybridSeedLB.decl.h \
GridMetisLB.decl.h HbmLB.decl.h NeighborLBMsg.h HybridLBMsg.h \
+ HybridLB.decl.h HybridBaseLB.decl.h MetisLB.decl.h NeighborCommLB.decl.h \
  NborBaseLB.decl.h NeighborLB.decl.h OrbLB.decl.h PhasebyArrayLB.decl.h \
  RandCentLB.decl.h RefineLB.decl.h RefineCommLB.decl.h RefineKLB.decl.h \
  RefineTopoLB.decl.h RotateLB.decl.h TopoCentLB.decl.h TopoLB.decl.h \
@@ -1551,6 +1565,25 @@ GraphPartLB.o: GraphPartLB.C GraphPartLB.h CentralLB.h BaseLB.h \
  GraphPartLB.decl.h ckgraph.h GraphPartLB.def.h
        $(CHARMC) -c -I. GraphPartLB.C
 
+GraphBFTLB.o: GraphBFTLB.C GraphBFTLB.h CentralLB.h BaseLB.h LBDatabase.h \
+ lbdb.h converse.h conv-config.h conv-autoconfig.h conv-common.h \
+ conv-mach.h conv-mach-opt.h pup_c.h queueing.h conv-cpm.h conv-cpath.h \
+ conv-qd.h conv-random.h conv-lists.h conv-trace.h persistent.h \
+ debug-conv.h charm.h pup.h middle.h middle-conv.h LBDBManager.h \
+ cklists.h LBObj.h LBOM.h LBComm.h LBMachineUtil.h lbdb++.h \
+ LBDatabase.decl.h charm++.h ckbitvector.h ckstream.h init.h \
+ ckhashtable.h debug-charm.h simd.h CkMarshall.decl.h cksection.h \
+ ckcallback.h conv-ccs.h sockRoutines.h ccs-server.h ckobjQ.h \
+ ckreduction.h CkReduction.decl.h cknodegroupreduction.h \
+ CkArrayReductionMgr.decl.h ckmemcheckpoint.h CkMemCheckpoint.decl.h \
+ readonly.h ckarray.h cklocation.h CkLocation.decl.h CkArray.decl.h \
+ CkFutures.decl.h charisma.h charisma.decl.h tempo.h tempo.decl.h \
+ waitqd.h waitqd.decl.h sdag.h ckcheckpoint.h CkCheckpoint.decl.h \
+ ckevacuation.h ckarrayreductionmgr.h trace.h trace-bluegene.h envelope.h \
+ NullLB.decl.h BaseLB.decl.h CentralLB.decl.h CentralLBMsg.h \
+ GraphBFTLB.decl.h ckgraph.h GraphBFTLB.def.h
+       $(CHARMC) -c -I. GraphBFTLB.C
+
 GreedyAgentLB.o: GreedyAgentLB.C charm++.h charm.h converse.h \
  conv-config.h conv-autoconfig.h conv-common.h conv-mach.h \
  conv-mach-opt.h pup_c.h queueing.h conv-cpm.h conv-cpath.h conv-qd.h \