Making the learner a dynamic switch rather than a compile time switch.
[charm.git] / src / ck-com / EachToManyMulticastStrategy.h
1 #ifndef EACH_TO_MANY_MULTICAST_STRATEGY
2 #define EACH_TO_MANY_MULTICAST_STRATEGY
3
4 #include "ComlibManager.h"
5 #include "routerstrategy.h"
6
7 class EachToManyMulticastStrategy: public CharmStrategy {
8  protected:
9     int routerID;      //Which topology
10     int npes, *pelist; //Domain of the topology
11     int MyPe;          //My id in that domain
12
13     int ndestpes, *destpelist; //Destination processors
14     int handlerId;
15     
16     //Executes common code just after array and group constructors
17     virtual void commonInit();
18
19     RouterStrategy *rstrat;
20     int useLearner;
21
22  public:
23     //Group constructor
24     EachToManyMulticastStrategy(int strategyId, int nsrcpes=0, 
25                                 int *srcpelist=0, 
26                                 int ndestpes =0, int *destpelist =0);
27     
28     //Array constructor
29     EachToManyMulticastStrategy(int substrategy, CkArrayID src, 
30                                 CkArrayID dest, int nsrc=0, 
31                                 CkArrayIndexMax *srcelements=0, int ndest=0, 
32                                 CkArrayIndexMax *destelements=0);
33     
34     EachToManyMulticastStrategy(CkMigrateMessage *m) : CharmStrategy(m){};
35     
36     ~EachToManyMulticastStrategy();
37
38     //Basic function, subclasses should not have to change it
39     virtual void insertMessage(CharmMessageHolder *msg);
40     //More specielized function
41     virtual void doneInserting();
42
43     virtual void pup(PUP::er &p);    
44     virtual void beginProcessing(int nelements);
45     virtual void finalizeProcessing();
46     virtual void localMulticast(void *msg);
47     
48     PUPable_decl(EachToManyMulticastStrategy);
49     
50     inline void enableLearning() {useLearner = 1;}
51 };
52 #endif
53