Forwarding all messages to the forked child. This allows the child to see all incomin...
authorFilippo Gioachin <gioachin@uiuc.edu>
Tue, 6 Jul 2010 03:48:55 +0000 (22:48 -0500)
committerFilippo Gioachin <gioachin@uiuc.edu>
Tue, 6 Jul 2010 03:48:55 +0000 (22:48 -0500)
src/conv-ccs/conv-ccs.c
src/conv-core/debug-conv.c

index 03e6c6d76877352a7f64a33168383e68de5b93c7..63348884e87ea384f8a915dc93ce3d6c21157fe0 100644 (file)
@@ -238,10 +238,8 @@ void CcsHandleRequest(CcsImplHeader *hdr,const char *reqData)
   CpvAccess(ccsReq)=hdr;
 #if CMK_CHARMDEBUG
   if (conditionalPipe[1]!=0 && _conditionalDelivery==0) {
   CpvAccess(ccsReq)=hdr;
 #if CMK_CHARMDEBUG
   if (conditionalPipe[1]!=0 && _conditionalDelivery==0) {
-    /* We are conditionally delivering, send the message to the child and wait for its response */
-    int bytes = reqLen+((int)(reqData-((char*)hdr)))+CmiReservedHeaderSize;
-    write(conditionalPipe[1], &bytes, 4);
-    write(conditionalPipe[1], ((char*)hdr)-CmiReservedHeaderSize, bytes);
+    /* We are conditionally delivering, the message has been sent to the child, wait for its response */
+    int bytes;
     if (4==read(conditionalPipe[0], &bytes, 4)) {
       char *buf = malloc(bytes);
       read(conditionalPipe[0], buf, bytes);
     if (4==read(conditionalPipe[0], &bytes, 4)) {
       char *buf = malloc(bytes);
       read(conditionalPipe[0], buf, bytes);
index f8a9a3b782e64c99add1834016ed22eb19471c15..44b710c75ae295534c88b9dc317ff7613b70e15a 100644 (file)
@@ -287,7 +287,12 @@ void CpdFreezeModeScheduler(void)
            / * Debug messages should be handled immediately * /
            CmiHandleMessage(msg);
          } else */
            / * Debug messages should be handled immediately * /
            CmiHandleMessage(msg);
          } else */
-        
+      if (conditionalPipe[1]!=0 && _conditionalDelivery==0) {
+        // Since we are conditionally delivering, forward all messages to the child
+        int bytes = SIZEFIELD(msg); // reqLen+((int)(reqData-((char*)hdr)))+CmiReservedHeaderSize;
+        write(conditionalPipe[1], &bytes, 4);
+        write(conditionalPipe[1], msg, bytes);
+      }
       if (CpdIsDebugMessage(msg)) {
         CmiHandleMessage(msg);
          }
       if (CpdIsDebugMessage(msg)) {
         CmiHandleMessage(msg);
          }