eeda41b1f0e92c9367fd6221c0f121f27f49fb5b
[charm.git] / src / ck-com / BroadcastStrategy.h
1 #ifndef BRAODCAST_STRATEGY
2 #define BRAODCAST_STRATEGY
3
4 #define DEFAULT_BROADCAST_SPANNING_FACTOR 4
5
6 #include "ComlibManager.h"
7
8 //Broadcast strategy for charm++ programs using the net version
9 //This stategy will wonly work for groups.
10 //This strategy implements a tree based broadcast
11 //I will extent it for arrays later.
12 //Developed by Sameer Kumar 04/10/04
13
14 class BroadcastStrategy : public CharmStrategy {
15
16     int handlerId;
17     int spanning_factor;
18     int _topology;
19
20     void handleTree(char *msg);
21     void handleHypercube(char *msg);
22
23  public:
24     BroadcastStrategy(int topology = USE_HYPERCUBE);
25     BroadcastStrategy(CkMigrateMessage *){}
26     void insertMessage(CharmMessageHolder *msg);
27     void doneInserting();
28
29     void handleMessage(char *msg);
30     void beginProcessing(int nelements);
31
32     virtual void pup(PUP::er &p);
33     PUPable_decl(BroadcastStrategy);
34 };
35 #endif