put projector code under macro CMK_PROJECTOR
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 25 Jul 2011 03:49:59 +0000 (22:49 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 25 Jul 2011 03:49:59 +0000 (22:49 -0500)
src/libs/ck-libs/ampi/ampi.C

index 391ad922bf3757f6e55c8b6ae0c967b58c1bf034..f94db1f9c2b79f7c819bcdcb6d5b10bef7641d90 100644 (file)
@@ -4,8 +4,10 @@
 #define exit exit /*Supress definition of exit in ampi.h*/
 #include "ampiimpl.h"
 #include "tcharm.h"
 #define exit exit /*Supress definition of exit in ampi.h*/
 #include "ampiimpl.h"
 #include "tcharm.h"
+#if CMK_TRACE_ENABLED && CMK_PROJECTOR
 #include "ampiEvents.h" /*** for trace generation for projector *****/
 #include "ampiProjections.h"
 #include "ampiEvents.h" /*** for trace generation for projector *****/
 #include "ampiProjections.h"
+#endif
 
 #if CMK_BLUEGENE_CHARM
 #include "bigsim_logs.h"
 
 #if CMK_BLUEGENE_CHARM
 #include "bigsim_logs.h"
@@ -580,8 +582,11 @@ static void ampiProcInit(void){
   CkpvInitialize(int, argvExtracted);
   CkpvAccess(argvExtracted) = 0;
 
   CkpvInitialize(int, argvExtracted);
   CkpvAccess(argvExtracted) = 0;
 
+#if CMK_TRACE_ENABLED && CMK_PROJECTOR
   REGISTER_AMPI
   REGISTER_AMPI
-    initAmpiProjections();
+#endif
+  initAmpiProjections();
+
   char **argv=CkGetArgv();
 #if AMPI_COMLIB  
   if(CkpvAccess(argvExtracted)==0){
   char **argv=CkGetArgv();
 #if AMPI_COMLIB  
   if(CkpvAccess(argvExtracted)==0){
@@ -2035,9 +2040,11 @@ ampi::recv(int t, int s, void* buf, int count, int type, int comm, int *sts)
     ((MPI_Status *)sts)->MPI_LENGTH = 0;
     return 0;
   }
     ((MPI_Status *)sts)->MPI_LENGTH = 0;
     return 0;
   }
+#if CMK_TRACE_ENABLED && CMK_PROJECTOR
   _LOG_E_END_AMPI_PROCESSING(thisIndex)
   _LOG_E_END_AMPI_PROCESSING(thisIndex)
+#endif
 #if CMK_BLUEGENE_CHARM
 #if CMK_BLUEGENE_CHARM
-    void *curLog;              // store current log in timeline
+   void *curLog;               // store current log in timeline
   _TRACE_BG_TLINE_END(&curLog);
   //  TRACE_BG_AMPI_SUSPEND();
 #if CMK_TRACE_IN_CHARM
   _TRACE_BG_TLINE_END(&curLog);
   //  TRACE_BG_AMPI_SUSPEND();
 #if CMK_TRACE_IN_CHARM
@@ -2087,7 +2094,9 @@ ampi::recv(int t, int s, void* buf, int count, int type, int comm, int *sts)
   int status = dis->processMessage(msg, t, s, buf, count, type);
   if (status != 0) return status;
 
   int status = dis->processMessage(msg, t, s, buf, count, type);
   if (status != 0) return status;
 
+#if CMK_TRACE_ENABLED && CMK_PROJECTOR
   _LOG_E_BEGIN_AMPI_PROCESSING(thisIndex,s,count)
   _LOG_E_BEGIN_AMPI_PROCESSING(thisIndex,s,count)
+#endif
 
 #if CMK_BLUEGENE_CHARM
 #if CMK_TRACE_IN_CHARM
 
 #if CMK_BLUEGENE_CHARM
 #if CMK_TRACE_IN_CHARM