8 * support nonmigratable attrib
9 * does not support processor avail bitvector
12 #include "ComboCentLB.h"
14 extern LBAllocFn getLBAllocFn(const char *lbname);
16 CreateLBFunc_Def(ComboCentLB, "Allow multiple strategies to work serially")
18 ComboCentLB::ComboCentLB(const CkLBOptions &opt): CBase_ComboCentLB(opt)
20 lbname = "ComboCentLB";
21 const char *lbs = theLbdb->loadbalancer(opt.getSeqNo());
23 CkPrintf("[%d] ComboCentLB created with %s\n",CkMyPe(), lbs);
25 char *lbcopy = strdup(lbs);
26 char *p = strchr(lbcopy, ':');
30 LBAllocFn fn = getLBAllocFn(p);
32 CkPrintf("LB> Invalid load balancer: %s.\n", p);
36 clbs.push_back((CentralLB*)alb);
37 p = strtok(NULL, ",");
41 void ComboCentLB::work(LDStats* stats)
43 int nlbs = clbs.length();
44 int n_objs = stats->n_objs;
45 int *from_orig = new int[n_objs];
48 // stats->from_proc should remain untouched at end
49 for (obj=0; obj<n_objs; obj++) from_orig[obj] = stats->from_proc[obj];
51 for (int i=0; i<nlbs; i++) {
54 for (obj=0; obj<stats->n_objs; obj++)
55 stats->from_proc[obj] = stats->to_proc[obj];
59 for (obj=0; obj<n_objs; obj++) stats->from_proc[obj] = from_orig[obj];
64 #include "ComboCentLB.def.h"