Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMPD 5 and limited OMPD support for cuda devices #49

Open
wants to merge 69 commits into
base: ompd
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d8edcc7
Merge branch 'master' into ompd
Jun 21, 2018
c836b8d
[OMPD] Fixing runtime ompd type references
manorom Jun 22, 2018
73fe9de
[OMPD] add cmake modules necessary to build gdb-wrapper
manorom Jun 22, 2018
255356b
[OMPD] align libompd and odb w/ new OpenMP spec
manorom Jun 25, 2018
0c3427e
Add ompd_get_thread_handle for cuda.
manorom Jun 29, 2018
63309d5
[OMPD] Adds some support for omp states on cuda
manorom Jul 2, 2018
e1949d3
[OMPD] Further align code to spec
manorom Jul 2, 2018
f9cc9b4
[OMPD] Aligned callback names with spec
manorom Jul 3, 2018
cffa430
Fix formatting mistake
manorom Jul 3, 2018
e72f4a7
[OMPD] Add parallel and reduction state to npvtx
manorom Jul 3, 2018
27e8cc8
[OMPD] Add reduction state + save thread coords
manorom Jul 5, 2018
322f3f6
[OMPD] cleanup and + ompd parallel handle for cuda
manorom Jul 10, 2018
8a25e59
[OMPD] Remove unsupported api functions + fixes
manorom Jul 13, 2018
485b132
[OMPD] add support for some ICVs to libompd
manorom Jul 13, 2018
f37acc3
[OMPD] Add serial state in cuda device rtl
manorom Jul 13, 2018
4c40f17
[OMPD] Add some icvs + move values in ompd_types.h
manorom Jul 13, 2018
528b3ed
[OMPD] Align ompd.h formatting to spec
manorom Jul 16, 2018
c612600
[OMPD] changed some comments for current spec
manorom Jul 16, 2018
5dd42cc
[OMPD] Some cleanup in gdb-wrapper
manorom Jul 17, 2018
3473deb
[OMPD] fix omp version
manorom Jul 17, 2018
64b73b0
[OMPD] Add type compatibillity for new spec to odb
manorom Jul 17, 2018
43d1e58
[OMPD] Code clean-up in odb
manorom Jul 17, 2018
66775c1
[OMPD] Fix bug introd. by type changes f. new spec
manorom Jul 17, 2018
bf0ea8a
[OMPD] Add "tasks" command to odb
manorom Jul 18, 2018
ee03881
Merge remote-tracking branch 'origin/ompd' into ompd-devices
manorom Jul 18, 2018
504e7be
[OMPD] Add get_task_function and test code in odb
manorom Jul 19, 2018
d208dc1
[OMPD] Fix some formatting
manorom Jul 20, 2018
94c3081
[OMPD] Fix formatting mistakes
manorom Jul 20, 2018
267a230
[OMPD] Fix linking for gdb-wrapper
manorom Jul 23, 2018
14b0cea
[OMPD] Save cuda kernel info in ompd handles
manorom Jul 23, 2018
33ccbfa
Merge remote-tracking branch 'origin/master' into ompd-devices
manorom Jul 23, 2018
7a79281
[OMPD] Set correct omp states for all modes (cuda)
manorom Jul 30, 2018
5bec325
[OMPD] Fix thread handles in all exec modes (cuda)
manorom Jul 30, 2018
b3de3ae
[OMPD] Add ompd break points for thread begin/end
manorom Aug 1, 2018
b96b31c
[OMPD] Add some support: parallel handles (cuda)
manorom Aug 7, 2018
3609e86
[OMPD] remove usage of kernel id in odb
manorom Aug 8, 2018
a619134
[OMPD] Add ompd_get_thread_in_parallel for cuda
manorom Aug 8, 2018
011a376
[OMPD] Move memory segment values to ompd_types.h
manorom Aug 8, 2018
8d49887
[OMPD] Re-enable checking for ompd state tracking
manorom Aug 8, 2018
300c218
Remove accidentally committed .bak file
manorom Aug 9, 2018
e0538aa
Merge remote-tracking branch 'origin/ompd' into ompd-devices
manorom Aug 10, 2018
c806b3e
Merge remote-tracking branch 'origin/ompd' into ompd-devices
manorom Aug 10, 2018
783262c
[OMPD] Make odb initialization at first command
manorom Aug 13, 2018
17f53de
[OMPD] Add code to support some ICVs on cuda devs
manorom Aug 13, 2018
598ec68
[OMPD] removed ompdAllocatable class
manorom Aug 14, 2018
21d2ad7
[OMPD] Remove _ompd_device_handle_s struct
manorom Aug 14, 2018
6351c6f
[OMPD] Work around for cuda-gdb name mangling bug
manorom Aug 23, 2018
4b6f24b
[OMPD] Add support for cuda icvs to odb
manorom Aug 23, 2018
0322eab
[OMPD] Fix enclosing_parallel + enable target ICVs
manorom Aug 27, 2018
098dd55
[OMPD] Fix ompd_get_thread_in_parallel + add test
manorom Aug 30, 2018
66b0339
[OMPD] Update ompd_types.h + remove kernelId field
manorom Sep 4, 2018
09ed60b
[OMPD] Fix ompd_types.h
manorom Sep 5, 2018
b2be2d6
[OMPD] Add some support for tasks for cuda
manorom Sep 7, 2018
24e9595
[OMPD] Fix parallel level for explicit tasks
manorom Sep 17, 2018
d15db76
[OMPD] omp_device_t -> ompd_device_t
manorom Sep 18, 2018
58e5df5
[OMPD] Add examples to test ompd on cuda
manorom Sep 21, 2018
42982e4
[OMPD] Add ompd breakpoints
manorom Sep 21, 2018
23f5ea0
[OMPD] Fix task/parallel handle interaction
manorom Sep 21, 2018
8c4c7ae
[OMPD] Make OMPD configurable for deviceRTLs
manorom Sep 25, 2018
901ff1b
[OMPD] Clean up by removing unnecesarry header
manorom Sep 25, 2018
6a825eb
[OMPD} Remove deprecated ompd_process_handle_t
manorom Sep 25, 2018
bc9c1e3
[OMPD] Remove TODOs
manorom Sep 27, 2018
d861bcd
[OMPD] Add some kernel info + removed TODO notes
manorom Sep 28, 2018
c1b4c5a
Add information on scheduling parent for the master task in a paralle…
jprotze Oct 12, 2018
66b0f8d
Initialize all address variables
loeseke Oct 17, 2018
726b21b
Fix ompd_get_thread_id
jprotze Dec 14, 2018
36fcaf3
Initialize lwt field for ompd_get_task_in_parallel
loeseke Jan 16, 2019
e1c6cad
Fix ompd_get_task_function for implicit tasks
jprotze Jan 17, 2019
f9bb739
Use the right team to get the function pointer
loeseke Jan 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Initialize all address variables
  • Loading branch information
