New version of communication library with learning capabilities. Learning and dynamic...
[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     DirectMulticastStrategy(CkMigrateMessage *m): CharmStrategy(m){}
30                 
31     //Array constructor
32     DirectMulticastStrategy(CkArrayID aid);
33
34     //Array constructor
35     DirectMulticastStrategy(CkArrayID said, CkArrayID dest);
36         
37     //Destuctor
38     ~DirectMulticastStrategy();
39         
40     virtual void insertMessage(CharmMessageHolder *msg);
41     virtual void doneInserting();
42
43     //Called by the converse handler function
44     virtual void handleMulticastMessage(void *msg);
45     
46     virtual void pup(PUP::er &p);    
47     virtual void beginProcessing(int nelements);
48     
49     PUPable_decl(DirectMulticastStrategy);
50 };
51 #endif
52