Adding communication library in src/ck-com and src/conv-com
[charm.git] / src / ck-com / RingMulticastStrategy.h
1 #ifndef RING_MULTICAST_STRATEGY
2 #define RING_MULTICAST_STRATEGY
3
4 #include "DirectMulticastStrategy.h"
5
6 class RingMulticastHashObject{
7  public:
8     CkVec<CkArrayIndexMax> indices;
9     int nextPE;
10 };
11
12
13 class RingMulticastStrategy: public DirectMulticastStrategy {
14     
15     int nextPE;
16     
17     void commonRingInit();
18     int isEndOfRing(int next_pe, int src_pe);
19     RingMulticastHashObject *getHashObject(int pe, int id);
20     RingMulticastHashObject *createHashObject(int nelements, 
21                                               CkArrayIndexMax *elements);
22     void initSectionID(CkSectionID *sid);
23
24  public:
25     
26     //Group constructor
27     RingMulticastStrategy(int ndestpes, int *destpelist);
28     
29     //Array constructor
30     RingMulticastStrategy(CkArrayID dest_id);    
31     RingMulticastStrategy(CkMigrateMessage *m) {}
32     
33     //void insertMessage(CharmMessageHolder *msg);
34     void doneInserting();
35     void handleMulticastMessage(void *msg);
36     
37     void pup(PUP::er &p);    
38     void beginProcessing(int nelements);
39     
40     PUPable_decl(RingMulticastStrategy);
41 };
42 #endif
43