review the code for generating dependencies for MPI collectives.
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 7 Apr 2011 16:32:30 +0000 (11:32 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 7 Apr 2011 16:32:30 +0000 (11:32 -0500)
various minor changes. added mpiOp for MPI_Alltoall.

src/langs/bluegene/bigsim_logs.C
src/langs/bluegene/bigsim_logs.h
src/libs/ck-libs/ampi/ampi.C
src/libs/ck-libs/tcharm/tcharm_impl.h

index aa816175b3a329dcb50a60754b9f5fed99641039..5ca3ce0d0b134066dfc73a32d3db64d499fdda0f 100644 (file)
@@ -316,6 +316,17 @@ void BgTimeLog::write(FILE *fp)
     if (!objId.isNull())
       fprintf(fp," ObjID: %d %d %d %d\n", objId.id[0], objId.id[1], objId.id[2], objId.id[3]);
   }
+  if (bglog_version >= 6) {
+    if (mpiOp!=MPI_NONE) {
+      fprintf(fp, "MPI collective: ");
+      switch (mpiOp) {
+      case MPI_BARRIER:   fprintf(fp, "MPI Barrier"); break;
+      case MPI_ALLREDUCE: fprintf(fp, "MPI_Allreduce"); break;
+      case MPI_ALLTOALL:  fprintf(fp, "MPI_Alltoall"); break;
+      }
+      fprintf(fp, " mpiSize: %d\n", mpiSize);
+    }
+  }
   for (i=0; i<msgs.length(); i++)
     msgs[i]->write(fp);
   for (i=0; i<evts.length(); i++)
index 1a07e35a0c7466b30b180d772c1a764bd87cdc52..467deccbc96b187bf198bc32c1208dea16fd61e3 100644 (file)
@@ -111,7 +111,7 @@ extern void BgDelaySend(BgMsgEntry *msgEntry);
 
 class BgTimeLineRec;
 
-enum BgMPIOp { MPI_NONE = 0, MPI_BARRIER = 1, MPI_ALLREDUCE = 2 };
+enum BgMPIOp { MPI_NONE = 0, MPI_BARRIER = 1, MPI_ALLREDUCE = 2 , MPI_ALLTOALL = 3};
 
 #define BGLOG_NAMELEN   20
 
index 474bb203b5c4bdae2cb600060f622938214ac421..a32a432992de370f57d7f1d60ceb016aad97450a 100644 (file)
@@ -7,6 +7,10 @@
 #include "ampiEvents.h" /*** for trace generation for projector *****/
 #include "ampiProjections.h"
 
+#if CMK_BLUEGENE_CHARM
+#include "bigsim_logs.h"
+#endif
+
 #define CART_TOPOL 1
 #define AMPI_PRINT_IDLE 0
 
@@ -2716,7 +2720,7 @@ int AMPI_Barrier(MPI_Comm comm)
 
   if(getAmpiParent()->isInter(comm)) CkAbort("MPI_Barrier not allowed for Inter-communicator!");
 
-  TRACE_BG_AMPI_LOG(1, 0);
+  TRACE_BG_AMPI_LOG(MPI_BARRIER, 0);
 
   //HACK: Use collective operation as a barrier.
   AMPI_Allreduce(NULL,NULL,0,MPI_INT,MPI_SUM,comm);
@@ -2874,7 +2878,9 @@ int AMPI_Allreduce(void *inbuf, void *outbuf, int count, int type,
   
   CkDDT_DataType *ddt_type = ptr->getDDT()->getType(type);
 
-  TRACE_BG_AMPI_LOG(2, count * ddt_type->getSize());
+#if CMK_BLUEGENE_CHARM
+  TRACE_BG_AMPI_LOG(MPI_ALLREDUCE, ddt_type->getSize(count));
+#endif
 
   if(comm==MPI_COMM_SELF) return copyDatatype(comm,type,count,inbuf,outbuf);
 
@@ -4362,6 +4368,11 @@ int AMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   int comm_size = size;
   MPI_Status status;
 
+#if CMK_BLUEGENE_CHARM
+  TRACE_BG_AMPI_LOG(MPI_ALLTOALL, itemsize);
+#endif
+
+
   if( itemsize <= AMPI_ALLTOALL_SHORT_MSG ){
     /* Short message. Use recursive doubling. Each process sends all
        its data at each step along with all data it received in
index 6d299b4cfb5abc9980030a5db407853b83c95613..2a51d1440e885140b2bb53856109096c2c1909c3 100644 (file)
@@ -280,23 +280,23 @@ void TCHARM_Api_trace(const char *routineName, const char *libraryName);
 class TCharmAPIRoutine {
        int state; //stores if the isomallocblockactivate and ctginstall need to be skipped during activation
        CtgGlobals oldGlobals;  // this is actually a pointer
-       #ifdef CMK_BLUEGENE_CHARM
+#ifdef CMK_BLUEGENE_CHARM
        void *callEvent; // The BigSim-level event that called into the library
         int pe;          // in case thread migrates
-       #endif
+#endif
 
  public:
        // Entering Charm++ from user code
        TCharmAPIRoutine(const char *routineName, const char *libraryName)
        {
-               #ifdef CMK_BLUEGENE_CHARM
+#ifdef CMK_BLUEGENE_CHARM
                // Start a new event, so we can distinguish between client 
                // execution and library execution
                _TRACE_BG_TLINE_END(&callEvent);
                _TRACE_BG_END_EXECUTE(0);
-               _TRACE_BG_BEGIN_EXECUTE_NOMSG(routineName, &callEvent, 0);
                pe = CmiMyPe();
-               #endif
+               _TRACE_BG_BEGIN_EXECUTE_NOMSG(routineName, &callEvent, 0);
+#endif
 
                state = 0;
                //TCharm *tc=CtvAccess(_curTCharm);
@@ -342,13 +342,13 @@ class TCharmAPIRoutine {
                        }
                }
 
-               #ifdef CMK_BLUEGENE_CHARM
+#ifdef CMK_BLUEGENE_CHARM
                void *log;
                _TRACE_BG_TLINE_END(&log);
                _TRACE_BG_END_EXECUTE(0);
                _TRACE_BG_BEGIN_EXECUTE_NOMSG("user_code", &log, 0);
                if (CmiMyPe() == pe) _TRACE_BG_ADD_BACKWARD_DEP(callEvent);
-               #endif
+#endif
        }
 };