use CmiSyncBroadcastAllAndFree
authorGengbin Zheng <gzheng@illinois.edu>
Wed, 18 Jan 2012 04:03:10 +0000 (20:03 -0800)
committerGengbin Zheng <gzheng@illinois.edu>
Wed, 18 Jan 2012 04:03:10 +0000 (20:03 -0800)
tests/converse/commbench/broadcast.c

index 3baf82874815a9e841f27fbf77cf485aa60db446..876121a0823707780675ae8fff8bf986f05cec9c 100644 (file)
@@ -86,8 +86,7 @@ static void bcast_handler(void *msg)
   CpvAccess(numiter)++;
   if(CpvAccess(numiter)<sizes[idx].numiter) {
     if(CmiMyPe() == 0) {
-      CmiSyncBroadcastAll(CmiMsgHeaderSizeBytes+sizes[idx].size, msg);
-      CmiFree(msg);
+      CmiSyncBroadcastAllAndFree(CmiMsgHeaderSizeBytes+sizes[idx].size, msg);
     }else
         CmiFree(msg);
 
@@ -200,8 +199,7 @@ static void bcast_central(void *msg)
       CpvAccess(currentPe) = 0;
       CmiSetHandler(msg, CpvAccess(bcast_reply));
       CpvAccess(starttime) = CmiWallTimer();
-      CmiSyncBroadcastAll(CmiMsgHeaderSizeBytes+sizes[CpvAccess(nextidx)].size, msg);
-      CmiFree(msg);
+      CmiSyncBroadcastAllAndFree(CmiMsgHeaderSizeBytes+sizes[CpvAccess(nextidx)].size, msg);
     } else {
       CpvAccess(numiter) = 0;
       CpvAccess(nextidx)++;
@@ -215,9 +213,8 @@ static void bcast_central(void *msg)
         CpvAccess(currentPe) = 0;
         CmiSetHandler(msg, CpvAccess(bcast_reply));
         CpvAccess(starttime) = CmiWallTimer();
-        CmiSyncBroadcastAll(CmiMsgHeaderSizeBytes+sizes[CpvAccess(nextidx)].size, 
+        CmiSyncBroadcastAllAndFree(CmiMsgHeaderSizeBytes+sizes[CpvAccess(nextidx)].size, 
                             msg);
-        CmiFree(msg);
       }
     }
   }