Adding fix for AMPI broadcast strategy.
authorSameer Kumar <skumar2@uiuc.edu>
Thu, 24 Feb 2005 00:27:13 +0000 (00:27 +0000)
committerSameer Kumar <skumar2@uiuc.edu>
Thu, 24 Feb 2005 00:27:13 +0000 (00:27 +0000)
src/ck-com/ComlibManager.C
src/ck-com/DirectMulticastStrategy.C
src/ck-com/EachToManyMulticastStrategy.C
src/ck-com/RingMulticastStrategy.C

index 956294b1ff38fe6ccb236632dd05d0bf0fe718dc..eff6bfc79aaf63cac3f14e5c6714921cb1dca9bc 100644 (file)
@@ -576,14 +576,16 @@ void ComlibManager::ArrayBroadcast(CkDelegateData *pd,int ep,void *m,CkArrayID a
     ((CmiMsgHeaderExt *)env)->stratid = curStratID;
 
     CmiSetHandler(env, CkpvAccess(RecvmsgHandle));
-
-    CkSectionInfo minfo;
-    minfo.type = COMLIB_MULTICAST_MESSAGE;
-    minfo.sInfo.cInfo.instId = curStratID;
-    minfo.sInfo.cInfo.status = COMLIB_MULTICAST_ALL;  
-    minfo.sInfo.cInfo.id = 0; 
-    minfo.pe = CkMyPe();
-    ((CkMcastBaseMsg *)m)->_cookie = minfo;       
+    
+    /*  //section multicast header not needed for broadcast
+      CkSectionInfo minfo;
+      minfo.type = COMLIB_MULTICAST_MESSAGE;
+      minfo.sInfo.cInfo.instId = curStratID;
+      minfo.sInfo.cInfo.status = COMLIB_MULTICAST_ALL;  
+      minfo.sInfo.cInfo.id = 0; 
+      minfo.pe = CkMyPe();
+      ((CkMcastBaseMsg *)m)->_cookie = minfo;       
+    */
 
     //RECORD_SENDM_STATS(curStratID, env->getTotalsize(), dest_proc);
 
index c3cc4b380f9a906b35da3655cc47be153c9140e7..efae04e7113d316affdb989f6893de9645e7a5cd 100644 (file)
@@ -91,6 +91,17 @@ void DirectMulticastStrategy::insertMessage(CharmMessageHolder *cmsg){
     ComlibPrintf("[%d] Comlib Direct Multicast: insertMessage \n", 
                  CkMyPe());   
    
+    if(cmsg->dest_proc == IS_BROADCAST) {
+        void *m = cmsg->getCharmMessage();
+        CkSectionInfo minfo;
+        minfo.type = COMLIB_MULTICAST_MESSAGE;
+        minfo.sInfo.cInfo.instId = getInstance();
+        minfo.sInfo.cInfo.status = COMLIB_MULTICAST_ALL;  
+        minfo.sInfo.cInfo.id = 0; 
+        minfo.pe = CkMyPe();
+        ((CkMcastBaseMsg *)m)->_cookie = minfo;       
+    }
+
     if(cmsg->dest_proc == IS_SECTION_MULTICAST && cmsg->sec_id != NULL) { 
         int cur_sec_id = ComlibSectionInfo::getSectionID(*cmsg->sec_id);
 
index 4bd19c9fd4169a78d190beb684575633dc34db7f..3f0917dbf48326e7806ab789c5a30adc49f5202e 100644 (file)
@@ -179,6 +179,16 @@ void EachToManyMulticastStrategy::insertMessage(CharmMessageHolder *cmsg){
     if(cmsg->dest_proc == IS_BROADCAST) {
         cmsg->npes = ndestpes;
         cmsg->pelist = destpelist;
+
+        //Added write now as a move from ComlibManager::ArrayBroadcast
+        void *m = cmsg->getCharmMessage();
+        CkSectionInfo minfo;
+        minfo.type = COMLIB_MULTICAST_MESSAGE;
+        minfo.sInfo.cInfo.instId = getInstance();
+        minfo.sInfo.cInfo.status = COMLIB_MULTICAST_ALL;  
+        minfo.sInfo.cInfo.id = 0; 
+        minfo.pe = CkMyPe();
+        ((CkMcastBaseMsg *)m)->_cookie = minfo;       
     }
 
     //For section multicasts and broadcasts
index 9ea046aaef3021f6a5a06c95c58493ac959c2396..44835bbcbc5bb9ed536c13c31fea61af70561b94 100644 (file)
@@ -32,6 +32,17 @@ void RingMulticastStrategy::insertMessage(CharmMessageHolder *cmsg){
     ComlibPrintf("[%d] Comlib Direct Multicast: insertMessage \n", 
                  CkMyPe());   
     
+    if(cmsg->dest_proc == IS_BROADCAST) {
+        void *m = cmsg->getCharmMessage();
+        CkSectionInfo minfo;
+        minfo.type = COMLIB_MULTICAST_MESSAGE;
+        minfo.sInfo.cInfo.instId = getInstance();
+        minfo.sInfo.cInfo.status = COMLIB_MULTICAST_ALL;  
+        minfo.sInfo.cInfo.id = 0; 
+        minfo.pe = CkMyPe();
+        ((CkMcastBaseMsg *)m)->_cookie = minfo;       
+    }
+
     if(cmsg->dest_proc == IS_SECTION_MULTICAST && cmsg->sec_id != NULL) { 
         int cur_sec_id = ComlibSectionInfo::getSectionID(*cmsg->sec_id);