Index: openmp/trunk/runtime/src/include/50/ompt.h.var =================================================================== --- openmp/trunk/runtime/src/include/50/ompt.h.var +++ openmp/trunk/runtime/src/include/50/ompt.h.var @@ -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 @@ * 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 @@ ); /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ ); /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 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 @@ 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 @@ 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_initialize, ( - ompt_function_lookup_t ompt_fn_lookup, + ompt_function_lookup_t lookup, ompt_data_t *tool_data )); @@ -673,6 +708,9 @@ /* 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 Index: openmp/trunk/runtime/src/kmp_barrier.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_barrier.cpp +++ openmp/trunk/runtime/src/kmp_barrier.cpp @@ -1223,7 +1223,7 @@ 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 @@ 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) && Index: openmp/trunk/runtime/src/kmp_cancel.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_cancel.cpp +++ openmp/trunk/runtime/src/kmp_cancel.cpp @@ -65,7 +65,7 @@ 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 @@ 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)( Index: openmp/trunk/runtime/src/kmp_csupport.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_csupport.cpp +++ openmp/trunk/runtime/src/kmp_csupport.cpp @@ -513,7 +513,7 @@ 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 @@ #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 Index: openmp/trunk/runtime/src/kmp_runtime.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_runtime.cpp +++ openmp/trunk/runtime/src/kmp_runtime.cpp @@ -1225,7 +1225,8 @@ 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 @@ #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); Index: openmp/trunk/runtime/src/kmp_sched.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_sched.cpp +++ openmp/trunk/runtime/src/kmp_sched.cpp @@ -68,7 +68,7 @@ #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; Index: openmp/trunk/runtime/src/kmp_taskdeps.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_taskdeps.cpp +++ openmp/trunk/runtime/src/kmp_taskdeps.cpp @@ -508,26 +508,26 @@ 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)( Index: openmp/trunk/runtime/src/kmp_tasking.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_tasking.cpp +++ openmp/trunk/runtime/src/kmp_tasking.cpp @@ -473,7 +473,7 @@ 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 @@ // 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 @@ 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 @@ return __kmpc_omp_taskwait_template(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 Index: openmp/trunk/runtime/src/ompt-event-specific.h =================================================================== --- openmp/trunk/runtime/src/ompt-event-specific.h +++ openmp/trunk/runtime/src/ompt-event-specific.h @@ -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 Index: openmp/trunk/runtime/src/ompt-general.cpp =================================================================== --- openmp/trunk/runtime/src/ompt-general.cpp +++ openmp/trunk/runtime/src/ompt-general.cpp @@ -351,7 +351,7 @@ 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 @@ 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 @@ return __ompt_get_unique_id_internal(); } +OMPT_API_ROUTINE void ompt_finalize_tool(void) { + // stub +} + /***************************************************************************** * Target ****************************************************************************/ Index: openmp/trunk/runtime/src/ompt-internal.h =================================================================== --- openmp/trunk/runtime/src/ompt-internal.h +++ openmp/trunk/runtime/src/ompt-internal.h @@ -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 Index: openmp/trunk/runtime/src/ompt-specific.h =================================================================== --- openmp/trunk/runtime/src/ompt-specific.h +++ openmp/trunk/runtime/src/ompt-specific.h @@ -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 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; } Index: openmp/trunk/runtime/test/ompt/callback.h =================================================================== --- openmp/trunk/runtime/test/ompt/callback.h +++ openmp/trunk/runtime/test/ompt/callback.h @@ -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_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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } } -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 @@ 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 Index: openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c =================================================================== --- openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c +++ openmp/trunk/runtime/test/ompt/cancel/cancel_worksharing.c @@ -58,9 +58,9 @@ // 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; Index: openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c =================================================================== --- openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c +++ openmp/trunk/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c @@ -70,7 +70,7 @@ 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"); Index: openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c =================================================================== --- openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c +++ openmp/trunk/runtime/test/ompt/synchronization/barrier/implicit_task_data.c @@ -14,7 +14,7 @@ #include #include -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 @@ 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 @@ 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,