Adding initial support for optimized message-logging protocol for collectives.
authorEsteban Meneses <emenese2@illinois.edu>
Fri, 5 Oct 2012 21:36:59 +0000 (16:36 -0500)
committerEsteban Meneses <emenese2@illinois.edu>
Fri, 5 Oct 2012 21:36:59 +0000 (16:36 -0500)
src/ck-core/charm.h
src/ck-core/ckcausalmlog.C
src/ck-core/envelope.h
src/libs/ck-libs/multicast/ckmulticast.C

index a16037cbbb566d8b00e2653623d8d327fac33fe4..76b4f436687d9a98518f56d220184ff337a42a3d 100644 (file)
@@ -107,6 +107,17 @@ extern int CkRegisterMsg(const char *name, CkPackFnPtr pack,
 #define CK_EP_MEMCRITICAL (1<<5)
 
 /** type of a chare */
+#if CMK_MESSAGE_LOGGING
+typedef enum{
+       TypeInvalid=0,
+       TypeChare,
+       TypeMainChare,
+       TypeGroup,
+       TypeNodeGroup,
+       TypeArray,
+       TypeSection
+} ChareType;
+#else
 typedef enum{
        TypeInvalid=0,
        TypeChare,
@@ -115,6 +126,7 @@ typedef enum{
        TypeNodeGroup,
        TypeArray
 } ChareType;
+#endif
 
 /** A "call function" to invoke a method on an object. See EntryInfo */
 typedef void  (*CkCallFnPtr) (void *msg, void *obj);
index 05c482017956ccae5f851c947195aa5668aed5e5..22cbc282a5bc39916de7a19e55dec5ec93a85626 100644 (file)
@@ -24,7 +24,7 @@
 #define COLLECT_STATS_DETS 0
 #define COLLECT_STATS_DETS_DUP 0
 #define COLLECT_STATS_MEMORY 0
-#define COLLECT_STATS_TEAM 0
+#define COLLECT_STATS_LOGGING 0
 
 #define RECOVERY_SEND "SEND"
 #define RECOVERY_PROCESS "PROCESS"
@@ -156,9 +156,10 @@ int bufferedDetsSize;
 int storedDetsSize;
 #endif
 //TML: variables for measuring savings with teams in message logging
-#if COLLECT_STATS_TEAM
+#if COLLECT_STATS_LOGGING
 float MLOGFT_totalLogSize = 0.0;
 float MLOGFT_totalMessages = 0.0;
+float MLOGFT_totalMcastLogSize = 0.0;
 #endif
 
 static double adjustChkptPeriod=0.0; //in ms
@@ -722,7 +723,7 @@ void sendMsg(CkObjID &sender,CkObjID &recver,int destPE,MlogEntry *entry,MCount
        int totalSize;
 
        envelope *env = entry->env;
-       DEBUG_PE(3,printf("[%d] Sending message to %s from %s PE %d SN %d time %.6lf \n",CkMyPe(),env->recver.toString(recverString),env->sender.toString(senderString),destPE,env->SN,CkWallTimer()));
+       DEBUG(printf("[%d] Sending message to %s from %s PE %d SN %d time %.6lf \n",CkMyPe(),env->recver.toString(recverString),env->sender.toString(senderString),destPE,env->SN,CkWallTimer()));
 
        // setting all the information
        Chare *obj = (Chare *)entry->env->sender.getObject();
@@ -733,9 +734,13 @@ void sendMsg(CkObjID &sender,CkObjID &recver,int destPE,MlogEntry *entry,MCount
                //TML: only stores message if either it goes to this processor or to a processor in a different group
                if(!isTeamLocal(entry->destPE)){
                        obj->mlogData->addLogEntry(entry);
-#if COLLECT_STATS_TEAM
+#if COLLECT_STATS_LOGGING
                        MLOGFT_totalMessages += 1.0;
                        MLOGFT_totalLogSize += entry->env->getTotalsize();
+                       if(entry->env->flags & CK_MULTICAST_MSG_MLOG){
+                               MLOGFT_totalMcastLogSize += entry->env->getTotalsize(); 
+                               CkPrintf("[%d] Adding %f to the log\n",CkMyPe(),entry->env->getTotalsize());
+                       }
 #endif
                }else{
                        // the message has to be deleted after it has been sent
@@ -3614,10 +3619,10 @@ void _messageLoggingExit(){
        if(CkMyPe() == 0)
                printf("[%d] _causalMessageLoggingExit \n",CmiMyPe());
 
-       //TML: printing some statistics for group approach
-#if COLLECT_STATS_TEAM
+#if COLLECT_STATS_LOGGING
        printf("[%d] LOGGED MESSAGES: %.0f\n",CkMyPe(),MLOGFT_totalMessages);
        printf("[%d] MESSAGE LOG SIZE: %.2f MB\n",CkMyPe(),MLOGFT_totalLogSize/(float)MEGABYTE);
+       printf("[%d] MULTICAST MESSAGE LOG SIZE: %.2f MB\n",CkMyPe(),MLOGFT_totalMcastLogSize/(float)MEGABYTE);
 #endif
 
 #if COLLECT_STATS_MSGS
index ac2ec40a8dd98e84b385c1663301b006607aaaad..37c66721d05feacb4ece5a0c5e9a5528165d92bf 100644 (file)
 // silly ancient name: for backward compatability only.
 #define PW(x) CkPriobitsToInts(x) 
 
-#if (defined(_FAULT_MLOG_) || defined(_FAULT_CAUSAL_))
+#if CMK_MESSAGE_LOGGING
 #define CK_FREE_MSG_MLOG       0x1
 #define CK_BYPASS_DET_MLOG     0x2
+#define CK_MULTICAST_MSG_MLOG  0x4
 #endif
 
 //#define USE_CRITICAL_PATH_HEADER_ARRAY
index f5501b174ac5750337c3f386bb1e841fead9e03d..70c01c206b1fbaeb47a0fb63fa4fc116bb40732b 100644 (file)
 #define DEBUGF(x)  // CkPrintf x;
 
 // turn on or off fragmentation in multicast
+#if CMK_MESSAGE_LOGGING
+#define SPLIT_MULTICAST  0
+#else
 #define SPLIT_MULTICAST  1
+#endif
 
 // maximum number of fragments into which a message can be broken
 #define MAXFRAGS 100
@@ -705,6 +709,11 @@ void CkMulticastMgr::SimpleSend(int ep,void *m, CkArrayID a, CkSectionID &sid, i
 
 void CkMulticastMgr::ArraySectionSend(CkDelegateData *pd,int ep,void *m, int nsid, CkSectionID *sid, int opts)
 {
+#if CMK_MESSAGE_LOGGING
+       envelope *env = UsrToEnv(m);
+       env->flags = env->flags | CK_MULTICAST_MSG_MLOG;
+#endif
+
     for (int snum = 0; snum < nsid; snum++) {
         void *msgCopy = m;
         if (nsid - snum > 1)