[Openmp-commits] [openmp] r341834 - [OMPT] Update types according to TR7
Joachim Protze via Openmp-commits
openmp-commits at lists.llvm.org
Mon Sep 10 07:34:54 PDT 2018
Author: jprotze
Date: Mon Sep 10 07:34:54 2018
New Revision: 341834
URL: http://llvm.org/viewvc/llvm-project?rev=341834&view=rev
Log:
[OMPT] Update types according to TR7
Some types and callback signatures have changed from TR6 to TR7.
Major changes (only adding signatures and stubs):
(-remove idle callback) done by D48362
-add reduction and dispatch callback
-add get_task_memory and finalize_tool runtime entry points
-ompt_invoker_t becomes ompt_parallel_flag_t
-more types of sync_regions
Patch provided by Simon Convent
Reviewers: hbae, protze.joachim
Differential Revision: https://reviews.llvm.org/D50774
Modified:
openmp/trunk/runtime/src/include/50/ompt.h.var
openmp/trunk/runtime/src/kmp_barrier.cpp
openmp/trunk/runtime/src/kmp_cancel.cpp
openmp/trunk/runtime/src/kmp_csupport.cpp
openmp/trunk/runtime/src/kmp_runtime.cpp
openmp/trunk/runtime/src/kmp_sched.cpp
openmp/trunk/runtime/src/kmp_taskdeps.cpp
openmp/trunk/runtime/src/kmp_tasking.cpp
openmp/trunk/runtime/src/ompt-event-specific.h
openmp/trunk/runtime/src/ompt-general.cpp
openmp/trunk/runtime/src/ompt-internal.h
openmp/trunk/runtime/src/ompt-specific.h
openmp/trunk/runtime/test/ompt/callback.h
openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c
openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c
openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
Modified: openmp/trunk/runtime/src/include/50/ompt.h.var
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/include/50/ompt.h.var?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/include/50/ompt.h.var (original)
+++ openmp/trunk/runtime/src/include/50/ompt.h.var Mon Sep 10 07:34:54 2018
@@ -38,8 +38,10 @@
\
macro (ompt_get_parallel_info) \
macro (ompt_get_task_info) \
+ macro (ompt_get_task_memory) \
macro (ompt_get_thread_data) \
macro (ompt_get_unique_id) \
+ macro (ompt_finalize_tool) \
\
macro(ompt_get_num_procs) \
macro(ompt_get_num_places) \
@@ -151,6 +153,10 @@
macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \
\
macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \
+ \
+ macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \
+ \
+ macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */
@@ -191,16 +197,17 @@ typedef struct omp_frame_t {
* dependences types
*---------------------*/
-typedef enum ompt_task_dependence_flag_t {
+typedef enum ompt_task_dependence_type_t {
// a two bit field for the dependence type
- ompt_task_dependence_type_out = 1,
- ompt_task_dependence_type_in = 2,
- ompt_task_dependence_type_inout = 3,
-} ompt_task_dependence_flag_t;
+ ompt_task_dependence_type_in = 1,
+ ompt_task_dependence_type_out = 2,
+ ompt_task_dependence_type_inout = 3,
+ ompt_task_dependence_type_mutexinoutset = 4
+} ompt_task_dependence_type_t;
typedef struct ompt_task_dependence_t {
void *variable_addr;
- unsigned int dependence_flags;
+ ompt_task_dependence_type_t dependence_type;
} ompt_task_dependence_t;
@@ -264,20 +271,22 @@ typedef ompt_interface_fn_t (*ompt_funct
);
/* threads */
-typedef enum ompt_thread_type_t {
+typedef enum ompt_thread_t {
ompt_thread_initial = 1, // start the enumeration at 1
ompt_thread_worker = 2,
ompt_thread_other = 3,
ompt_thread_unknown = 4
-} ompt_thread_type_t;
+} ompt_thread_t;
-typedef enum ompt_invoker_t {
- ompt_invoker_program = 1, /* program invokes master task */
- ompt_invoker_runtime = 2 /* runtime invokes master task */
-} ompt_invoker_t;
+typedef enum ompt_parallel_flag_t {
+ ompt_parallel_invoker_program = 0x00000001, /* program invokes master task */
+ ompt_parallel_invoker_runtime = 0x00000002, /* runtime invokes master task */
+ ompt_parallel_league = 0x40000000,
+ ompt_parallel_team = 0x80000000
+} ompt_parallel_flag_t;
typedef void (*ompt_callback_thread_begin_t) (
- ompt_thread_type_t thread_type, /* type of thread */
+ ompt_thread_t thread_type, /* type of thread */
ompt_data_t *thread_data /* data of thread */
);
@@ -301,8 +310,8 @@ typedef void (*ompt_callback_implicit_ta
ompt_scope_endpoint_t endpoint, /* endpoint of implicit task */
ompt_data_t *parallel_data, /* data of parallel region */
ompt_data_t *task_data, /* data of implicit task */
- unsigned int team_size, /* team size */
- unsigned int thread_num /* thread number of calling thread */
+ unsigned int actual_parallelism, /* team size */
+ unsigned int index /* thread number of calling thread */
);
typedef void (*ompt_callback_parallel_begin_t) (
@@ -310,19 +319,19 @@ typedef void (*ompt_callback_parallel_be
const omp_frame_t *encountering_task_frame, /* frame data of encountering task */
ompt_data_t *parallel_data, /* data of parallel region */
unsigned int requested_team_size, /* requested number of threads in team */
- ompt_invoker_t invoker, /* invoker of master task */
+ int flag, /* flag for additional information */
const void *codeptr_ra /* return address of runtime call */
);
typedef void (*ompt_callback_parallel_end_t) (
ompt_data_t *parallel_data, /* data of parallel region */
ompt_data_t *encountering_task_data, /* data of encountering task */
- ompt_invoker_t invoker, /* invoker of master task */
+ int flag, /* flag for additional information */
const void *codeptr_ra /* return address of runtime call */
);
/* tasks */
-typedef enum ompt_task_type_t {
+typedef enum ompt_task_flag_t {
ompt_task_initial = 0x1,
ompt_task_implicit = 0x2,
ompt_task_explicit = 0x4,
@@ -332,13 +341,13 @@ typedef enum ompt_task_type_t {
ompt_task_final = 0x20000000,
ompt_task_mergeable = 0x40000000,
ompt_task_merged = 0x80000000
-} ompt_task_type_t;
+} ompt_task_flag_t;
typedef enum ompt_task_status_t {
ompt_task_complete = 1,
ompt_task_yield = 2,
ompt_task_cancel = 3,
- ompt_task_others = 4
+ ompt_task_switch = 4
} ompt_task_status_t;
typedef void (*ompt_callback_task_schedule_t) (
@@ -351,7 +360,7 @@ typedef void (*ompt_callback_task_create
ompt_data_t *encountering_task_data, /* data of parent task */
const omp_frame_t *encountering_task_frame, /* frame data for parent task */
ompt_data_t *new_task_data, /* data of created task */
- int type, /* type of created task */
+ int flag, /* type of created task */
int has_dependences, /* created task has dependences */
const void *codeptr_ra /* return address of runtime call */
);
@@ -369,15 +378,15 @@ typedef void (*ompt_callback_task_depend
);
/* target and device */
-typedef enum ompt_target_type_t {
+typedef enum ompt_target_t {
ompt_target = 1,
ompt_target_enter_data = 2,
ompt_target_exit_data = 3,
ompt_target_update = 4
-} ompt_target_type_t;
+} ompt_target_t;
typedef void (*ompt_callback_target_t) (
- ompt_target_type_t kind,
+ ompt_target_t kind,
ompt_scope_endpoint_t endpoint,
uint64_t device_num,
ompt_data_t *task_data,
@@ -396,14 +405,18 @@ typedef void (*ompt_callback_target_data
ompt_id_t target_id,
ompt_id_t host_op_id,
ompt_target_data_op_t optype,
- void *host_addr,
- void *device_addr,
- size_t bytes
+ void *src_addr,
+ int src_device_num,
+ void *dest_addr,
+ int dest_device_num,
+ size_t bytes,
+ const void *codeptr_ra
);
typedef void (*ompt_callback_target_submit_t) (
ompt_id_t target_id,
- ompt_id_t host_op_id
+ ompt_id_t host_op_id,
+ unsigned int requested_num_teams
);
typedef void (*ompt_callback_target_map_t) (
@@ -412,7 +425,8 @@ typedef void (*ompt_callback_target_map_
void **host_addr,
void **device_addr,
size_t *bytes,
- unsigned int *mapping_flags
+ unsigned int *mapping_flags,
+ const void *codeptr_ra
);
typedef void (*ompt_callback_device_initialize_t) (
@@ -453,32 +467,31 @@ typedef int (*ompt_callback_control_tool
const void *codeptr_ra /* return address of runtime call */
);
-typedef enum ompt_mutex_kind_t {
- ompt_mutex = 0x10,
- ompt_mutex_lock = 0x11,
- ompt_mutex_nest_lock = 0x12,
- ompt_mutex_critical = 0x13,
- ompt_mutex_atomic = 0x14,
- ompt_mutex_ordered = 0x20
-} ompt_mutex_kind_t;
+typedef enum ompt_mutex_t {
+ ompt_mutex_lock = 1,
+ ompt_mutex_nest_lock = 2,
+ ompt_mutex_critical = 3,
+ ompt_mutex_atomic = 4,
+ ompt_mutex_ordered = 5
+} ompt_mutex_t;
typedef void (*ompt_callback_mutex_acquire_t) (
- ompt_mutex_kind_t kind, /* mutex kind */
+ ompt_mutex_t kind, /* mutex kind */
unsigned int hint, /* mutex hint */
unsigned int impl, /* mutex implementation */
- omp_wait_id_t wait_id, /* id of object being awaited */
+ omp_wait_id_t wait_id, /* id of object being awaited */
const void *codeptr_ra /* return address of runtime call */
);
typedef void (*ompt_callback_mutex_t) (
- ompt_mutex_kind_t kind, /* mutex kind */
- omp_wait_id_t wait_id, /* id of object being awaited */
+ ompt_mutex_t kind, /* mutex kind */
+ omp_wait_id_t wait_id, /* id of object being awaited */
const void *codeptr_ra /* return address of runtime call */
);
typedef void (*ompt_callback_nest_lock_t) (
ompt_scope_endpoint_t endpoint, /* endpoint of nested lock */
- omp_wait_id_t wait_id, /* id of object being awaited */
+ omp_wait_id_t wait_id, /* id of object being awaited */
const void *codeptr_ra /* return address of runtime call */
);
@@ -489,7 +502,7 @@ typedef void (*ompt_callback_master_t) (
const void *codeptr_ra /* return address of runtime call */
);
-typedef enum ompt_work_type_t {
+typedef enum ompt_work_t {
ompt_work_loop = 1,
ompt_work_sections = 2,
ompt_work_single_executor = 3,
@@ -497,10 +510,10 @@ typedef enum ompt_work_type_t {
ompt_work_workshare = 5,
ompt_work_distribute = 6,
ompt_work_taskloop = 7
-} ompt_work_type_t;
+} ompt_work_t;
typedef void (*ompt_callback_work_t) (
- ompt_work_type_t wstype, /* type of work region */
+ ompt_work_t wstype, /* type of work region */
ompt_scope_endpoint_t endpoint, /* endpoint of work region */
ompt_data_t *parallel_data, /* data of parallel region */
ompt_data_t *task_data, /* data of task */
@@ -508,14 +521,18 @@ typedef void (*ompt_callback_work_t) (
const void *codeptr_ra /* return address of runtime call */
);
-typedef enum ompt_sync_region_kind_t {
- ompt_sync_region_barrier = 1,
- ompt_sync_region_taskwait = 2,
- ompt_sync_region_taskgroup = 3
-} ompt_sync_region_kind_t;
+typedef enum ompt_sync_region_t {
+ ompt_sync_region_barrier = 1,
+ ompt_sync_region_barrier_implicit = 2,
+ ompt_sync_region_barrier_explicit = 3,
+ ompt_sync_region_barrier_implementation = 4,
+ ompt_sync_region_taskwait = 5,
+ ompt_sync_region_taskgroup = 6,
+ ompt_sync_region_reduction = 7
+} ompt_sync_region_t;
typedef void (*ompt_callback_sync_region_t) (
- ompt_sync_region_kind_t kind, /* kind of sync region */
+ ompt_sync_region_t kind, /* kind of sync region */
ompt_scope_endpoint_t endpoint, /* endpoint of sync region */
ompt_data_t *parallel_data, /* data of parallel region */
ompt_data_t *task_data, /* data of task */
@@ -523,10 +540,10 @@ typedef void (*ompt_callback_sync_region
);
typedef enum ompt_cancel_flag_t {
- ompt_cancel_parallel = 0x1,
- ompt_cancel_sections = 0x2,
- ompt_cancel_do = 0x4,
- ompt_cancel_taskgroup = 0x8,
+ ompt_cancel_parallel = 0x01,
+ ompt_cancel_sections = 0x02,
+ ompt_cancel_loop = 0x04,
+ ompt_cancel_taskgroup = 0x08,
ompt_cancel_activated = 0x10,
ompt_cancel_detected = 0x20,
ompt_cancel_discarded_task = 0x40
@@ -543,6 +560,18 @@ typedef void (*ompt_callback_flush_t) (
const void *codeptr_ra /* return address of runtime call */
);
+typedef enum ompt_dispatch_t {
+ ompt_dispatch_iteration = 1,
+ ompt_dispatch_section = 2
+} ompt_dispatch_t;
+
+typedef void (*ompt_callback_dispatch_t) (
+ ompt_data_t *parallel_data,
+ ompt_data_t *task_data,
+ ompt_dispatch_t kind,
+ ompt_data_t instance
+);
+
/****************************************************************************
* ompt API
***************************************************************************/
@@ -587,6 +616,12 @@ OMPT_API_FUNCTION(int, ompt_get_task_inf
int *thread_num
));
+OMPT_API_FUNCTION(int, ompt_get_task_memory, (
+ void **addr,
+ size_t *size,
+ int block
+));
+
/* procs */
OMPT_API_FUNCTION(int, ompt_get_num_procs, (void));
@@ -615,7 +650,7 @@ OMPT_API_FUNCTION(int, ompt_get_proc_id,
***************************************************************************/
OMPT_API_FUNCTION(int, ompt_initialize, (
- ompt_function_lookup_t ompt_fn_lookup,
+ ompt_function_lookup_t lookup,
ompt_data_t *tool_data
));
@@ -673,6 +708,9 @@ OMPT_API_FUNCTION(int, ompt_enumerate_mu
/* get_unique_id */
OMPT_API_FUNCTION(uint64_t, ompt_get_unique_id, (void));
+/* finalize tool */
+OMPT_API_FUNCTION(void, ompt_finalize_tool, (void));
+
#ifdef __cplusplus
};
#endif
Modified: openmp/trunk/runtime/src/kmp_barrier.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_barrier.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_barrier.cpp (original)
+++ openmp/trunk/runtime/src/kmp_barrier.cpp Mon Sep 10 07:34:54 2018
@@ -1223,7 +1223,7 @@ int __kmp_barrier(enum barrier_type bt,
kmp_info_t *this_thr = __kmp_threads[gtid];
kmp_team_t *team = this_thr->th.th_team;
int status = 0;
-#if OMPT_SUPPORT
+#if OMPT_SUPPORT && OMPT_OPTIONAL
ompt_data_t *my_task_data;
ompt_data_t *my_parallel_data;
void *return_address;
@@ -1599,10 +1599,10 @@ void __kmp_join_barrier(int gtid) {
ANNOTATE_BARRIER_BEGIN(&team->t.t_bar);
#if OMPT_SUPPORT
- ompt_data_t *my_task_data;
- ompt_data_t *my_parallel_data;
if (ompt_enabled.enabled) {
#if OMPT_OPTIONAL
+ ompt_data_t *my_task_data;
+ ompt_data_t *my_parallel_data;
void *codeptr = NULL;
int ds_tid = this_thr->th.th_info.ds.ds_tid;
if (KMP_MASTER_TID(ds_tid) &&
Modified: openmp/trunk/runtime/src/kmp_cancel.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_cancel.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_cancel.cpp (original)
+++ openmp/trunk/runtime/src/kmp_cancel.cpp Mon Sep 10 07:34:54 2018
@@ -65,7 +65,7 @@ kmp_int32 __kmpc_cancel(ident_t *loc_ref
if (cncl_kind == cancel_parallel)
type = ompt_cancel_parallel;
else if (cncl_kind == cancel_loop)
- type = ompt_cancel_do;
+ type = ompt_cancel_loop;
else if (cncl_kind == cancel_sections)
type = ompt_cancel_sections;
ompt_callbacks.ompt_callback(ompt_callback_cancel)(
@@ -172,7 +172,7 @@ kmp_int32 __kmpc_cancellationpoint(ident
if (cncl_kind == cancel_parallel)
type = ompt_cancel_parallel;
else if (cncl_kind == cancel_loop)
- type = ompt_cancel_do;
+ type = ompt_cancel_loop;
else if (cncl_kind == cancel_sections)
type = ompt_cancel_sections;
ompt_callbacks.ompt_callback(ompt_callback_cancel)(
Modified: openmp/trunk/runtime/src/kmp_csupport.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.cpp (original)
+++ openmp/trunk/runtime/src/kmp_csupport.cpp Mon Sep 10 07:34:54 2018
@@ -513,7 +513,7 @@ void __kmpc_end_serialized_parallel(iden
if (ompt_enabled.ompt_callback_parallel_end) {
ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
&(serial_team->t.ompt_team_info.parallel_data), parent_task_data,
- ompt_invoker_program, OMPT_LOAD_RETURN_ADDRESS(global_tid));
+ ompt_parallel_invoker_program, OMPT_LOAD_RETURN_ADDRESS(global_tid));
}
__ompt_lw_taskteam_unlink(this_thr);
this_thr->th.ompt_thread_info.state = omp_state_overhead;
@@ -1782,7 +1782,7 @@ void __kmpc_for_static_fini(ident_t *loc
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_work) {
- ompt_work_type_t ompt_work_type = ompt_work_loop;
+ ompt_work_t ompt_work_type = ompt_work_loop;
ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);
ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
// Determine workshare type
Modified: openmp/trunk/runtime/src/kmp_runtime.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.cpp (original)
+++ openmp/trunk/runtime/src/kmp_runtime.cpp Mon Sep 10 07:34:54 2018
@@ -1225,7 +1225,8 @@ void __kmp_serialized_parallel(ident_t *
ompt_callbacks.ompt_callback(ompt_callback_parallel_begin)(
&(parent_task_info->task_data), &(parent_task_info->frame),
- &ompt_parallel_data, team_size, ompt_invoker_program, codeptr);
+ &ompt_parallel_data, team_size, ompt_parallel_invoker_program,
+ codeptr);
}
}
#endif // OMPT_SUPPORT
@@ -3824,7 +3825,7 @@ int __kmp_register_root(int initial_thre
#if OMPT_SUPPORT
if (!initial_thread && ompt_enabled.enabled) {
- ompt_thread_t *root_thread = ompt_get_thread();
+ kmp_info_t *root_thread = ompt_get_thread();
ompt_set_thread_state(root_thread, omp_state_overhead);
Modified: openmp/trunk/runtime/src/kmp_sched.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_sched.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_sched.cpp (original)
+++ openmp/trunk/runtime/src/kmp_sched.cpp Mon Sep 10 07:34:54 2018
@@ -68,7 +68,7 @@ static void __kmp_for_static_init(ident_
#if OMPT_SUPPORT && OMPT_OPTIONAL
ompt_team_info_t *team_info = NULL;
ompt_task_info_t *task_info = NULL;
- ompt_work_type_t ompt_work_type = ompt_work_loop;
+ ompt_work_t ompt_work_type = ompt_work_loop;
static kmp_int8 warn = 0;
Modified: openmp/trunk/runtime/src/kmp_taskdeps.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_taskdeps.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_taskdeps.cpp (original)
+++ openmp/trunk/runtime/src/kmp_taskdeps.cpp Mon Sep 10 07:34:54 2018
@@ -508,26 +508,26 @@ kmp_int32 __kmpc_omp_task_with_deps(iden
new_taskdata->ompt_task_info.deps[i].variable_addr =
(void *)dep_list[i].base_addr;
if (dep_list[i].flags.in && dep_list[i].flags.out)
- new_taskdata->ompt_task_info.deps[i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[i].dependence_type =
ompt_task_dependence_type_inout;
else if (dep_list[i].flags.out)
- new_taskdata->ompt_task_info.deps[i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[i].dependence_type =
ompt_task_dependence_type_out;
else if (dep_list[i].flags.in)
- new_taskdata->ompt_task_info.deps[i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[i].dependence_type =
ompt_task_dependence_type_in;
}
for (i = 0; i < ndeps_noalias; i++) {
new_taskdata->ompt_task_info.deps[ndeps + i].variable_addr =
(void *)noalias_dep_list[i].base_addr;
if (noalias_dep_list[i].flags.in && noalias_dep_list[i].flags.out)
- new_taskdata->ompt_task_info.deps[ndeps + i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type =
ompt_task_dependence_type_inout;
else if (noalias_dep_list[i].flags.out)
- new_taskdata->ompt_task_info.deps[ndeps + i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type =
ompt_task_dependence_type_out;
else if (noalias_dep_list[i].flags.in)
- new_taskdata->ompt_task_info.deps[ndeps + i].dependence_flags =
+ new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type =
ompt_task_dependence_type_in;
}
ompt_callbacks.ompt_callback(ompt_callback_task_dependences)(
Modified: openmp/trunk/runtime/src/kmp_tasking.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_tasking.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_tasking.cpp (original)
+++ openmp/trunk/runtime/src/kmp_tasking.cpp Mon Sep 10 07:34:54 2018
@@ -473,7 +473,7 @@ static inline void __ompt_task_start(kmp
kmp_taskdata_t *current_task,
kmp_int32 gtid) {
kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
- ompt_task_status_t status = ompt_task_others;
+ ompt_task_status_t status = ompt_task_switch;
if (__kmp_threads[gtid]->th.ompt_thread_info.ompt_task_yielded) {
status = ompt_task_yield;
__kmp_threads[gtid]->th.ompt_thread_info.ompt_task_yielded = 0;
@@ -1586,7 +1586,7 @@ kmp_int32 __kmpc_omp_task(ident_t *loc_r
// Scheduling back to the parent task.
__ompt_task_finish(new_task,
new_taskdata->ompt_task_info.scheduling_parent,
- ompt_task_others);
+ ompt_task_switch);
new_taskdata->ompt_task_info.frame.exit_frame = NULL;
}
}
@@ -1766,7 +1766,7 @@ static kmp_int32 __kmpc_omp_taskwait_tem
return TASK_CURRENT_NOT_QUEUED;
}
-#if OMPT_SUPPORT
+#if OMPT_SUPPORT && OMPT_OPTIONAL
OMPT_NOINLINE
static kmp_int32 __kmpc_omp_taskwait_ompt(ident_t *loc_ref, kmp_int32 gtid,
void *frame_address,
@@ -1774,7 +1774,7 @@ static kmp_int32 __kmpc_omp_taskwait_omp
return __kmpc_omp_taskwait_template<true>(loc_ref, gtid, frame_address,
return_address);
}
-#endif // OMPT_SUPPORT
+#endif // OMPT_SUPPORT && OMPT_OPTIONAL
// __kmpc_omp_taskwait: Wait until all tasks generated by the current task are
// complete
Modified: openmp/trunk/runtime/src/ompt-event-specific.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-event-specific.h?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-event-specific.h (original)
+++ openmp/trunk/runtime/src/ompt-event-specific.h Mon Sep 10 07:34:54 2018
@@ -105,4 +105,8 @@
#define ompt_callback_cancel_implemented ompt_event_MAY_ALWAYS_OPTIONAL
+#define ompt_callback_reduction_implemented ompt_event_UNIMPLEMENTED
+
+#define ompt_callback_dispatch_implemented ompt_event_UNIMPLEMENTED
+
#endif
Modified: openmp/trunk/runtime/src/ompt-general.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-general.cpp?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-general.cpp (original)
+++ openmp/trunk/runtime/src/ompt-general.cpp Mon Sep 10 07:34:54 2018
@@ -351,7 +351,7 @@ void ompt_post_init() {
return;
}
- ompt_thread_t *root_thread = ompt_get_thread();
+ kmp_info_t *root_thread = ompt_get_thread();
ompt_set_thread_state(root_thread, omp_state_overhead);
@@ -509,6 +509,12 @@ OMPT_API_ROUTINE int ompt_get_task_info(
task_frame, parallel_data, thread_num);
}
+OMPT_API_ROUTINE int ompt_get_task_memory(void **addr, size_t *size,
+ int block) {
+ // stub
+ return 0;
+}
+
/*****************************************************************************
* num_procs
****************************************************************************/
@@ -678,6 +684,10 @@ OMPT_API_ROUTINE uint64_t ompt_get_uniqu
return __ompt_get_unique_id_internal();
}
+OMPT_API_ROUTINE void ompt_finalize_tool(void) {
+ // stub
+}
+
/*****************************************************************************
* Target
****************************************************************************/
Modified: openmp/trunk/runtime/src/ompt-internal.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-internal.h?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-internal.h (original)
+++ openmp/trunk/runtime/src/ompt-internal.h Mon Sep 10 07:34:54 2018
@@ -22,7 +22,8 @@
#define _OMP_EXTERN extern "C"
#define OMPT_INVOKER(x) \
- ((x == fork_context_gnu) ? ompt_invoker_program : ompt_invoker_runtime)
+ ((x == fork_context_gnu) ? ompt_parallel_invoker_program \
+ : ompt_parallel_invoker_runtime)
#define ompt_callback(e) e##_callback
Modified: openmp/trunk/runtime/src/ompt-specific.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-specific.h?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-specific.h (original)
+++ openmp/trunk/runtime/src/ompt-specific.h Mon Sep 10 07:34:54 2018
@@ -17,25 +17,19 @@
#include "kmp.h"
/*****************************************************************************
- * types
- ****************************************************************************/
-
-typedef kmp_info_t ompt_thread_t;
-
-/*****************************************************************************
* forward declarations
****************************************************************************/
void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid);
void __ompt_thread_assign_wait_id(void *variable);
-void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr,
+void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, kmp_info_t *thr,
int gtid, ompt_data_t *ompt_pid, void *codeptr);
-void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr,
+void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, kmp_info_t *thr,
int on_heap);
-void __ompt_lw_taskteam_unlink(ompt_thread_t *thr);
+void __ompt_lw_taskteam_unlink(kmp_info_t *thr);
ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size);
@@ -90,16 +84,16 @@ inline void *__ompt_load_return_address(
// inline functions
//******************************************************************************
-inline ompt_thread_t *ompt_get_thread_gtid(int gtid) {
+inline kmp_info_t *ompt_get_thread_gtid(int gtid) {
return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL;
}
-inline ompt_thread_t *ompt_get_thread() {
+inline kmp_info_t *ompt_get_thread() {
int gtid = __kmp_get_gtid();
return ompt_get_thread_gtid(gtid);
}
-inline void ompt_set_thread_state(ompt_thread_t *thread, omp_state_t state) {
+inline void ompt_set_thread_state(kmp_info_t *thread, omp_state_t state) {
thread->th.ompt_thread_info.state = state;
}
Modified: openmp/trunk/runtime/test/ompt/callback.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/callback.h?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/callback.h (original)
+++ openmp/trunk/runtime/test/ompt/callback.h Mon Sep 10 07:34:54 2018
@@ -14,7 +14,7 @@
// Used to detect architecture
#include "../../src/kmp_platform.h"
-static const char* ompt_thread_type_t_values[] = {
+static const char* ompt_thread_t_values[] = {
NULL,
"ompt_thread_initial",
"ompt_thread_worker",
@@ -31,7 +31,7 @@ static const char* ompt_task_status_t_va
static const char* ompt_cancel_flag_t_values[] = {
"ompt_cancel_parallel",
"ompt_cancel_sections",
- "ompt_cancel_do",
+ "ompt_cancel_loop",
"ompt_cancel_taskgroup",
"ompt_cancel_activated",
"ompt_cancel_detected",
@@ -194,7 +194,7 @@ ompt_label_##id:
static void
on_ompt_callback_mutex_acquire(
- ompt_mutex_kind_t kind,
+ ompt_mutex_t kind,
unsigned int hint,
unsigned int impl,
omp_wait_id_t wait_id,
@@ -224,7 +224,7 @@ on_ompt_callback_mutex_acquire(
static void
on_ompt_callback_mutex_acquired(
- ompt_mutex_kind_t kind,
+ ompt_mutex_t kind,
omp_wait_id_t wait_id,
const void *codeptr_ra)
{
@@ -252,7 +252,7 @@ on_ompt_callback_mutex_acquired(
static void
on_ompt_callback_mutex_released(
- ompt_mutex_kind_t kind,
+ ompt_mutex_t kind,
omp_wait_id_t wait_id,
const void *codeptr_ra)
{
@@ -297,7 +297,7 @@ on_ompt_callback_nest_lock(
static void
on_ompt_callback_sync_region(
- ompt_sync_region_kind_t kind,
+ ompt_sync_region_t kind,
ompt_scope_endpoint_t endpoint,
ompt_data_t *parallel_data,
ompt_data_t *task_data,
@@ -309,6 +309,9 @@ on_ompt_callback_sync_region(
switch(kind)
{
case ompt_sync_region_barrier:
+ case ompt_sync_region_barrier_implicit:
+ case ompt_sync_region_barrier_explicit:
+ case ompt_sync_region_barrier_implementation:
printf("%" PRIu64 ": ompt_event_barrier_begin: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, task_data->value, codeptr_ra);
print_ids(0);
break;
@@ -318,12 +321,17 @@ on_ompt_callback_sync_region(
case ompt_sync_region_taskgroup:
printf("%" PRIu64 ": ompt_event_taskgroup_begin: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, task_data->value, codeptr_ra);
break;
+ case ompt_sync_region_reduction:
+ break;
}
break;
case ompt_scope_end:
switch(kind)
{
case ompt_sync_region_barrier:
+ case ompt_sync_region_barrier_implicit:
+ case ompt_sync_region_barrier_explicit:
+ case ompt_sync_region_barrier_implementation:
printf("%" PRIu64 ": ompt_event_barrier_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, (parallel_data)?parallel_data->value:0, task_data->value, codeptr_ra);
break;
case ompt_sync_region_taskwait:
@@ -332,6 +340,8 @@ on_ompt_callback_sync_region(
case ompt_sync_region_taskgroup:
printf("%" PRIu64 ": ompt_event_taskgroup_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, (parallel_data)?parallel_data->value:0, task_data->value, codeptr_ra);
break;
+ case ompt_sync_region_reduction:
+ break;
}
break;
}
@@ -339,7 +349,7 @@ on_ompt_callback_sync_region(
static void
on_ompt_callback_sync_region_wait(
- ompt_sync_region_kind_t kind,
+ ompt_sync_region_t kind,
ompt_scope_endpoint_t endpoint,
ompt_data_t *parallel_data,
ompt_data_t *task_data,
@@ -351,6 +361,9 @@ on_ompt_callback_sync_region_wait(
switch(kind)
{
case ompt_sync_region_barrier:
+ case ompt_sync_region_barrier_implicit:
+ case ompt_sync_region_barrier_explicit:
+ case ompt_sync_region_barrier_implementation:
printf("%" PRIu64 ": ompt_event_wait_barrier_begin: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, task_data->value, codeptr_ra);
break;
case ompt_sync_region_taskwait:
@@ -359,12 +372,17 @@ on_ompt_callback_sync_region_wait(
case ompt_sync_region_taskgroup:
printf("%" PRIu64 ": ompt_event_wait_taskgroup_begin: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, task_data->value, codeptr_ra);
break;
+ case ompt_sync_region_reduction:
+ break;
}
break;
case ompt_scope_end:
switch(kind)
{
case ompt_sync_region_barrier:
+ case ompt_sync_region_barrier_implicit:
+ case ompt_sync_region_barrier_explicit:
+ case ompt_sync_region_barrier_implementation:
printf("%" PRIu64 ": ompt_event_wait_barrier_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, (parallel_data)?parallel_data->value:0, task_data->value, codeptr_ra);
break;
case ompt_sync_region_taskwait:
@@ -373,6 +391,8 @@ on_ompt_callback_sync_region_wait(
case ompt_sync_region_taskgroup:
printf("%" PRIu64 ": ompt_event_wait_taskgroup_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, (parallel_data)?parallel_data->value:0, task_data->value, codeptr_ra);
break;
+ case ompt_sync_region_reduction:
+ break;
}
break;
}
@@ -398,7 +418,7 @@ on_ompt_callback_cancel(
first_flag_value = ompt_cancel_flag_t_values[0];
else if(flags & ompt_cancel_sections)
first_flag_value = ompt_cancel_flag_t_values[1];
- else if(flags & ompt_cancel_do)
+ else if(flags & ompt_cancel_loop)
first_flag_value = ompt_cancel_flag_t_values[2];
else if(flags & ompt_cancel_taskgroup)
first_flag_value = ompt_cancel_flag_t_values[3];
@@ -437,7 +457,7 @@ on_ompt_callback_implicit_task(
static void
on_ompt_callback_lock_init(
- ompt_mutex_kind_t kind,
+ ompt_mutex_t kind,
unsigned int hint,
unsigned int impl,
omp_wait_id_t wait_id,
@@ -458,7 +478,7 @@ on_ompt_callback_lock_init(
static void
on_ompt_callback_lock_destroy(
- ompt_mutex_kind_t kind,
+ ompt_mutex_t kind,
omp_wait_id_t wait_id,
const void *codeptr_ra)
{
@@ -477,7 +497,7 @@ on_ompt_callback_lock_destroy(
static void
on_ompt_callback_work(
- ompt_work_type_t wstype,
+ ompt_work_t wstype,
ompt_scope_endpoint_t endpoint,
ompt_data_t *parallel_data,
ompt_data_t *task_data,
@@ -561,29 +581,30 @@ on_ompt_callback_master(
}
}
-static void
-on_ompt_callback_parallel_begin(
- ompt_data_t *encountering_task_data,
- const omp_frame_t *encountering_task_frame,
- ompt_data_t* parallel_data,
- uint32_t requested_team_size,
- ompt_invoker_t invoker,
- const void *codeptr_ra)
-{
+static void on_ompt_callback_parallel_begin(
+ ompt_data_t *encountering_task_data,
+ const omp_frame_t *encountering_task_frame, ompt_data_t *parallel_data,
+ uint32_t requested_team_size, int flag, const void *codeptr_ra) {
if(parallel_data->ptr)
printf("0: parallel_data initially not null\n");
parallel_data->value = ompt_get_unique_id();
- printf("%" PRIu64 ": ompt_event_parallel_begin: parent_task_id=%" PRIu64 ", parent_task_frame.exit=%p, parent_task_frame.reenter=%p, parallel_id=%" PRIu64 ", requested_team_size=%" PRIu32 ", codeptr_ra=%p, invoker=%d\n", ompt_get_thread_data()->value, encountering_task_data->value, encountering_task_frame->exit_frame, encountering_task_frame->enter_frame, parallel_data->value, requested_team_size, codeptr_ra, invoker);
-}
-
-static void
-on_ompt_callback_parallel_end(
- ompt_data_t *parallel_data,
- ompt_data_t *encountering_task_data,
- ompt_invoker_t invoker,
- const void *codeptr_ra)
-{
- printf("%" PRIu64 ": ompt_event_parallel_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", invoker=%d, codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, encountering_task_data->value, invoker, codeptr_ra);
+ printf("%" PRIu64 ": ompt_event_parallel_begin: parent_task_id=%" PRIu64
+ ", parent_task_frame.exit=%p, parent_task_frame.reenter=%p, "
+ "parallel_id=%" PRIu64 ", requested_team_size=%" PRIu32
+ ", codeptr_ra=%p, invoker=%d\n",
+ ompt_get_thread_data()->value, encountering_task_data->value,
+ encountering_task_frame->exit_frame,
+ encountering_task_frame->enter_frame, parallel_data->value,
+ requested_team_size, codeptr_ra, flag);
+}
+
+static void on_ompt_callback_parallel_end(ompt_data_t *parallel_data,
+ ompt_data_t *encountering_task_data,
+ int flag, const void *codeptr_ra) {
+ printf("%" PRIu64 ": ompt_event_parallel_end: parallel_id=%" PRIu64
+ ", task_id=%" PRIu64 ", invoker=%d, codeptr_ra=%p\n",
+ ompt_get_thread_data()->value, parallel_data->value,
+ encountering_task_data->value, flag, codeptr_ra);
}
static void
@@ -648,13 +669,13 @@ on_ompt_callback_task_dependence(
static void
on_ompt_callback_thread_begin(
- ompt_thread_type_t thread_type,
+ ompt_thread_t thread_type,
ompt_data_t *thread_data)
{
if(thread_data->ptr)
printf("%s\n", "0: thread_data initially not null");
thread_data->value = ompt_get_unique_id();
- printf("%" PRIu64 ": ompt_event_thread_begin: thread_type=%s=%d, thread_id=%" PRIu64 "\n", ompt_get_thread_data()->value, ompt_thread_type_t_values[thread_type], thread_type, thread_data->value);
+ printf("%" PRIu64 ": ompt_event_thread_begin: thread_type=%s=%d, thread_id=%" PRIu64 "\n", ompt_get_thread_data()->value, ompt_thread_t_values[thread_type], thread_type, thread_data->value);
}
static void
Modified: openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c (original)
+++ openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c Mon Sep 10 07:34:54 2018
@@ -58,9 +58,9 @@ int main()
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_task_create: parent_task_id=[[PARENT_TASK_ID:[0-9]+]], parent_task_frame.exit=[[NULL]], parent_task_frame.reenter=[[NULL]], new_task_id=[[TASK_ID:[0-9]+]], codeptr_ra=[[NULL]], task_type=ompt_task_initial=1, has_dependences=no
// cancel for and sections
- // CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_do|ompt_cancel_activated=20, codeptr_ra={{0x[0-f]*}}
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_loop|ompt_cancel_activated=20, codeptr_ra={{0x[0-f]*}}
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_sections|ompt_cancel_activated=18, codeptr_ra={{0x[0-f]*}}
- // CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_do|ompt_cancel_detected=36, codeptr_ra={{0x[0-f]*}}
+ // CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_loop|ompt_cancel_detected=36, codeptr_ra={{0x[0-f]*}}
// CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_sections|ompt_cancel_detected=34, codeptr_ra={{0x[0-f]*}}
return 0;
Modified: openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c (original)
+++ openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c Mon Sep 10 07:34:54 2018
@@ -70,7 +70,7 @@ ompt_start_tool_result_t* ompt_start_too
static void
on_ompt_callback_thread_begin(
- ompt_thread_type_t thread_type,
+ ompt_thread_t thread_type,
ompt_data_t *thread_data)
{
printf("0: ompt_event_thread_begin\n");
Modified: openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c?rev=341834&r1=341833&r2=341834&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c (original)
+++ openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c Mon Sep 10 07:34:54 2018
@@ -14,7 +14,7 @@
#include <omp.h>
#include <ompt.h>
-static const char* ompt_thread_type_t_values[] = {
+static const char* ompt_thread_t_values[] = {
NULL,
"ompt_thread_initial",
"ompt_thread_worker",
@@ -59,18 +59,18 @@ int main()
static void
on_ompt_callback_thread_begin(
- ompt_thread_type_t thread_type,
+ ompt_thread_t thread_type,
ompt_data_t *thread_data)
{
if(thread_data->ptr)
printf("%s\n", "0: thread_data initially not null");
thread_data->value = ompt_get_unique_id();
- printf("%" PRIu64 ": ompt_event_thread_begin: thread_type=%s=%d, thread_id=%" PRIu64 "\n", ompt_get_thread_data()->value, ompt_thread_type_t_values[thread_type], thread_type, thread_data->value);
+ printf("%" PRIu64 ": ompt_event_thread_begin: thread_type=%s=%d, thread_id=%" PRIu64 "\n", ompt_get_thread_data()->value, ompt_thread_t_values[thread_type], thread_type, thread_data->value);
}
static void
on_ompt_callback_sync_region(
- ompt_sync_region_kind_t kind,
+ ompt_sync_region_t kind,
ompt_scope_endpoint_t endpoint,
ompt_data_t *parallel_data,
ompt_data_t *task_data,
@@ -92,7 +92,7 @@ on_ompt_callback_sync_region(
static void
on_ompt_callback_sync_region_wait(
- ompt_sync_region_kind_t kind,
+ ompt_sync_region_t kind,
ompt_scope_endpoint_t endpoint,
ompt_data_t *parallel_data,
ompt_data_t *task_data,
More information about the Openmp-commits
mailing list