Added doxygen documentation.
[charm.git] / src / ck-com / RingMulticastStrategy.h
1 #ifndef RING_MULTICAST_STRATEGY
2 #define RING_MULTICAST_STRATEGY
3
4 #include "DirectMulticastStrategy.h"
5
6 /**
7  * Multicast Strategy that sends a multicast in a ring: the source processor
8  * send a message only to its following neighbour, which propagates it forward
9  * to its neighbour, and so on. Only the processors involved in the multicast
10  * are part of the ring.
11  */
12 class RingMulticastStrategy: public DirectMulticastStrategy {
13     
14  protected:
15     
16     int isEndOfRing(int next_pe, int src_pe);
17     
18     //Defining the two entries of the section multicast interface
19     virtual ComlibSectionHashObject *createObjectOnSrcPe(int nelements, 
20                                                          CkArrayIndexMax *elements);
21
22     virtual ComlibSectionHashObject *createObjectOnIntermediatePe(int nelements,
23                                                                   CkArrayIndexMax *elements,
24                                                                   int npes,
25                                                                   ComlibMulticastIndexCount *counts,
26                                                                   int src_pe);
27     
28  public:
29     
30     //Array constructor
31     RingMulticastStrategy(CkArrayID dest_id, int flag = 0);    
32     RingMulticastStrategy(CkMigrateMessage *m) : DirectMulticastStrategy(m){}
33
34     //Destructor
35     ~RingMulticastStrategy() {}
36     
37     void pup(PUP::er &p);    
38     void beginProcessing(int nelements);
39     
40     PUPable_decl(RingMulticastStrategy);
41 };
42
43 #endif
44