Skip to content

Commit 83b6181

Browse files
committed
Fix the frame level pointed to by reenter_runtime_frame
1 parent e663a3f commit 83b6181

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

runtime/src/kmp_csupport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...)
306306
kmp_team_t *parent_team = master_th->th.th_team;
307307
if (ompt_enabled) {
308308
parent_team->t.t_implicit_task_taskdata[tid].
309-
ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(0);
309+
ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(1);
310310
}
311311
#endif
312312

@@ -396,7 +396,7 @@ __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...)
396396
int tid = __kmp_tid_from_gtid( gtid );
397397
if (ompt_enabled) {
398398
parent_team->t.t_implicit_task_taskdata[tid].
399-
ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(0);
399+
ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(1);
400400
}
401401
#endif
402402

runtime/src/kmp_gsupport.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ __kmp_GOMP_microtask_wrapper(int *gtid, int *npr, void (*task)(void *),
266266

267267
// set task frame
268268
ompt_frame = __ompt_get_task_frame_internal(0);
269-
ompt_frame->exit_runtime_frame = __builtin_frame_address(0);
269+
ompt_frame->exit_runtime_frame = __builtin_frame_address(1);
270270
}
271271
#endif
272272

@@ -311,7 +311,7 @@ __kmp_GOMP_parallel_microtask_wrapper(int *gtid, int *npr,
311311

312312
// set task frame
313313
ompt_frame = __ompt_get_task_frame_internal(0);
314-
ompt_frame->exit_runtime_frame = __builtin_frame_address(0);
314+
ompt_frame->exit_runtime_frame = __builtin_frame_address(1);
315315
}
316316
#endif
317317

@@ -446,7 +446,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_START)(void (*task)(void *), void *data, unsi
446446

447447
if (ompt_enabled) {
448448
parent_frame = __ompt_get_task_frame_internal(0);
449-
parent_frame->reenter_runtime_frame = __builtin_frame_address(0);
449+
parent_frame->reenter_runtime_frame = __builtin_frame_address(1);
450450
}
451451
#endif
452452

@@ -499,7 +499,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void)
499499
// Record that we re-entered the runtime system in the implicit
500500
// task frame representing the parallel region.
501501
ompt_frame = &task_info->frame;
502-
ompt_frame->reenter_runtime_frame = __builtin_frame_address(0);
502+
ompt_frame->reenter_runtime_frame = __builtin_frame_address(1);
503503

504504
// unlink if necessary. no-op if there is not a lightweight task.
505505
ompt_lw_taskteam_t *lwt = __ompt_lw_taskteam_unlink(thr);
@@ -513,7 +513,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void)
513513
// remaining deepest task knows the stack frame where the runtime
514514
// was reentered.
515515
ompt_frame = __ompt_get_task_frame_internal(0);
516-
ompt_frame->reenter_runtime_frame = __builtin_frame_address(0);
516+
ompt_frame->reenter_runtime_frame = __builtin_frame_address(1);
517517
}
518518
#endif
519519
}
@@ -529,7 +529,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void)
529529
// Set reenter frame in parent task, which will become current task
530530
// in the midst of join. This is needed before the end_parallel callback.
531531
ompt_frame = __ompt_get_task_frame_internal(1);
532-
ompt_frame->reenter_runtime_frame = __builtin_frame_address(0);
532+
ompt_frame->reenter_runtime_frame = __builtin_frame_address(1);
533533
}
534534
#endif
535535

@@ -559,7 +559,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void)
559559
if (ompt_enabled) {
560560
// Record that we re-entered the runtime system in the frame that
561561
// created the parallel region.
562-
ompt_frame->reenter_runtime_frame = __builtin_frame_address(0);
562+
ompt_frame->reenter_runtime_frame = __builtin_frame_address(1);
563563

564564
if (ompt_callbacks.ompt_callback(ompt_event_parallel_end)) {
565565
ompt_task_info_t *task_info = __ompt_get_taskinfo(0);
@@ -907,7 +907,7 @@ LOOP_NEXT_ULL(xexpand(KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT), \
907907
ompt_frame_t *parent_frame; \
908908
if (ompt_enabled) { \
909909
parent_frame = __ompt_get_task_frame_internal(0); \
910-
parent_frame->reenter_runtime_frame = __builtin_frame_address(0); \
910+
parent_frame->reenter_runtime_frame = __builtin_frame_address(1); \
911911
}
912912

913913

@@ -1000,7 +1000,7 @@ xexpand(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data, void (*copy_fu
10001000
thread->th.ompt_thread_info.wait_id = 0;
10011001
thread->th.ompt_thread_info.state = ompt_state_work_parallel;
10021002
taskdata->ompt_task_info.frame.exit_runtime_frame =
1003-
__builtin_frame_address(0);
1003+
__builtin_frame_address(1);
10041004
}
10051005
#endif
10061006

@@ -1110,7 +1110,7 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_SECTIONS_START)(void (*task) (void *), void *
11101110

11111111
if (ompt_enabled) {
11121112
parent_frame = __ompt_get_task_frame_internal(0);
1113-
parent_frame->reenter_runtime_frame = __builtin_frame_address(0);
1113+
parent_frame->reenter_runtime_frame = __builtin_frame_address(1);
11141114
}
11151115
#endif
11161116

runtime/src/kmp_tasking.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ __kmp_invoke_task( kmp_int32 gtid, kmp_task_t *task, kmp_taskdata_t * current_ta
11731173
oldInfo = thread->th.ompt_thread_info;
11741174
thread->th.ompt_thread_info.wait_id = 0;
11751175
thread->th.ompt_thread_info.state = ompt_state_work_parallel;
1176-
taskdata->ompt_task_info.frame.exit_runtime_frame = __builtin_frame_address(0);
1176+
taskdata->ompt_task_info.frame.exit_runtime_frame = __builtin_frame_address(1);
11771177
}
11781178
#endif
11791179

@@ -1332,7 +1332,7 @@ __kmp_omp_task( kmp_int32 gtid, kmp_task_t * new_task, bool serialize_immediate
13321332
#if OMPT_SUPPORT
13331333
if (ompt_enabled) {
13341334
new_taskdata->ompt_task_info.frame.reenter_runtime_frame =
1335-
__builtin_frame_address(0);
1335+
__builtin_frame_address(1);
13361336
}
13371337
#endif
13381338

@@ -1417,7 +1417,7 @@ __kmpc_omp_taskwait( ident_t *loc_ref, kmp_int32 gtid )
14171417
my_task_id = taskdata->ompt_task_info.task_id;
14181418
my_parallel_id = team->t.ompt_team_info.parallel_id;
14191419

1420-
taskdata->ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(0);
1420+
taskdata->ompt_task_info.frame.reenter_runtime_frame = __builtin_frame_address(1);
14211421
if (ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)) {
14221422
ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)(
14231423
my_parallel_id, my_task_id);

0 commit comments

Comments
 (0)