fix persistent comm thread tracing
authorYanhua Sun <yanhuas@jyc1.(none)>
Sun, 1 Apr 2012 05:08:45 +0000 (00:08 -0500)
committerYanhua Sun <yanhuas@jyc1.(none)>
Sun, 1 Apr 2012 05:08:45 +0000 (00:08 -0500)
src/arch/gemini_gni/machine-persistent.c
src/arch/gemini_gni/machine.c

index 5b36524f35b4f178ad6f9b67d20ddc4e08e42404..23dd94c1b0f8a3a7ffae78c81e7d43db67c9f1b3 100644 (file)
@@ -38,7 +38,6 @@ void LrtsSendPersistentMsg(PersistentHandle h, int destNode, int size, void *m)
         // CmiPrintf("[%d] LrtsSendPersistentMsg h=%p hdl=%d destNode=%d destAddress=%p size=%d\n", CmiMyPe(), h, CmiGetHandler(m), destNode, slot->destBuf[0].destAddress, size);
 
         // uGNI part
-        START_EVENT();
         MallocPostDesc(pd);
         if(size <= LRTS_GNI_RDMA_THRESHOLD) {
             pd->type            = GNI_POST_FMA_PUT;
@@ -64,7 +63,7 @@ void LrtsSendPersistentMsg(PersistentHandle h, int destNode, int size, void *m)
 #endif
         SetMemHndlZero(pd->local_mem_hndl);
 
-        TRACE_COMM_CREATION(CpvAccess(projTraceStart), (void*)pd->local_addr);
+        //TRACE_COMM_CREATION(CpvAccess(projTraceStart), (void*)pd->local_addr);
          /* always buffer */
 #if CMK_SMP || 1
 #if REMOTE_EVENT
index 0871abc9fadbd916115e9095b58c19acad83f314..7bd4ff41eb6708d14aed3ffc9a75b2ac5c7983c8 100644 (file)
@@ -792,6 +792,7 @@ static int stats_off = 0;
 void CmiTurnOnStats()
 {
     stats_off = 0;
+    //CmiPrintf("[%d][%d:%d]+++++++++++ turning on stats \n", CmiMyNode(), CmiMyPe(), CmiMyRank());
 }
 
 void CmiTurnOffStats()
@@ -2973,6 +2974,17 @@ static void  SendRdmaMsg()
 #if CMK_WITH_STATS
             RDMA_TRY_SEND(pd->type)
 #endif
+#if CMK_SMP_TRACE_COMMTHREAD
+            int oldpe = -1;
+            int oldeventid = -1;
+            START_EVENT();
+            if(pd->type == GNI_POST_RDMA_PUT || pd->type == GNI_POST_FMA_PUT)
+            { 
+                TRACE_COMM_GET_MSGID((void*)pd->local_addr, &oldpe, &oldeventid);
+                TRACE_COMM_SET_COMM_MSGID((void*)pd->local_addr);
+            }
+#endif
+
             if(pd->type == GNI_POST_RDMA_GET || pd->type == GNI_POST_RDMA_PUT) 
             {
                 status = GNI_PostRdma(ep_hndl_array[ptr->destNode], pd);
@@ -2983,6 +2995,12 @@ static void  SendRdmaMsg()
             }
             CMI_GNI_UNLOCK(lock);
             
+#if CMK_SMP_TRACE_COMMTHREAD
+            if(pd->type == GNI_POST_RDMA_PUT || pd->type == GNI_POST_FMA_PUT)
+            { 
+                if (oldpe != -1)  TRACE_COMM_SET_MSGID((void*)pd->local_addr, oldpe, oldeventid);
+            }
+#endif
             if(status == GNI_RC_SUCCESS)    //post good
             {
 #if CMI_EXERT_RDMA_CAP
@@ -3003,6 +3021,10 @@ static void  SendRdmaMsg()
                 {
 #if CMK_SMP_TRACE_COMMTHREAD 
                     pd->sync_flag_value = 1000000 * CmiWallTimer(); //microsecond
+                    if(pd->type == GNI_POST_RDMA_PUT || pd->type == GNI_POST_FMA_PUT)
+                    { 
+                        TRACE_COMM_CREATION(CpvAccess(projTraceStart), (void*)pd->local_addr);
+                    }
 #endif
                     IncreaseMsgInRecv(((void*)(pd->local_addr)));
                 }