Bug #648: Add CkLoop tracing for Projections 12/512/5
authorYanhuaSun <sun51@illinois.edu>
Mon, 9 Feb 2015 21:24:38 +0000 (15:24 -0600)
committerPhil Miller <mille121@illinois.edu>
Tue, 8 Sep 2015 22:44:33 +0000 (17:44 -0500)
Change-Id: Ibd9aa2a0b97ca9303caf0a261603bac18b1484a1

src/libs/ck-libs/ckloop/CkLoop.C

index 08c0af0989db3bd74955f248159b52a06d3ac873..02b473d613fd7c624ade112141094d3f4fadd66b 100644 (file)
@@ -383,10 +383,21 @@ void FuncCkLoop::pup(PUP::er &p) {
   }
 }
 
+static int _ckloopEP;
 CpvStaticDeclare(int, NdhStealWorkHandler);
 static void RegisterCkLoopHdlrs() {
     CpvInitialize(int, NdhStealWorkHandler);
     CpvAccess(NdhStealWorkHandler) = CmiRegisterHandler((CmiHandler)SingleHelperStealWork);
+#ifdef __BIGSIM__
+    if(BgNodeRank()==0) {
+#else
+      if(CkMyRank()==0) {
+#endif
+        int _ckloopMsg = CkRegisterMsg("ckloop_converse_msg", 0, 0, 0, 0);
+        int _ckloopChare = CkRegisterChare("ckloop_converse_chare", 0, TypeInvalid);
+        CkRegisterChareInCharm(_ckloopChare);
+        _ckloopEP = CkRegisterEp("CkLoop", (CkCallFnPtr)SingleHelperStealWork, _ckloopMsg, _ckloopChare, 0+CK_EP_INTRINSIC);
+      }
 }
 
 extern int _charmHandlerIdx;
@@ -495,7 +506,10 @@ void SingleHelperStealWork(ConverseNotifyMsg *msg) {
         }
     }
     CurLoopInfo *loop = (CurLoopInfo *)msg->ptr;
+
+    _TRACE_BEGIN_EXECUTE_DETAILED(0, 4, _ckloopEP, CkNodeFirst(CkMyNode())+srcRank, sizeof(ConverseNotifyMsg), NULL);
     loop->stealWork();
+    _TRACE_END_EXECUTE();
 }
 
 void CurLoopInfo::stealWork() {