New version with migration and forwarding always working. The test program also works.
[charm.git] / src / ck-com / DirectMulticastStrategy.h
1 #ifndef DIRECT_MULTICAST_STRATEGY
2 #define DIRECT_MULTICAST_STRATEGY
3
4 #include "ComlibManager.h"
5 #include "ComlibSectionInfo.h"
6
7 void *DMHandler(void *msg);
8
9 class DirectMulticastStrategy: public CharmStrategy {
10  protected:
11     CkQ <CharmMessageHolder*> *messageBuf;
12
13     int ndestpes, *destpelist; //Destination processors
14     int handlerId;
15     
16     ComlibSectionInfo sinfo;
17
18     //Array section support
19     CkHashtableT<ComlibSectionHashKey, void *> sec_ht; 
20     
21     //Common Initializer for group and array constructors
22     //Every substrategy should implement its own
23     void commonInit();
24     
25  public:
26     
27     //Group constructor
28     DirectMulticastStrategy(int ndestpes = 0, int *destpelist = 0);    
29
30     //Array constructor
31     DirectMulticastStrategy(CkArrayID aid);
32
33     DirectMulticastStrategy(CkMigrateMessage *m): CharmStrategy(m){}
34     
35     virtual void insertMessage(CharmMessageHolder *msg);
36     virtual void doneInserting();
37
38     //Called by the converse handler function
39     virtual void handleMulticastMessage(void *msg);
40     
41     virtual void pup(PUP::er &p);    
42     virtual void beginProcessing(int nelements);
43     
44     PUPable_decl(DirectMulticastStrategy);
45 };
46 #endif
47