New version with migration and forwarding always working. The test program also works.
[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     int ndestpes, *destpelist, *destMap; //Destination processors
15
16     int handlerId;
17     
18     //Dynamically set by the application
19     CkHashtableT<ComlibSectionHashKey, void *> sec_ht;
20
21     //Executes common code just after array and group constructors
22     virtual void commonInit();
23     virtual void initSectionID(CkSectionID *sid);
24
25     int MaxSectionID;
26
27     RouterStrategy *rstrat;
28     ComlibSectionInfo sinfo;
29
30  public:
31     //Group constructor
32     EachToManyMulticastStrategy(int strategyId, int nsrcpes=0, 
33                                 int *srcpelist=0, 
34                                 int ndestpes =0, int *destpelist =0);
35     
36     //Array constructor
37     EachToManyMulticastStrategy(int substrategy, CkArrayID src, 
38                                 CkArrayID dest, int nsrc=0, 
39                                 CkArrayIndexMax *srcelements=0, int ndest=0, 
40                                 CkArrayIndexMax *destelements=0);
41     
42     EachToManyMulticastStrategy(CkMigrateMessage *m) : CharmStrategy(m){}
43
44     //Basic function, subclasses should not have to change it
45     virtual void insertMessage(CharmMessageHolder *msg);
46     //More specielized function
47     virtual void doneInserting();
48
49     virtual void pup(PUP::er &p);    
50     virtual void beginProcessing(int nelements);
51     virtual void localMulticast(void *msg);
52     
53     PUPable_decl(EachToManyMulticastStrategy);
54
55 };
56 #endif
57