Skip to content

Commit 8299cc2

Browse files
committed
Update ompd library to the symbol names in libomp
1 parent 30445f1 commit 8299cc2

File tree

4 files changed

+54
-40
lines changed

4 files changed

+54
-40
lines changed

libompd/src/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
project (libompd)
22

3-
add_library (ompd_intel SHARED TargetValue.cpp ompd_intel.cpp)
3+
add_library (ompd SHARED TargetValue.cpp omp-debug.cpp)
44

55
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
66

77
include_directories (
8-
${CMAKE_BINARY_DIR}/include
8+
${CMAKE_CURRENT_BINARY_DIR}/include
99
${CMAKE_CURRENT_SOURCE_DIR}
1010
)
1111

12-
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include)
12+
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
1313

1414
ADD_CUSTOM_TARGET (
1515
ompd-header ALL
16-
DEPENDS ${CMAKE_BINARY_DIR}/include/ompd.h ${CMAKE_BINARY_DIR}/include/ompd_typedefs.h
16+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/ompd.h ${CMAKE_CURRENT_BINARY_DIR}/include/ompd_typedefs.h
1717
)
1818

1919
add_custom_command (
20-
OUTPUT ${CMAKE_BINARY_DIR}/include/ompd.h ${CMAKE_BINARY_DIR}/include/ompd_typedefs.h
20+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/ompd.h ${CMAKE_CURRENT_BINARY_DIR}/include/ompd_typedefs.h
2121
COMMAND ${BASH}
2222
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/split_def_typedef.sh
2323
${CMAKE_CURRENT_SOURCE_DIR}/ompd-template.h
24-
${CMAKE_BINARY_DIR}/include/ompd_typedefs.h
25-
${CMAKE_BINARY_DIR}/include/ompd.h
24+
${CMAKE_CURRENT_BINARY_DIR}/include/ompd_typedefs.h
25+
${CMAKE_CURRENT_BINARY_DIR}/include/ompd.h
2626
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ompd-template.h
2727
)
2828

29-
INSTALL( TARGETS ompd_intel
29+
INSTALL( TARGETS ompd
3030
LIBRARY DESTINATION lib
3131
ARCHIVE DESTINATION lib/static
3232
RUNTIME DESTINATION bin )
3333

34-
INSTALL(FILES ${CMAKE_BINARY_DIR}/include/ompd.h DESTINATION include)
34+
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/ompd.h DESTINATION include)
3535

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ompd_intel.cpp
2+
* omp-debug.cpp
33
*
44
* Created on: Jan 14, 2015
55
* Author: Ignacio Laguna
@@ -13,7 +13,7 @@
1313

1414
#define NDEBUG 1
1515

16-
#include "ompd_intel.h"
16+
#include "omp-debug.h"
1717
#include "ompd.h"
1818
// #include <stdio.h>
1919
#include <cstdio>
@@ -122,6 +122,7 @@ ompd_rc_t ompd_release_address_space_handle (
122122
return ompd_rc_ok;
123123
}
124124

