00001
00010 #ifndef MULTICAST_STRATEGY
00011 #define MULTICAST_STRATEGY
00012
00013 #include "ComlibManager.h"
00014 #include "ComlibSectionInfo.h"
00015
00027 class MulticastStrategy: public Strategy, public CharmStrategy {
00028 protected:
00030 ComlibSectionInfo sinfo;
00031
00035 CkHashtableT<ComlibSectionHashKey, ComlibSectionHashObject *> sec_ht;
00036
00039 ComlibSectionHashObject * insertSectionID(CkSectionID *sid, int npes, ComlibMulticastIndexCount *pelist);
00040
00044 virtual void createObjectOnSrcPe(ComlibSectionHashObject *obj, int npes, ComlibMulticastIndexCount *pelist)=0;
00045
00059 virtual void createObjectOnIntermediatePe(ComlibSectionHashObject *obj, int npes, ComlibMulticastIndexCount *counts, int srcpe)=0;
00060
00063 virtual int needSorting() { return 0; }
00064
00066 virtual void localMulticast(envelope *env, ComlibSectionHashObject *obj, CkMcastBaseMsg *msg);
00067
00070 virtual void remoteMulticast(envelope *env, ComlibSectionHashObject *obj);
00071
00077 void handleNewMulticastMessage(envelope *env);
00078
00079 public:
00080
00081 MulticastStrategy(CkMigrateMessage *m): Strategy(m), CharmStrategy(m){}
00082
00084 MulticastStrategy();
00085
00086
00087 ~MulticastStrategy();
00088
00089 void insertMessage(MessageHolder *msg) {insertMessage((CharmMessageHolder*)msg);}
00090 void insertMessage(CharmMessageHolder *msg);
00091
00092
00093
00095 void handleMessage(void *msg);
00096
00097 virtual void pup(PUP::er &p);
00098
00099 PUPable_abstract(MulticastStrategy);
00100 };
00101 #endif
00102