only when print_stat is used, output counters
authorYanhua Sun <yanhuas@jyc1.(none)>
Mon, 19 Mar 2012 04:09:15 +0000 (23:09 -0500)
committerYanhua Sun <yanhuas@jyc1.(none)>
Mon, 19 Mar 2012 04:09:15 +0000 (23:09 -0500)
src/arch/gemini_gni/machine.c

index b45fb6c8e4a3f37b0b01ba37c56a2d65f54ff9ba..713711898f7d51ffa8ba30fb642f89ac91bd2c5e 100644 (file)
@@ -771,10 +771,10 @@ static void init_comm_stats()
   memset(&comm_stats, 0, sizeof(Comm_Thread_Stats));
 }
 
-#define SMSG_CREATION( x )  x->creation_time = CmiWallTimer();
+#define SMSG_CREATION( x ) if(print_stats) { x->creation_time = CmiWallTimer(); }
 
 #define SMSG_SENT_DONE(creation_time, tag)  \
-        {   if( tag == SMALL_DATA_TAG) comm_stats.smsg_data_count++;  \
+        if (print_stats) {   if( tag == SMALL_DATA_TAG) comm_stats.smsg_data_count++;  \
             else  if( tag == LMSG_INIT_TAG) comm_stats.lmsg_init_count++;  \
             else  if( tag == ACK_TAG) comm_stats.ack_count++;  \
             else  if( tag == BIG_MSG_TAG) comm_stats.big_msg_ack_count++;  \
@@ -785,23 +785,23 @@ static void init_comm_stats()
         }
 
 #define SMSG_TRY_SEND(tag)  \
-        {   if( tag == SMALL_DATA_TAG) comm_stats.try_smsg_data_count++;  \
+        if (print_stats){   if( tag == SMALL_DATA_TAG) comm_stats.try_smsg_data_count++;  \
             else  if( tag == LMSG_INIT_TAG) comm_stats.try_lmsg_init_count++;  \
             else  if( tag == ACK_TAG) comm_stats.try_ack_count++;  \
             else  if( tag == BIG_MSG_TAG) comm_stats.try_big_msg_ack_count++;  \
             comm_stats.try_smsg_count++; \
         }
 
-#define  RDMA_TRY_SEND()        comm_stats.try_rdma_count++;
+#define  RDMA_TRY_SEND()        if (print_stats) {comm_stats.try_rdma_count++;}
 
 #define  RDMA_TRANS_DONE(x)      \
-         {  double rdma_trans_time = CmiWallTimer() - x ; \
+         if (print_stats) {  double rdma_trans_time = CmiWallTimer() - x ; \
              if(rdma_trans_time > comm_stats.max_time_from_rdma_init_to_rdma_done) comm_stats.max_time_from_rdma_init_to_rdma_done = rdma_trans_time; \
              comm_stats.all_time_from_rdma_init_to_rdma_done += rdma_trans_time; \
          }
 
 #define  RDMA_TRANS_INIT(x)      \
-         {   comm_stats.rdma_count++;  \
+         if (print_stats) {   comm_stats.rdma_count++;  \
              double rdma_trans_time = CmiWallTimer() - x ; \
              if(rdma_trans_time > comm_stats.max_time_from_control_to_rdma_init) comm_stats.max_time_from_control_to_rdma_init = rdma_trans_time; \
              comm_stats.all_time_from_control_to_rdma_init += rdma_trans_time; \
@@ -3582,10 +3582,12 @@ void LrtsInit(int *argc, char ***argv, int *numNodes, int *myNodeID)
 #endif
 
 #if CMK_WITH_STATS
-    char ln[200];
-    int code = mkdir("counters", 00777); 
-    sprintf(ln,"counters/statistics.%d",myrank);
-    counterLog=fopen(ln,"w");
+    if (print_stats){
+        char ln[200];
+        int code = mkdir("counters", 00777); 
+        sprintf(ln,"counters/statistics.%d.%d", mysize, myrank);
+        counterLog=fopen(ln,"w");
+    }
 #endif
 //    NTK_Init();
 //    ntk_return_t sts = NTK_System_GetSmpdCount(&_smpd_count);