Index: openmp/runtime/src/include/omp-tools.h.var =================================================================== --- openmp/runtime/src/include/omp-tools.h.var +++ openmp/runtime/src/include/omp-tools.h.var @@ -20,6 +20,12 @@ #include #include +#ifdef DEPRECATION_WARNINGS +#define DEPRECATED_51 [[deprecated("as of 5.1")]] +#else +#define DEPRECATED_51 +#endif + /***************************************************************************** * iteration macros *****************************************************************************/ @@ -133,7 +139,7 @@ \ macro (ompt_callback_work, ompt_callback_work_t, 20) /* task at work begin or end */ \ \ - macro (ompt_callback_master, ompt_callback_master_t, 21) /* task at master begin or end */ \ + macro (ompt_callback_masked, ompt_callback_masked_t, 21) /* task at masked begin or end */ \ \ macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ \ \ @@ -153,7 +159,12 @@ \ macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \ \ - macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */ + macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */ \ + macro (ompt_callback_target_emi, ompt_callback_target_emi_t, 33) /* target */ \ + macro (ompt_callback_target_data_op_emi,ompt_callback_target_data_op_emi_t,34) /* target data op */ \ + macro (ompt_callback_target_submit_emi, ompt_callback_target_submit_emi_t, 35) /* target submit */ \ + macro (ompt_callback_target_map_emi, ompt_callback_target_map_emi_t, 36) /* target map */ \ + macro (ompt_callback_error, ompt_callback_error_t, 37) /* error */ /***************************************************************************** * implementation specific types @@ -190,7 +201,8 @@ ompt_callback_dependences = 18, ompt_callback_task_dependence = 19, ompt_callback_work = 20, - ompt_callback_master = 21, + ompt_callback_master DEPRECATED_51 = 21, + ompt_callback_masked = 21, ompt_callback_target_map = 22, ompt_callback_sync_region = 23, ompt_callback_lock_init = 24, @@ -201,7 +213,12 @@ ompt_callback_flush = 29, ompt_callback_cancel = 30, ompt_callback_reduction = 31, - ompt_callback_dispatch = 32 + ompt_callback_dispatch = 32, + ompt_callback_target_emi = 33, + ompt_callback_target_data_op_emi = 34, + ompt_callback_target_submit_emi = 35, + ompt_callback_target_map_emi = 36, + ompt_callback_error = 37 } ompt_callbacks_t; typedef enum ompt_record_t { @@ -239,7 +256,8 @@ typedef enum ompt_scope_endpoint_t { ompt_scope_begin = 1, - ompt_scope_end = 2 + ompt_scope_end = 2, + ompt_scope_beginend = 3 } ompt_scope_endpoint_t; typedef enum ompt_dispatch_t { @@ -248,22 +266,29 @@ } ompt_dispatch_t; typedef enum ompt_sync_region_t { - ompt_sync_region_barrier = 1, - ompt_sync_region_barrier_implicit = 2, + ompt_sync_region_barrier DEPRECATED_51 = 1, + ompt_sync_region_barrier_implicit DEPRECATED_51 = 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_reduction = 7, + ompt_sync_region_barrier_implicit_workshare = 8, + ompt_sync_region_barrier_implicit_parallel = 9, + ompt_sync_region_barrier_teams = 10 } ompt_sync_region_t; typedef enum ompt_target_data_op_t { - ompt_target_data_alloc = 1, - ompt_target_data_transfer_to_device = 2, - ompt_target_data_transfer_from_device = 3, - ompt_target_data_delete = 4, - ompt_target_data_associate = 5, - ompt_target_data_disassociate = 6 + ompt_target_data_alloc = 1, + ompt_target_data_transfer_to_device = 2, + ompt_target_data_transfer_from_device = 3, + ompt_target_data_delete = 4, + ompt_target_data_associate = 5, + ompt_target_data_disassociate = 6, + ompt_target_data_alloc_async = 17, + ompt_target_data_transfer_to_device_async = 18, + ompt_target_data_transfer_from_device_async = 19, + ompt_target_data_delete_async = 20 } ompt_target_data_op_t; typedef enum ompt_work_t { @@ -273,7 +298,8 @@ ompt_work_single_other = 4, ompt_work_workshare = 5, ompt_work_distribute = 6, - ompt_work_taskloop = 7 + ompt_work_taskloop = 7, + ompt_work_scope = 8 } ompt_work_t; typedef enum ompt_mutex_t { @@ -302,6 +328,7 @@ ompt_task_implicit = 0x00000002, ompt_task_explicit = 0x00000004, ompt_task_target = 0x00000008, + ompt_task_taskwait = 0x00000010, ompt_task_undeferred = 0x08000000, ompt_task_untied = 0x10000000, ompt_task_final = 0x20000000, @@ -316,14 +343,19 @@ ompt_task_detach = 4, ompt_task_early_fulfill = 5, ompt_task_late_fulfill = 6, - ompt_task_switch = 7 + ompt_task_switch = 7, + ompt_taskwait_complete = 8 } ompt_task_status_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_update = 4, + ompt_target_nowait = 9, + ompt_target_enter_data_nowait = 10, + ompt_target_exit_data_nowait = 11, + ompt_target_update_nowait = 12 } ompt_target_t; typedef enum ompt_parallel_flag_t { @@ -348,9 +380,15 @@ ompt_dependence_type_inout = 3, ompt_dependence_type_mutexinoutset = 4, ompt_dependence_type_source = 5, - ompt_dependence_type_sink = 6 + ompt_dependence_type_sink = 6, + ompt_dependence_type_inoutset = 7 } ompt_dependence_type_t; +typedef enum ompt_severity_t { + ompt_warning = 1, + ompt_fatal = 2 +} ompt_severity_t; + typedef enum ompt_cancel_flag_t { ompt_cancel_parallel = 0x01, ompt_cancel_sections = 0x02, @@ -378,11 +416,13 @@ ompt_state_work_parallel = 0x001, ompt_state_work_reduction = 0x002, - ompt_state_wait_barrier = 0x010, + ompt_state_wait_barrier DEPRECATED_51 = 0x010, ompt_state_wait_barrier_implicit_parallel = 0x011, ompt_state_wait_barrier_implicit_workshare = 0x012, - ompt_state_wait_barrier_implicit = 0x013, + ompt_state_wait_barrier_implicit DEPRECATED_51 = 0x013, ompt_state_wait_barrier_explicit = 0x014, + ompt_state_wait_barrier_implementation = 0x015, + ompt_state_wait_barrier_teams = 0x016, ompt_state_wait_taskwait = 0x020, ompt_state_wait_taskgroup = 0x021, @@ -799,19 +839,19 @@ int flags; } ompt_record_implicit_task_t; -typedef void (*ompt_callback_master_t) ( +typedef void (*ompt_callback_masked_t) ( ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra ); -typedef struct ompt_record_master_t { +typedef struct ompt_record_masked_t { ompt_scope_endpoint_t endpoint; ompt_id_t parallel_id; ompt_id_t task_id; const void *codeptr_ra; -} ompt_record_master_t; +} ompt_record_masked_t; typedef void (*ompt_callback_sync_region_t) ( ompt_sync_region_t kind, @@ -918,6 +958,20 @@ uint64_t module_id ); +typedef void (*ompt_callback_target_data_op_emi_t) ( + ompt_scope_endpoint_t endpoint, + ompt_data_t *target_task_data, + ompt_data_t *target_data, + ompt_id_t *host_op_id, + ompt_target_data_op_t optype, + 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_data_op_t) ( ompt_id_t target_id, ompt_id_t host_op_id, @@ -942,6 +996,16 @@ const void *codeptr_ra; } ompt_record_target_data_op_t; +typedef void (*ompt_callback_target_emi_t) ( + ompt_target_t kind, + ompt_scope_endpoint_t endpoint, + int device_num, + ompt_data_t *task_data, + ompt_data_t *target_task_data, + ompt_data_t *target_data, + const void *codeptr_ra +); + typedef void (*ompt_callback_target_t) ( ompt_target_t kind, ompt_scope_endpoint_t endpoint, @@ -960,6 +1024,16 @@ const void *codeptr_ra; } ompt_record_target_t; +typedef void (*ompt_callback_target_map_emi_t) ( + ompt_data_t *target_data, + unsigned int nitems, + void **host_addr, + void **device_addr, + size_t *bytes, + unsigned int *mapping_flags, + const void *codeptr_ra +); + typedef void (*ompt_callback_target_map_t) ( ompt_id_t target_id, unsigned int nitems, @@ -980,6 +1054,13 @@ const void *codeptr_ra; } ompt_record_target_map_t; +typedef void (*ompt_callback_target_submit_emi_t) ( + ompt_scope_endpoint_t endpoint, + ompt_data_t *target_data, + ompt_id_t *host_op_id, + unsigned int requested_num_teams +); + typedef void (*ompt_callback_target_submit_t) ( ompt_id_t target_id, ompt_id_t host_op_id, @@ -1006,6 +1087,12 @@ const void *codeptr_ra; } ompt_record_control_tool_t; +typedef void (*ompt_callback_error_t) ( + ompt_severity_t severity, + const char *message, size_t length, + const void *codeptr_ra +); + typedef struct ompd_address_t { ompd_seg_t segment; ompd_addr_t address; @@ -1049,7 +1136,7 @@ ompt_record_task_dependence_t task_dependence; ompt_record_task_schedule_t task_schedule; ompt_record_implicit_task_t implicit_task; - ompt_record_master_t master; + ompt_record_masked_t masked; ompt_record_sync_region_t sync_region; ompt_record_mutex_acquire_t mutex_acquire; ompt_record_mutex_t mutex; Index: openmp/runtime/src/kmp_csupport.cpp =================================================================== --- openmp/runtime/src/kmp_csupport.cpp +++ openmp/runtime/src/kmp_csupport.cpp @@ -756,12 +756,12 @@ #if OMPT_SUPPORT && OMPT_OPTIONAL if (status) { - if (ompt_enabled.ompt_callback_master) { + if (ompt_enabled.ompt_callback_masked) { kmp_info_t *this_thr = __kmp_threads[global_tid]; kmp_team_t *team = this_thr->th.th_team; int tid = __kmp_tid_from_gtid(global_tid); - ompt_callbacks.ompt_callback(ompt_callback_master)( + ompt_callbacks.ompt_callback(ompt_callback_masked)( ompt_scope_begin, &(team->t.ompt_team_info.parallel_data), &(team->t.t_implicit_task_taskdata[tid].ompt_task_info.task_data), OMPT_GET_RETURN_ADDRESS(0)); @@ -803,9 +803,9 @@ #if OMPT_SUPPORT && OMPT_OPTIONAL kmp_info_t *this_thr = __kmp_threads[global_tid]; kmp_team_t *team = this_thr->th.th_team; - if (ompt_enabled.ompt_callback_master) { + if (ompt_enabled.ompt_callback_masked) { int tid = __kmp_tid_from_gtid(global_tid); - ompt_callbacks.ompt_callback(ompt_callback_master)( + ompt_callbacks.ompt_callback(ompt_callback_masked)( ompt_scope_end, &(team->t.ompt_team_info.parallel_data), &(team->t.t_implicit_task_taskdata[tid].ompt_task_info.task_data), OMPT_GET_RETURN_ADDRESS(0)); Index: openmp/runtime/src/ompt-event-specific.h =================================================================== --- openmp/runtime/src/ompt-event-specific.h +++ openmp/runtime/src/ompt-event-specific.h @@ -56,8 +56,11 @@ #define ompt_callback_implicit_task_implemented ompt_event_MAY_ALWAYS #define ompt_callback_target_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_emi_implemented ompt_event_UNIMPLEMENTED #define ompt_callback_target_data_op_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_data_op_emi_implemented ompt_event_UNIMPLEMENTED #define ompt_callback_target_submit_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_submit_emi_implemented ompt_event_UNIMPLEMENTED #define ompt_callback_control_tool_implemented ompt_event_MAY_ALWAYS @@ -82,9 +85,10 @@ #define ompt_callback_work_implemented ompt_event_MAY_ALWAYS_OPTIONAL -#define ompt_callback_master_implemented ompt_event_MAY_ALWAYS_OPTIONAL +#define ompt_callback_masked_implemented ompt_event_MAY_ALWAYS_OPTIONAL #define ompt_callback_target_map_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_map_emi_implemented ompt_event_UNIMPLEMENTED #define ompt_callback_sync_region_implemented ompt_event_MAY_ALWAYS_OPTIONAL @@ -103,4 +107,6 @@ #define ompt_callback_dispatch_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_error_implemented ompt_event_UNIMPLEMENTED + #endif Index: openmp/runtime/test/ompt/callback.h =================================================================== --- openmp/runtime/test/ompt/callback.h +++ openmp/runtime/test/ompt/callback.h @@ -869,7 +869,7 @@ } static void -on_ompt_callback_master( +on_ompt_callback_masked( ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, @@ -879,14 +879,14 @@ { case ompt_scope_begin: printf("%" PRIu64 ":" _TOOL_PREFIX - " ompt_event_master_begin: parallel_id=%" PRIu64 + " ompt_event_masked_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_scope_end: printf("%" PRIu64 ":" _TOOL_PREFIX - " ompt_event_master_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 + " ompt_event_masked_end: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, parallel_data->value, task_data->value, codeptr_ra); @@ -1116,7 +1116,7 @@ register_callback_t(ompt_callback_lock_init, ompt_callback_mutex_acquire_t); register_callback_t(ompt_callback_lock_destroy, ompt_callback_mutex_t); register_callback(ompt_callback_work); - register_callback(ompt_callback_master); + register_callback(ompt_callback_masked); register_callback(ompt_callback_parallel_begin); register_callback(ompt_callback_parallel_end); register_callback(ompt_callback_task_create); Index: openmp/runtime/test/ompt/cancel/cancel_taskgroup.c =================================================================== --- openmp/runtime/test/ompt/cancel/cancel_taskgroup.c +++ openmp/runtime/test/ompt/cancel/cancel_taskgroup.c @@ -60,7 +60,7 @@ // Check if libomp supports the callbacks for this test. - // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_master' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_masked' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_schedule' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel' @@ -68,7 +68,7 @@ // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]] - // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_master_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[PARENT_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}} + // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_masked_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[PARENT_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}} // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[PARENT_TASK_ID]], parent_task_frame.exit={{0x[0-f]*}}, parent_task_frame.reenter={{0x[0-f]*}}, new_task_id=[[FIRST_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}}, task_type=ompt_task_explicit=4, has_dependences=no // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[PARENT_TASK_ID]], parent_task_frame.exit={{0x[0-f]*}}, parent_task_frame.reenter={{0x[0-f]*}}, new_task_id=[[SECOND_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}}, task_type=ompt_task_explicit=4, has_dependences=no Index: openmp/runtime/test/ompt/synchronization/master.c =================================================================== --- openmp/runtime/test/ompt/synchronization/master.c +++ openmp/runtime/test/ompt/synchronization/master.c @@ -24,15 +24,15 @@ } // Check if libomp supports the callbacks for this test. -// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_master' +// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_masked' // CHECK: 0: NULL_POINTER=[[NULL:.*$]] -// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_master_begin: +// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_masked_begin: // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]] -// CHECK: {{^}}[[MASTER_ID]]: ompt_event_master_end: +// CHECK: {{^}}[[MASTER_ID]]: ompt_event_masked_end: // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS_END:0x[0-f]+]] // CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS_END]] Index: openmp/runtime/test/ompt/synchronization/taskgroup.c =================================================================== --- openmp/runtime/test/ompt/synchronization/taskgroup.c +++ openmp/runtime/test/ompt/synchronization/taskgroup.c @@ -29,7 +29,6 @@ // Check if libomp supports the callbacks for this test. - // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_master' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_schedule' // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel'