Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 43dbf5c8 authored by Thierry's avatar Thierry
Browse files

[add] extra informations for loop: ub,lb,stride

parent 54f7a283
No related branches found
No related tags found
No related merge requests found
......@@ -447,7 +447,7 @@ on_ompt_event_loop_begin(
//kaapi_tracelib_team_t* team = koti->tstack.stack[koti->tstack.top-1];
kaapi_tracelib_loop_begin(koti->kproc, /*team,*/ workshare_id,
loc == 0? "undefined" : loc->psource,
schedule, count);
schedule, lb, ub, stride, count);
#endif
}
......@@ -457,7 +457,8 @@ on_ompt_event_loop_dispatch(
ompt_parallel_id_t parallel_id,
ompt_task_id_t task_id,
ompt_workshare_id_t workshare_id,
int64_t lb, int64_t ub, int64_t stride )
int64_t lb, int64_t ub, int64_t stride
)
{
#if 1//LOG
printf("%" PRIu64 ": ompt_event_loop_dispatch: parallel_id=%" PRIu64 ", parent_task_id=%" PRIu64
......@@ -466,7 +467,7 @@ on_ompt_event_loop_dispatch(
#endif
#if USE_KAAPI
kaapi_ompt_thread_info_t* koti = &__kaapi_oth_info[thread_id];
kaapi_tracelib_loop_dispatch( koti->kproc, workshare_id, (ub-lb)/stride+1);
kaapi_tracelib_loop_dispatch( koti->kproc, workshare_id, ub, lb, stride);
#endif
}
......
......@@ -280,9 +280,9 @@ typedef struct kaapi_named_perfctr {
#define KAAPI_EVT_BARRIER_BEG 44 /* d0: running task */
#define KAAPI_EVT_BARRIER_END 45 /* d0: running task */
#define KAAPI_EVT_TASK_STEAL 46 /* d0: executed task, d1: original task */
#define KAAPI_EVT_LOOP_BEGIN 47 /* d0: workshare id, d1: iteration count */
#define KAAPI_EVT_LOOP_BEGIN 47 /* d0: workshare id, d1: sched type, d2: iteration count */
#define KAAPI_EVT_LOOP_END 48 /* d0: workshare id */
#define KAAPI_EVT_LOOP_NEXT 49 /* d0: workshare id, d1: iteration count dispatched to the thread */
#define KAAPI_EVT_LOOP_NEXT 49 /* d0: workshare id, d1: ub, d2: lb, d3: stride */
#define KAAPI_EVT_TASK_STEALOP 50 /* d0: op:0 pop, 1 steal, d1.i32[0]:cpu, d1.i32[1]:node, d2.i32[0]:victim_level, d2.i32[1]: victim_level_id */
#define KAAPI_EVT_THREAD_STATE 51 /* user level state: d0: 0 begin / 1 end; d1: cpu+node, d2 state */
......@@ -290,7 +290,8 @@ typedef struct kaapi_named_perfctr {
#define KAAPI_EVT_ENERGY_MACHINE 52
#define KAAPI_EVT_WATT_MACHINE 53
#define KAAPI_EVT_LAST 54
#define KAAPI_EVT_LOOP_MDATA 54 /* d0: workshare id, d1: ub, d2: lb, d3: stride. Follow KAAPI_EVT_LOOP_BEGIN */
#define KAAPI_EVT_LAST 55
/** Size of the event mask
*/
......@@ -514,6 +515,9 @@ typedef struct kaapi_tracelib_loop_t {
char* name; /* name of the parallel region */
kaapi_perfstat_t stats; /* for the running thread */
kaapi_perf_counter_t iter; /* iteration count for the running thread */
kaapi_perf_counter_t ub; /* ub for the loop */
kaapi_perf_counter_t lb; /* lb */
kaapi_perf_counter_t stride; /* stride */
kaapi_perf_counter_t time; /* time for perf iteration for the running thread */
struct kaapi_tracelib_loop_t* next; /* in the team declaration */
} kaapi_tracelib_loop_t;
......@@ -887,6 +891,9 @@ extern void kaapi_tracelib_loop_begin(
uint64_t wid,
const char* psource,
uint64_t schedtype,
int64_t lb,
int64_t ub,
int64_t stride,
uint64_t count
);
......@@ -902,7 +909,9 @@ extern void kaapi_tracelib_loop_end(
extern void kaapi_tracelib_loop_dispatch(
kaapi_tracelib_thread_t* kproc,
uint64_t wid,
uint64_t size
int64_t lb,
int64_t ub,
int64_t stride
);
......
......@@ -1722,21 +1722,28 @@ void kaapi_tracelib_loop_begin(
uint64_t wid,
const char* psource,
uint64_t schedtype,
int64_t lb,
int64_t ub,
int64_t stride,
uint64_t count
)
{
kaapi_tracelib_loop_t* loop = (kaapi_tracelib_loop_t*)malloc(sizeof(kaapi_tracelib_loop_t));
loop->key = (void*)wid;
loop->name = 0;
loop->iter = 0;
loop->time = kaapi_get_elapsedns();
loop->next = 0;
loop->key = (void*)wid;
loop->name = 0;
loop->iter = 0;
loop->ub = ub;
loop->lb = lb;
loop->stride= stride;
loop->time = kaapi_get_elapsedns();
loop->next = 0;
if (kproc->loop_tail)
kproc->loop_tail->next = loop;
else
kproc->loop_head = loop;
kproc->loop_tail = loop;
KAAPI_EVENT_PUSH3(kproc, 0, KAAPI_EVT_LOOP_BEGIN, wid, schedtype, count );
KAAPI_EVENT_PUSH4(kproc, 0, KAAPI_EVT_LOOP_MDATA, wid, ub, lb, stride );
}
......@@ -1758,12 +1765,15 @@ extern void kaapi_tracelib_loop_end(
extern void kaapi_tracelib_loop_dispatch(
kaapi_tracelib_thread_t* kproc,
uint64_t wid,
uint64_t size
int64_t lb,
int64_t ub,
int64_t stride
)
{
kaapi_tracelib_loop_t* loop = kproc->loop_tail;
int64_t size = (ub-lb)/stride+1;
loop->iter += size;
KAAPI_EVENT_PUSH2(kproc, 0, KAAPI_EVT_LOOP_NEXT, wid, size );
KAAPI_EVENT_PUSH4(kproc, 0, KAAPI_EVT_LOOP_NEXT, wid, ub, lb, stride );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment