Merge branch 'charm' of charmgit:charm into charm
[charm.git] / src / arch / gemini_gni / machine.c
index c143290541650da2658a6dbfda5122607a9f58ec..6a83c15fdc541a6e1a1c6f839a42210c78862e26 100644 (file)
@@ -1200,18 +1200,34 @@ static gni_return_t send_smsg_message(SMSG_QUEUE *queue, int destNode, void *msg
         }
 #endif
         CMI_GNI_LOCK
+<<<<<<< HEAD
+#if CMK_SMP_TRACE_COMMTHREAD
+        int oldpe = -1;
+        int oldeventid = -1;
+        if(tag == SMALL_DATA_TAG || tag == LMSG_INIT_TAG)
+        { 
+            START_EVENT();
+            if ( tag == SMALL_DATA_TAG)
+                real_data = (char*)msg; 
+            else 
+                real_data = (char*)(((CONTROL_MSG*)msg)->source_addr);
+            TRACE_COMM_GET_MSGID(real_data, &oldpe, &oldeventid);
+            TRACE_COMM_SET_COMM_MSGID(real_data);
+        }
+#endif
+        status = GNI_SmsgSendWTag(ep_hndl_array[destNode], 0, 0, msg, size, 0, tag);
+#if CMK_SMP_TRACE_COMMTHREAD
+        if (oldpe != -1)  TRACE_COMM_SET_MSGID(real_data, oldpe, oldeventid);
+#endif
+=======
         status = GNI_SmsgSendWTag(ep_hndl_array[destNode], buf, bufsize, msg, size, 0, tag);
+>>>>>>> 6bc5ef7da3aa42d00053cc7680a14257efe4ee42
         CMI_GNI_UNLOCK
         if(status == GNI_RC_SUCCESS)
         {
 #if CMK_SMP_TRACE_COMMTHREAD
             if(tag == SMALL_DATA_TAG || tag == LMSG_INIT_TAG || tag == SMALL_DATA_ACK_TAG)
             { 
-                START_EVENT();
-                if ( tag == SMALL_DATA_TAG)
-                    real_data = (char*)msg; 
-                else 
-                    real_data = (char*)(((CONTROL_MSG*)msg)->source_addr);
                 TRACE_COMM_CREATION(CpvAccess(projTraceStart), real_data);
             }
 #endif
@@ -1725,7 +1741,7 @@ static void PumpNetworkSmsg()
                 msg_data    = CmiAlloc(msg_nbytes);
                 memcpy(msg_data, (char*)header, msg_nbytes);
 #if CMK_SMP_TRACE_COMMTHREAD
-                TRACE_COMM_RECV(CpvAccess(projTraceStart), msg_data);
+                TRACE_COMM_CREATION(CpvAccess(projTraceStart), msg_data);
 #endif
                 handleOneRecvedMsg(msg_nbytes, msg_data);
                 break;
@@ -2126,9 +2142,7 @@ static void PumpLocalRdmaTransactions()
 #if PRINT_SYH
                     printf("Normal msg transaction PE:%d==>%d\n", myrank, inst_id);
 #endif
-#if CMK_SMP_TRACE_COMMTHREAD
                     START_EVENT();
-#endif
                     CmiAssert(SIZEFIELD((void*)(tmp_pd->local_addr)) <= tmp_pd->length);
                     DecreaseMsgInRecv((void*)tmp_pd->local_addr);
 #if MACHINE_DEBUG_LOG
@@ -2137,21 +2151,19 @@ static void PumpLocalRdmaTransactions()
                     MACHSTATE5(8, "GO Recv done ack send from %d (%d,%d, %d) tag=%d\n", inst_id, buffered_send_msg, buffered_recv_msg, register_memory_size, msg_tag); 
 #endif
 #if CMK_SMP_TRACE_COMMTHREAD
-                    TRACE_COMM_RECV(CpvAccess(projTraceStart), (void*)tmp_pd->local_addr);
+                    TRACE_COMM_CREATION(CpvAccess(projTraceStart), (void*)tmp_pd->local_addr);
 #endif
                     handleOneRecvedMsg(tmp_pd->length, (void*)tmp_pd->local_addr); 
                 }else if(msg_tag == BIG_MSG_TAG){
                     void *msg = (char*)tmp_pd->local_addr-(tmp_pd->cqwrite_value-1)*ONE_SEG;
                     CmiSetMsgSeq(msg, CmiGetMsgSeq(msg)+1);
                     if (tmp_pd->first_operand <= ONE_SEG*CmiGetMsgSeq(msg)) {
-#if CMK_SMP_TRACE_COMMTHREAD
                         START_EVENT();
-#endif
 #if PRINT_SYH
                         printf("Pipeline msg done [%d]\n", myrank);
 #endif
 #if CMK_SMP_TRACE_COMMTHREAD
-                        TRACE_COMM_RECV(CpvAccess(projTraceStart), msg);
+                        TRACE_COMM_CREATION(CpvAccess(projTraceStart), msg);
 #endif
                         handleOneRecvedMsg(tmp_pd->first_operand, msg); 
                     }