fix code organization
authorbdemsky <bdemsky>
Mon, 15 Feb 2010 08:07:35 +0000 (08:07 +0000)
committerbdemsky <bdemsky>
Mon, 15 Feb 2010 08:07:35 +0000 (08:07 +0000)
Robust/src/Runtime/DSTM/interface/addUdpEnhance.c
Robust/src/Runtime/DSTM/interface/trans.c

index 71bc6baf19c8632590f9ca43849ca866b7a600ab..eb968c92835de63fe88e1abdcab1ed87ff8f7e8d 100644 (file)
@@ -131,11 +131,6 @@ int invalidateObj(trans_req_data_t *tdata, int pilecount, char finalresponse, in
     printf("%s() error in sending udp message at %s, %d\n", __func__, __FILE__, __LINE__);
     return -1;
   }
-  /* Send trans commit or abort message when prefetching or caching */
-  for(i=0;i<pilecount;i++){
-    if(socklist[i] !=0)
-      send_data(socklist[i], &finalresponse, sizeof(char));
-  }
   return 0;
 }
 
index eaf70309f6788047b22ec76e2e08a4aeb4affa53..9c2e4ffefb159bfadf4546941302b5c16a4114f9 100644 (file)
@@ -1134,6 +1134,18 @@ int transCommit() {
       return 1;
     }
 
+#ifdef CACHE
+    if (finalResponse == TRANS_COMMIT) {
+      /* Invalidate objects in other machine cache */
+      int retval;
+      if((retval = invalidateObj(tosend, pilecount,finalResponse,socklist)) != 0) {
+       printf("Error: %s() in invalidating Objects %s, %d\n", __func__, __FILE__, __LINE__);
+       free(tosend);
+       free(listmid);
+       return 1;
+      }
+    }
+#endif
     /* Send responses to all machines */
     for(i = 0; i < pilecount; i++) {
       int sd = socklist[i];
@@ -1160,9 +1172,7 @@ int transCommit() {
        }
 #endif
 #endif
-#ifndef CACHE
-    send_data(sd, &finalResponse, sizeof(char));
-#endif
+       send_data(sd, &finalResponse, sizeof(char));
       } else {
        /* Complete local processing */
        doLocalProcess(finalResponse, &(tosend[i]), &transinfo);
@@ -1178,18 +1188,6 @@ int transCommit() {
       }
     }
 
-#ifdef CACHE
-    {
-      /* Invalidate objects in other machine cache */
-      int retval;
-      if((retval = invalidateObj(tosend, pilecount,finalResponse,socklist)) != 0) {
-       printf("Error: %s() in invalidating Objects %s, %d\n", __func__, __FILE__, __LINE__);
-       free(tosend);
-       free(listmid);
-       return 1;
-      }
-    }
-#endif
     /* Free resources */
     free(tosend);
     free(listmid);