125+
#if 0 // no device support yet
125126
ompd_rc_t ompd_device_initialize (
126127
ompd_address_space_context_t *context, /* IN: */
127128
ompd_device_identifier_t id, /* IN: object defined by native device API */
@@ -178,6 +179,7 @@ ompd_rc_t ompd_device_initialize (
178179
/* TODO(mjm) - Find appropriate error return result for not finding a match */
179180
return ompd_rc_ok;
180181
}
182+
#endif // no device support
181183

182184
/* --- 4 Handle Management -------------------------------------------------- */
183185

@@ -637,6 +639,7 @@ ompd_rc_t ompd_parallel_handle_compare (
637639
return ompd_rc_ok;
638640
}
639641

642+
#if 0 // parallel-id is initialized to zero
640643
ompd_rc_t ompd_get_parallel_handle_string_id (
641644
ompd_parallel_handle_t *parallel_handle,
642645
char **string_id
@@ -653,6 +656,7 @@ ompd_rc_t ompd_get_parallel_handle_string_id (
653656
sprintf(*string_id, "0x%llx", (long long)id);
654657
return ompd_rc_ok;
655658
}
659+
#endif
656660

657661

658662
/* --- 4.3 Task Handles ----------------------------------------------------- */
@@ -935,6 +939,7 @@ ompd_rc_t ompd_task_handle_compare (
935939
return ompd_rc_ok;
936940
}
937941

942+
#if 0 // all task ids are initialized to zero
938943
ompd_rc_t ompd_get_task_handle_string_id (
939944
ompd_task_handle_t *task_handle,
940945
char **string_id
@@ -950,6 +955,7 @@ ompd_rc_t ompd_get_task_handle_string_id (
950955
sprintf(*string_id, "0x%llx", (long long)id);
951956
return ompd_rc_ok;
952957
}
958+
#endif
953959

954960

955961
/* --- 5 Process and Thread Settings ---------------------------------------- */
@@ -1088,9 +1094,9 @@ ompd_rc_t ompd_get_active_level(
10881094

10891095
/* --- 6.2 OMPT Parallel Region Inquiry Analogues ------------------------- */
10901096

1091-
ompd_rc_t ompd_get_parallel_id(
1097+
ompd_rc_t ompd_get_parallel_data(
10921098
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
1093-
ompd_parallel_id_t *id /* OUT: OpenMP parallel id */
1099+
ompd_address_t *data /* OUT: OpenMP parallel id */
10941100
)
10951101
{
10961102
if (!parallel_handle)
@@ -1115,12 +1121,12 @@ ompd_rc_t ompd_get_parallel_id(
11151121
ompd_rc_t ret = teamInfo.
11161122
access("ompt_team_info"). /*t.ompt_team_info*/
11171123
cast("ompt_team_info_t",0).
1118-
access("parallel_id"). /*t.ompt_team_info.parallel_id*/
1119-
castBase("ompt_parallel_id_t"). /*type: ompt_parallel_id_t*/
1120-
getValue(*id);
1124+
access("parallel_data"). /*t.ompt_team_info.parallel_id*/
1125+
getAddress(data);
11211126
return ret;
11221127
}
11231128

1129+
#if 0 // there is no such thing as a parallel function
11241130
ompd_rc_t ompd_get_parallel_function(
11251131
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
11261132
ompd_address_t *parallel_addr /* OUT: first instruction in the parallel region */
@@ -1154,6 +1160,7 @@ ompd_rc_t ompd_get_parallel_function(
11541160
getValue(parallel_addr->address);
11551161
return ret;
11561162
}
1163+
#endif // no parallel function
11571164

11581165
/* --- 7 Thread Inquiry ----------------------------------------------------- */
11591166

@@ -1637,7 +1644,7 @@ ompd_rc_t ompd_get_task_frame(
16371644
cast("ompt_frame_t", 0);
16381645
sp_reentry->segment = OMPD_SEGMENT_UNSPECIFIED;
16391646
ompd_rc_t ret = frame.
1640-
access("reenter_runtime_frame"). // td->ompt_task_info.frame.reenter_runtime_frame
1647+
access("enter_frame"). // td->ompt_task_info.frame.enter_frame
16411648
castBase().
16421649
getValue(sp_reentry->address);
16431650

@@ -1646,16 +1653,16 @@ ompd_rc_t ompd_get_task_frame(
16461653

16471654
sp_exit->segment = OMPD_SEGMENT_UNSPECIFIED;
16481655
ret = frame.
1649-
access("exit_runtime_frame"). // td->ompt_task_info.frame.exit_runtime_frame
1656+
access("exit_frame"). // td->ompt_task_info.frame.exit_frame
16501657
castBase().
16511658
getValue(sp_exit->address);
16521659

16531660
return ret;
16541661
}
16551662

1656-
ompd_rc_t ompd_get_task_id(
1663+
ompd_rc_t ompd_get_task_data(
16571664
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle*/
1658-
ompd_task_id_t *task_id /* OUT: OpenMP task ID */
1665+
ompd_address_t *task_data /* OUT: OpenMP task ID */
16591666
)
16601667
{
16611668
if (!task_handle)
@@ -1680,13 +1687,13 @@ ompd_rc_t ompd_get_task_id(
16801687
ompd_rc_t ret = taskInfo.
16811688
access("ompt_task_info"). // td->ompt_task_info
16821689
cast("ompt_task_info_t").
1683-
access("task_id"). // td->ompt_task_info.task_id
1684-
castBase("ompt_task_id_t").
1685-
getValue(*task_id);
1690+
access("task_data"). // td->ompt_task_info.task_data
1691+
getAddress(task_data);
16861692

16871693
return ret;
16881694
}
16891695

1696+
#if 0 // the runtime currently does not have task function information
16901697
ompd_rc_t ompd_get_task_function(
16911698
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle */
16921699
ompd_address_t *task_addr /* OUT: first instruction in the task region */
@@ -1731,7 +1738,7 @@ ompd_rc_t ompd_get_task_function(
17311738
getValue(task_addr->address);
17321739
return ret;
17331740
}
1734-
1741+
#endif
17351742

17361743
/* --- 9 OMPD Version and Compatibility Information ------------------------- */
17371744

@@ -1747,9 +1754,10 @@ ompd_rc_t ompd_get_version_string(
17471754
const char **string /* OUT: OMPD version string */
17481755
)
17491756
{
1750-
static char version_string[256]={0};
1757+
/* static char version_string[256]={0};
17511758
if(version_string[0]=='\0')
1752-
sprintf(version_string, "Intel OpenMP %i.%i Debugging Library implemnting TR %i%c",OMPD_IMPLEMENTS_OPENMP, OMPD_IMPLEMENTS_OPENMP_SUBVERSION, OMPD_TR_VERSION, OMPD_TR_SUBVERSION);
1759+
sprintf(version_string, "LLVM OpenMP %i.%i Debugging Library implemnting TR %i%c",OMPD_IMPLEMENTS_OPENMP, OMPD_IMPLEMENTS_OPENMP_SUBVERSION, OMPD_TR_VERSION, OMPD_TR_SUBVERSION);*/
1760+
static const char version_string[] = "LLVM OpenMP " STR(OMPD_IMPLEMENTS_OPENMP) "." STR(OMPD_IMPLEMENTS_OPENMP_SUBVERSION) " Debugging Library implemnting TR " STR(OMPD_TR_VERSION) "" STR(OMPD_TR_SUBVERSION) ;
17531761
*string = version_string;
17541762
return ompd_rc_ok;
17551763
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ extern "C" {
2828
#define OMPD_TR_VERSION 6
2929
#define OMPD_TR_SUBVERSION 'j'
3030
#define OMPD_VERSION (OMPD_IMPLEMENTS_OPENMP << 24) + (OMPD_IMPLEMENTS_OPENMP_SUBVERSION << 16) + (OMPD_TR_VERSION << 8) + OMPD_TR_SUBVERSION
31+
32+
#define STR_HELPER(x) #x
33+
#define STR(x) STR_HELPER(x)
3134

3235
#include "ompd.h"
3336
#include "ompd_typedefs.h"

libompd/src/ompd-template.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ typedef uint64_t ompd_taddr_t; /* unsigned integer large enough */
4949
/* to hold a target address or a */
5050
/* target segment value */
5151
typedef int64_t ompd_tword_t; /* signed version of ompd_addr_t */
52-
typedef uint64_t ompd_parallel_id_t; /* parallel region instance ID */
53-
typedef uint64_t ompd_task_id_t; /* task region instance ID */
5452
typedef uint64_t ompd_wait_id_t; /* identifies what a thread is */
5553
/* waiting for */
5654
typedef uint64_t ompd_size_t; /* For sizes (e.g., size_t) */
@@ -628,6 +626,7 @@ typedef ompd_rc_t (*ompd_parallel_handle_compare_apifn_t) (
628626
int *cmp_value
629627
);
630628

629+
#if 0
631630
ompd_rc_t ompd_get_parallel_handle_string_id (
632631
ompd_parallel_handle_t *parallel_handle,
633632
char **string_id
@@ -636,6 +635,7 @@ typedef ompd_rc_t (*ompd_get_parallel_handle_string_id_apifn_t) (
636635
ompd_parallel_handle_t *parallel_handle,
637636
char **string_id
638637
);
638+
#endif
639639

640640
/* --- 4.3 Task Handles ----------------------------------------------------- */
641641

@@ -727,6 +727,7 @@ typedef ompd_rc_t (*ompd_task_handle_compare_apifn_t) (
727727
int *cmp_value
728728
);
729729

730+
#if 0
730731
ompd_rc_t ompd_get_task_handle_string_id (
731732
ompd_task_handle_t *task_handle,
732733
char **string_id
@@ -735,7 +736,7 @@ typedef ompd_rc_t (*ompd_get_task_handle_string_id_apifn_t) (
735736
ompd_task_handle_t *task_handle,
736737
char **string_id
737738
);
738-
739+
#endif
739740

740741
/* --- 5o Process and Thread Settings ---------------------------------------- */
741742

@@ -813,15 +814,16 @@ typedef ompd_rc_t (*ompd_get_active_level_apifn_t) (
813814
* the OMPD and OMPT versions is that the OMPD must supply a parallel region
814815
* handle to provide a context for these inquiries.
815816
*/
816-
ompd_rc_t ompd_get_parallel_id(
817+
ompd_rc_t ompd_get_parallel_data(
817818
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
818-
ompd_parallel_id_t *id /* OUT: OpenMP parallel id */
819+
ompd_address_t *data /* OUT: OpenMP parallel id */
819820
);
820-
typedef ompd_rc_t (*ompd_get_parallel_id_apifn_t) (
821+
typedef ompd_rc_t (*ompd_get_parallel_data_apifn_t) (
821822
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
822-
ompd_parallel_id_t *id /* OUT: OpenMP parallel id */
823+
ompd_address_t *data /* OUT: OpenMP parallel id */
823824
);
824825

826+
#if 0
825827
ompd_rc_t ompd_get_parallel_function(
826828
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
827829
ompd_address_t *parallel_addr /* OUT: first instruction in the parallel region */
@@ -830,6 +832,7 @@ typedef ompd_rc_t (*ompd_get_parallel_function_apifn_t) (
830832
ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
831833
ompd_address_t *parallel_addr /* OUT: first instruction in the parallel region */
832834
);
835+
#endif
833836

834837
/* --- 7 Thread Inquiry ----------------------------------------------------- */
835838
/* --- 7.1 Operating System Thread Inquiry ---------------------------------- */
@@ -920,7 +923,7 @@ typedef ompd_rc_t (*ompd_get_state_apifn_t) (
920923
* corresponds to the body of code executed by the task.
921924
*/
922925

923-
926+
#if 0
924927
ompd_rc_t ompd_get_task_function(
925928
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle*/
926929
ompd_address_t *entry_point /* OUT: first instruction in the task region */
@@ -929,7 +932,7 @@ typedef ompd_rc_t (*ompd_get_task_function_apifn_t) (
929932
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle*/
930933
ompd_address_t *entry_point /* OUT: first instruction in the task region */
931934
);
932-
935+
#endif
933936

934937
/* --- 8.2 Task Settings ---------------------------------------------------- */
935938

@@ -1035,7 +1038,7 @@ typedef ompd_rc_t (*ompd_is_implicit_apifn_t) (
10351038

10361039
/**
10371040
* The functions defined here are third-party versions of ompt_get_task_frame
1038-
* and ompt_get_task_id. The only difference between the OMPD and OMPT
1041+
* and ompt_get_task_data. The only difference between the OMPD and OMPT
10391042
* counterparts is that the OMPD version must supply a task handle to provide a
10401043
* context for these inquiries.
10411044
*/
@@ -1068,13 +1071,13 @@ typedef ompd_rc_t (*ompd_get_task_frame_apifn_t) (
10681071
ompd_address_t *sp_reentry /* OUT: previous frame is user code */
10691072
);
10701073

1071-
ompd_rc_t ompd_get_task_id(
1074+
ompd_rc_t ompd_get_task_data(
10721075
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle */
1073-
ompd_task_id_t *task_id /* OUT: OpenMP task ID */
1076+
ompd_address_t *task_data /* OUT: OpenMP task ID */
10741077
);
1075-
typedef ompd_rc_t (*ompd_get_task_id_apifn_t) (
1078+
typedef ompd_rc_t (*ompd_get_task_data_apifn_t) (
10761079
ompd_task_handle_t *task_handle, /* IN: OpenMP task handle */
1077-
ompd_task_id_t *task_id /* OUT: OpenMP task ID */
1080+
ompd_address_t *task_data /* OUT: OpenMP task ID */
10781081
);
10791082

10801083

0 commit comments

Comments
 (0)