diff --git a/runtime/src/kaapi_ompt.c b/runtime/src/kaapi_ompt.c index e6ccdff5b2e0d4a3f70f2a492fe417d30bcde590..e31df12044e8d2e5d1756ada532bd5a5c795a3da 100644 --- a/runtime/src/kaapi_ompt.c +++ b/runtime/src/kaapi_ompt.c @@ -434,7 +434,7 @@ on_ompt_event_loop_begin( void *workshare_function, int schedule, int64_t lb, int64_t ub, int64_t stride, uint64_t chunk, uint64_t count) { -#if 1//LOG +#if LOG printf("%" PRIu64 ": ompt_event_loop_begin: parallel_id=%" PRIu64 ", parent_task_id=%" PRIu64 ", workshare_id=%" PRIu64 ", loc: %s, workshare_function=%p, schedule: %i" " [%" PRIi64 ":%" PRIi64 ":%" PRIi64 "], chunk:%" PRIu64 ", count:%" PRIu64 "\n", @@ -460,7 +460,7 @@ on_ompt_event_loop_dispatch( int64_t lb, int64_t ub, int64_t stride ) { -#if 1//LOG +#if LOG printf("%" PRIu64 ": ompt_event_loop_dispatch: parallel_id=%" PRIu64 ", parent_task_id=%" PRIu64 ", workshare_id=%" PRIu64 ", [%" PRIi64 ":%" PRIi64 ":%" PRIi64 "]\n", thread_id-1, parallel_id, task_id, workshare_id, lb, stride, ub); @@ -480,7 +480,7 @@ on_ompt_event_loop_end( ompt_workshare_id_t workshare_id ) { -#if 1//LOG +#if LOG printf("%" PRIu64 ": ompt_event_loop_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", workshare_id=%" PRIu64 "\n", thread_id-1, parallel_id, task_id, workshare_id); #endif diff --git a/runtime/src/kaapi_trace_rt.c b/runtime/src/kaapi_trace_rt.c index 6fde47344fba181c8999e1a517335c1ce333d1c3..b3beef50833efa230623a0f88e9c73ac1076e6ae 100644 --- a/runtime/src/kaapi_trace_rt.c +++ b/runtime/src/kaapi_trace_rt.c @@ -106,7 +106,8 @@ const char* kaapi_event_name[] /*50 */ "ThreadStealOp", /*51 */ "ThreadState", /*52 */ "Energy", -/*53 */ "Watt" +/*53 */ "Watt", +/*54 */ "LoopMData" }; diff --git a/runtime/src/katracereader.cpp b/runtime/src/katracereader.cpp index 1f6695f1d0c23b8da054f501fabbe78bb9a68c2b..27b41616dd8174f9a71aaec61e095e104eb4aa91 100644 --- a/runtime/src/katracereader.cpp +++ b/runtime/src/katracereader.cpp @@ -1336,7 +1336,7 @@ struct kproc_t : public state_t { /* Keep track of the thread state event */ struct loopinfo_t : public event_t { - enum { BEGIN, END, DISPATCH }; + enum { BEGIN, DISPATCH, END }; loopinfo_t(int k) : event_t(), type(k), wid(0), count(0), ub(0), lb(0), stride(0) {} @@ -1975,8 +1975,10 @@ printf("pred[id:%i/%p] = {id:%i}/%p\n", succ->id, (void*)succ->addr, task->id, ( li.start = event->date; li.kid = kid; li.wid = KAAPI_EVENT_DATA(event,0,u); - rpr->loopevts.push_back( li ); loopstate_t& ls = rpr->loopstack[kid].back(); + + if (li.wid == (uint64_t)-1) li.wid = ls.wid; + rpr->loopevts.push_back( li ); ls.stop = event->date; ls.kid = kid; ls.wid = li.wid; @@ -2582,7 +2584,7 @@ int csv_parallel_region_t::closefile(int cpucount) } /* header */ fprintf(csv_parallel_region_t::fout_loops, - "Resource, Stamp, Wid, EvtType, UB, LB, Stride" + "Resource, Stamp, Wid, EvtType, UB, LB, Stride\n" ); for (size_t i=0; i<loopevts.size(); ++i) { @@ -2725,6 +2727,12 @@ static void fnc_csv( int count, const char** filenames ) fprintf(stdout,"*** File 'complexity.csv' generated\n"); csv_parallel_region_t::fout_complexity = 0; } + if (csv_parallel_region_t::fout_loops) + { + fclose(csv_parallel_region_t::fout_loops); + fprintf(stdout,"*** File 'loops.csv' generated\n"); + csv_parallel_region_t::fout_loops = 0; + } rastello_fmtname.clear();