New version of communication library with learning capabilities. Learning and dynamic...
[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 "ComlibSectionInfo.h"
6 #include "routerstrategy.h"
7
8 class EachToManyMulticastStrategy: public CharmStrategy {
9  protected:
10     int routerID;      //Which topology
11     int npes, *pelist; //Domain of the topology
12     int MyPe;          //My id in that domain
13
14     CmiBool mflag;
15
16     int ndestpes, *destpelist; //Destination processors
17     int handlerId;
18     
19     //Dynamically set by the application
20     CkHashtableT<ComlibSectionHashKey, void *> sec_ht;
21
22     //Executes common code just after array and group constructors
23     virtual void commonInit();
24     virtual void initSectionID(CkSectionID *sid);
25
26     RouterStrategy *rstrat;
27     ComlibSectionInfo sinfo;
28
29  public:
30     //Group constructor
31     EachToManyMulticastStrategy(int strategyId, int nsrcpes=0, 
32                                 int *srcpelist=0, 
33                                 int ndestpes =0, int *destpelist =0);
34     
35     //Array constructor
36     EachToManyMulticastStrategy(int substrategy, CkArrayID src, 
37                                 CkArrayID dest, int nsrc=0, 
38                                 CkArrayIndexMax *srcelements=0, int ndest=0, 
39                                 CkArrayIndexMax *destelements=0);
40     
41     EachToManyMulticastStrategy(CkMigrateMessage *m) : CharmStrategy(m){};
42     
43     ~EachToManyMulticastStrategy();
44
45     //Basic function, subclasses should not have to change it
46     virtual void insertMessage(CharmMessageHolder *msg);
47     //More specielized function
48     virtual void doneInserting();
49
50     virtual void pup(PUP::er &p);    
51     virtual void beginProcessing(int nelements);
52     virtual void finalizeProcessing();
53     virtual void localMulticast(void *msg);
54     
55     PUPable_decl(EachToManyMulticastStrategy);
56
57 };
58 #endif
59