loeseke committed Oct 17, 2018
commit 66b0f8db22db06e8342c9a6859b6e1fa7d83eb6c
6 changes: 5 additions & 1 deletion libompd/src/TargetValue.cpp
Original file line number Diff line number Diff line change
@@ -362,7 +362,11 @@ TBaseValue TValue::castBase(const char *varName) {
return TBaseValue(*this, size);
}

TBaseValue TValue::castBase() const { return TBaseValue(*this, fieldSize); }
TBaseValue TValue::castBase() const {
if(pointerLevel>0)
return TBaseValue(*this, type_sizes.sizeof_pointer);
return TBaseValue(*this, fieldSize);
}

TBaseValue TValue::castBase(ompd_target_prim_types_t baseType) const {
return TBaseValue(*this, baseType);
28 changes: 16 additions & 12 deletions libompd/src/omp-debug.cpp
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ ompd_rc_t ompd_get_thread_in_parallel(

assert(callbacks && "Callback table not initialized!");

ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};

if (parallel_handle->ah->kind == OMPD_DEVICE_KIND_CUDA) {
uint16_t thread_idx;
@@ -375,7 +375,7 @@ ompd_rc_t ompd_get_current_parallel_handle(
(*parallel_handle)->th = taddr;
(*parallel_handle)->cuda_kernel_info = thread_handle->cuda_kernel_info;
} else {
ompd_address_t taddr, lwt;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0}, lwt={OMPD_SEGMENT_UNSPECIFIED,0};

TValue teamdata = TValue(context, thread_handle->th) /*__kmp_threads[t]->th*/
.cast("kmp_base_info_t")
@@ -423,7 +423,7 @@ ompd_rc_t ompd_get_enclosing_parallel_handle(

assert(callbacks && "Callback table not initialized!");

ompd_address_t taddr = parallel_handle->th, lwt;
ompd_address_t taddr = parallel_handle->th, lwt={OMPD_SEGMENT_UNSPECIFIED,0};
ompd_rc_t ret;

if (parallel_handle->ah->kind == OMPD_DEVICE_KIND_CUDA) {
@@ -558,7 +558,7 @@ ompd_rc_t ompd_get_task_parallel_handle(
return ompd_rc_stale_handle;

assert(callbacks && "Callback table not initialized!");
ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};

ompd_rc_t ret;

@@ -679,7 +679,7 @@ ompd_rc_t ompd_get_current_task_handle(
return ompd_rc_stale_handle;

assert(callbacks && "Callback table not initialized!");
ompd_address_t taddr, lwt;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0}, lwt={OMPD_SEGMENT_UNSPECIFIED,0};
ompd_rc_t ret = ompd_rc_ok;

lwt.segment = OMPD_SEGMENT_UNSPECIFIED;
@@ -740,7 +740,7 @@ ompd_rc_t ompd_get_generating_task_handle(
return ompd_rc_stale_handle;

assert(callbacks && "Callback table not initialized!");
ompd_address_t taddr = task_handle->th, lwt;
ompd_address_t taddr = task_handle->th, lwt={OMPD_SEGMENT_UNSPECIFIED,0};

ompd_rc_t ret = ompd_rc_stale_handle;
TValue lwtValue = TValue(context, task_handle->lwt);
@@ -800,7 +800,7 @@ ompd_rc_t ompd_get_scheduling_task_handle(
return ompd_rc_stale_handle;

assert(callbacks && "Callback table not initialized!");
ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};
ompd_rc_t ret;

if (task_handle->ah->kind == OMPD_DEVICE_KIND_CUDA) {
@@ -823,8 +823,11 @@ ompd_rc_t ompd_get_scheduling_task_handle(
.cast("ompt_task_info_t")
.access("scheduling_parent") // td->ompd_task_info.scheduling_parent
.cast("kmp_taskdata_t", 1)
.dereference()
.getAddress(&taddr);
.castBase()
.getValue(taddr.address);
if (taddr.address == 0) {
return ompd_rc_unavailable;
}
}

if (ret != ompd_rc_ok)
@@ -835,6 +838,7 @@ ompd_rc_t ompd_get_scheduling_task_handle(
return ret;

(*parent_task_handle)->th = taddr;
(*parent_task_handle)->lwt = {OMPD_SEGMENT_UNSPECIFIED,0};
(*parent_task_handle)->ah = task_handle->ah;
(*parent_task_handle)->cuda_kernel_info = task_handle->cuda_kernel_info;
return ret;
@@ -857,7 +861,7 @@ ompd_rc_t ompd_get_task_in_parallel(
assert(callbacks && "Callback table not initialized!");

ompd_rc_t ret;
ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};

if (parallel_handle->ah->kind == OMPD_DEVICE_KIND_CUDA) {
ret = TValue(context, parallel_handle->th)
@@ -961,7 +965,7 @@ ompd_get_thread_handle(ompd_address_space_handle_t
.getPtrArrayElement(p->threadIdx.x)
.dereference();

ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};
ret = th.getAddress(&taddr);

if (ret != ompd_rc_ok) {
@@ -1038,7 +1042,7 @@ ompd_get_thread_handle(ompd_address_space_handle_t
.getArrayElement(tId) /*__kmp_threads[t]*/
.access("th"); /*__kmp_threads[t]->th*/

ompd_address_t taddr;
ompd_address_t taddr={OMPD_SEGMENT_UNSPECIFIED,0};
ret = th.getAddress(&taddr);
if (ret != ompd_rc_ok)
return ret;
8 changes: 8 additions & 0 deletions libompd/src/omp-debug.h
Original file line number Diff line number Diff line change
@@ -89,6 +89,14 @@ typedef struct _ompd_task_handle_s {
used to retrieve this
parallel region handle
*/
_ompd_task_handle_s(){
ah=NULL;
th.segment=OMPD_SEGMENT_UNSPECIFIED;
lwt.segment=OMPD_SEGMENT_UNSPECIFIED;
th.address=0;
lwt.address=0;
cuda_kernel_info=NULL;
}
} ompd_task_handle_t;

#endif
2 changes: 1 addition & 1 deletion runtime/src/ompt-general.cpp
Original file line number Diff line number Diff line change
@@ -371,7 +371,7 @@ void ompt_post_init() {
}

void ompt_fini() {
if (ompt_enabled.enabled) {
if (ompt_enabled.enabled && ompt_start_tool_result && ompt_start_tool_result->finalize) {
ompt_start_tool_result->finalize(&(ompt_start_tool_result->tool_data));
}