Removing assert statement that caused strategies only to work with 1d chare arrays.
[charm.git] / src / ck-com / BroadcastStrategy.h
index adb54b689604b909b59b94353a009c9e3f5e58d9..af8fdace97ca559f8d087251c621a6b518fa5651 100644 (file)
@@ -1,3 +1,9 @@
+/**
+   @addtogroup ComlibCharmStrategy
+   @{
+   @file
+*/
+
 #ifndef BRAODCAST_STRATEGY
 #define BRAODCAST_STRATEGY
 
 
 #include "ComlibManager.h"
 
-//Broadcast strategy for charm++ programs using the net version
-//This stategy will wonly work for groups.
-//This strategy implements a tree based broadcast
-//I will extent it for arrays later.
-//Developed by Sameer Kumar 04/10/04
+/**
+   Broadcast strategy for charm++ programs using the net version.
+   This stategy will only work for groups.
+   This strategy implements a tree based broadcast
+
+   Developed by Sameer Kumar 04/10/04
+
+   @warning This strategy works only in particular situations and is not
+   generic. Its usage is adviced against.
 
-class BroadcastStrategy : public CharmStrategy {
+*/
+
+class BroadcastStrategy : public Strategy, public CharmStrategy {
 
     int _topology;         //Topology to use Tree or Hypercube
 
-    int handlerId;          //broadcast handler id
+    //int handlerId;          //broadcast handler id
     int spanning_factor;    //the spanning factor of the tree
 
     double logp;       //ceil of log of number of processors
 
     void initHypercube();      
 
-    void handleTree(char *msg);
-    void handleHypercube(char *msg);    
+    void handleTree(void *msg);
+    void handleHypercube(void *msg);    
 
  public:
     BroadcastStrategy(int topology = USE_HYPERCUBE);
     BroadcastStrategy(CkArrayID aid, int topology = USE_HYPERCUBE);
-    BroadcastStrategy(CkMigrateMessage *){}
+    BroadcastStrategy(CkMigrateMessage *m): Strategy(m), CharmStrategy(m) {}
+    void insertMessage(MessageHolder *msg) {insertMessage((CharmMessageHolder*)msg);};
     void insertMessage(CharmMessageHolder *msg);
-    void doneInserting();
+    //void doneInserting();
 
-    void handleMessage(char *msg);
-    void beginProcessing(int nelements);
+    void handleMessage(void *msg);
+    //void beginProcessing(int nelements);
 
     virtual void pup(PUP::er &p);
     PUPable_decl(BroadcastStrategy);
 };
 #endif
+
+/*@}*/