|
25 | 25 | * Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates. All Rights
|
26 | 26 | * reserved.
|
27 | 27 | * Copyright (c) 2021 Bull S.A.S. All rights reserved.
|
28 |
| - * Copyright (c) 2018 Triad National Security, LLC. All rights |
29 | 28 | * Copyright (c) 2018-2021 Triad National Security, LLC. All rights
|
30 | 29 | * reserved.
|
31 | 30 | * $COPYRIGHT$
|
@@ -455,6 +454,8 @@ typedef struct ompi_mpit_cvar_handle_t *MPI_T_cvar_handle;
|
455 | 454 | typedef struct mca_base_pvar_handle_t *MPI_T_pvar_handle;
|
456 | 455 | typedef struct mca_base_pvar_session_t *MPI_T_pvar_session;
|
457 | 456 | typedef struct ompi_instance_t *MPI_Session;
|
| 457 | +typedef struct mca_base_raised_event_t *MPI_T_event_instance; |
| 458 | +typedef struct mca_base_event_registration_t *MPI_T_event_registration; |
458 | 459 |
|
459 | 460 | /*
|
460 | 461 | * MPI_Status
|
@@ -890,6 +891,41 @@ enum {
|
890 | 891 | MPI_T_PVAR_CLASS_GENERIC
|
891 | 892 | };
|
892 | 893 |
|
| 894 | +/* |
| 895 | + * MPIT callback safety levels |
| 896 | + */ |
| 897 | +typedef enum { |
| 898 | + MPI_T_CB_REQUIRE_NONE, |
| 899 | + MPI_T_CB_REQUIRE_MPI_RESTRICTED, |
| 900 | + MPI_T_CB_REQUIRE_THREAD_SAFE, |
| 901 | + MPI_T_CB_REQUIRE_ASYNC_SIGNAL_SAFE |
| 902 | +} MPI_T_cb_safety; |
| 903 | + |
| 904 | +/* |
| 905 | + * MPIT source ordering |
| 906 | + */ |
| 907 | +enum ompi_mpi_t_order_t { |
| 908 | + MPI_T_ORDERED, |
| 909 | + MPI_T_UNORDERED, |
| 910 | +}; |
| 911 | + |
| 912 | +typedef enum ompi_mpi_t_order_t MPI_T_order; |
| 913 | + |
| 914 | +/* |
| 915 | + * MPI Tool event functions |
| 916 | + */ |
| 917 | +typedef void (*MPI_T_event_free_cb_function) (MPI_T_event_registration handle, |
| 918 | + MPI_T_cb_safety cb_safety, |
| 919 | + void *user_data); |
| 920 | +typedef void (*MPI_T_event_dropped_cb_function) (int count, |
| 921 | + MPI_T_event_registration handle, |
| 922 | + MPI_T_cb_safety cb_safety, |
| 923 | + void *user_data); |
| 924 | +typedef void (*MPI_T_event_cb_function) (MPI_T_event_instance event, |
| 925 | + MPI_T_event_registration handle, |
| 926 | + MPI_T_cb_safety cb_safety, |
| 927 | + void *user_data); |
| 928 | + |
893 | 929 | /*
|
894 | 930 | * NULL handles
|
895 | 931 | */
|
@@ -925,6 +961,7 @@ enum {
|
925 | 961 | #define MPI_T_PVAR_HANDLE_NULL ((MPI_T_pvar_handle) 0)
|
926 | 962 | #define MPI_T_PVAR_SESSION_NULL ((MPI_T_pvar_session) 0)
|
927 | 963 | #define MPI_T_CVAR_HANDLE_NULL ((MPI_T_cvar_handle) 0)
|
| 964 | +#define MPI_T_EVENT_REGISTRATION_NULL ((MPI_T_event_registration) 0) |
928 | 965 |
|
929 | 966 | /* MPI-2 specifies that the name "MPI_TYPE_NULL_DELETE_FN" (and all
|
930 | 967 | related friends) must be accessible in C, C++, and Fortran. This is
|
@@ -2923,6 +2960,40 @@ OMPI_DECLSPEC int PMPI_T_enum_get_info(MPI_T_enum enumtype, int *num, char *nam
|
2923 | 2960 | OMPI_DECLSPEC int PMPI_T_enum_get_item(MPI_T_enum enumtype, int index, int *value, char *name,
|
2924 | 2961 | int *name_len);
|
2925 | 2962 |
|
| 2963 | +OMPI_DECLSPEC int PMPI_T_event_get_num (int *num_events); |
| 2964 | +OMPI_DECLSPEC int PMPI_T_event_get_info (int event_index, char *name, int *name_len, |
| 2965 | + int *verbosity, MPI_Datatype *array_of_datatypes, |
| 2966 | + MPI_Aint *array_of_displacements, int *num_elements, |
| 2967 | + MPI_Aint *extent, MPI_T_enum *enumtype, MPI_Info *info, |
| 2968 | + char *desc, int *desc_len, int *bind); |
| 2969 | +OMPI_DECLSPEC int PMPI_T_event_get_index (const char *name, int *event_index); |
| 2970 | +OMPI_DECLSPEC int PMPI_T_event_handle_alloc (int event_index, void *obj_handle, |
| 2971 | + MPI_Info info, MPI_T_event_registration *event_registration); |
| 2972 | +OMPI_DECLSPEC int PMPI_T_event_handle_set_info (MPI_T_event_registration event_registration, MPI_Info info); |
| 2973 | +OMPI_DECLSPEC int PMPI_T_event_handle_get_info (MPI_T_event_registration event_registration, |
| 2974 | + MPI_Info *info_used); |
| 2975 | +OMPI_DECLSPEC int PMPI_T_event_register_callback (MPI_T_event_registration event_registration, |
| 2976 | + MPI_T_cb_safety cb_safety, MPI_Info info, void *user_data, |
| 2977 | + MPI_T_event_cb_function event_cb_function); |
| 2978 | +OMPI_DECLSPEC int PMPI_T_event_callback_set_info (MPI_T_event_registration event_registration, |
| 2979 | + MPI_T_cb_safety cb_safety, MPI_Info info); |
| 2980 | +OMPI_DECLSPEC int PMPI_T_event_callback_get_info (MPI_T_event_registration event_registration, |
| 2981 | + MPI_T_cb_safety cb_safety, MPI_Info *info_used); |
| 2982 | +OMPI_DECLSPEC int PMPI_T_event_handle_free (MPI_T_event_registration event_registration, |
| 2983 | + MPI_T_event_free_cb_function free_cb_function); |
| 2984 | +OMPI_DECLSPEC int PMPI_T_event_set_dropped_handler (MPI_T_event_registration handle, |
| 2985 | + MPI_T_event_dropped_cb_function dropped_cb_function); |
| 2986 | +OMPI_DECLSPEC int PMPI_T_event_read (MPI_T_event_instance event, int element_index, void *buffer); |
| 2987 | +OMPI_DECLSPEC int PMPI_T_event_copy (MPI_T_event_instance event, void *buffer); |
| 2988 | +OMPI_DECLSPEC int PMPI_T_event_get_timestamp (MPI_T_event_instance event, MPI_Count *event_time); |
| 2989 | +OMPI_DECLSPEC int PMPI_T_event_get_source (MPI_T_event_instance event, int *source_index); |
| 2990 | +OMPI_DECLSPEC int PMPI_T_source_get_num (int *num_source); |
| 2991 | +OMPI_DECLSPEC int PMPI_T_source_get_info (int source_id, char *name, int *name_len, |
| 2992 | + char *desc, int *desc_len, MPI_T_order *ordering, |
| 2993 | + MPI_Count *ticks_per_second, MPI_Count *max_timestamp, |
| 2994 | + MPI_Info *info); |
| 2995 | +OMPI_DECLSPEC int PMPI_T_source_get_timestamp (int source_id, MPI_Count *timestamp); |
| 2996 | + |
2926 | 2997 | /*
|
2927 | 2998 | * Tool MPI API
|
2928 | 2999 | */
|
@@ -2989,6 +3060,41 @@ OMPI_DECLSPEC int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
|
2989 | 3060 | OMPI_DECLSPEC int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
|
2990 | 3061 | __mpi_interface_deprecated__("PMPI_Attr_put was deprecated in MPI-2.0; use PMPI_Comm_set_attr instead");
|
2991 | 3062 |
|
| 3063 | +OMPI_DECLSPEC int MPI_T_event_get_num (int *num_events); |
| 3064 | +OMPI_DECLSPEC int MPI_T_event_get_info (int event_index, char *name, int *name_len, |
| 3065 | + int *verbosity, MPI_Datatype *array_of_datatypes, |
| 3066 | + MPI_Aint *array_of_displacements, int *num_elements, |
| 3067 | + MPI_Aint *extent, MPI_T_enum *enumtype, MPI_Info *info, |
| 3068 | + char *desc, int *desc_len, int *bind); |
| 3069 | +OMPI_DECLSPEC int MPI_T_event_get_index (const char *name, int *event_index); |
| 3070 | +OMPI_DECLSPEC int MPI_T_event_handle_alloc (int event_index, void *obj_handle, |
| 3071 | + MPI_Info info, MPI_T_event_registration *event_registration); |
| 3072 | +OMPI_DECLSPEC int MPI_T_event_handle_set_info (MPI_T_event_registration event_registration, MPI_Info info); |
| 3073 | +OMPI_DECLSPEC int MPI_T_event_handle_get_info (MPI_T_event_registration event_registration, |
| 3074 | + MPI_Info *info_used); |
| 3075 | +OMPI_DECLSPEC int MPI_T_event_handle_free (MPI_T_event_registration event_registration, |
| 3076 | + MPI_T_event_free_cb_function free_cb_function); |
| 3077 | +OMPI_DECLSPEC int MPI_T_event_register_callback (MPI_T_event_registration event_registration, |
| 3078 | + MPI_T_cb_safety cb_safety, MPI_Info info, void *user_data, |
| 3079 | + MPI_T_event_cb_function event_cb_function); |
| 3080 | +OMPI_DECLSPEC int MPI_T_event_callback_set_info (MPI_T_event_registration event_registration, |
| 3081 | + MPI_T_cb_safety cb_safety, MPI_Info info); |
| 3082 | +OMPI_DECLSPEC int MPI_T_event_callback_get_info (MPI_T_event_registration event_registration, |
| 3083 | + MPI_T_cb_safety cb_safety, MPI_Info *info_used); |
| 3084 | +OMPI_DECLSPEC int MPI_T_event_set_dropped_handler (MPI_T_event_registration handle, |
| 3085 | + MPI_T_event_dropped_cb_function dropped_cb_function); |
| 3086 | +OMPI_DECLSPEC int MPI_T_event_read (MPI_T_event_instance event, int element_index, void *buffer); |
| 3087 | +OMPI_DECLSPEC int MPI_T_event_copy (MPI_T_event_instance event, void *buffer); |
| 3088 | +OMPI_DECLSPEC int MPI_T_event_get_timestamp (MPI_T_event_instance event, MPI_Count *event_time); |
| 3089 | +OMPI_DECLSPEC int MPI_T_event_get_source (MPI_T_event_instance event, int *source_index); |
| 3090 | + |
| 3091 | +OMPI_DECLSPEC int MPI_T_source_get_num (int *num_source); |
| 3092 | +OMPI_DECLSPEC int MPI_T_source_get_info (int source_id, char *name, int *name_len, |
| 3093 | + char *desc, int *desc_len, MPI_T_order *ordering, |
| 3094 | + MPI_Count *ticks_per_second, MPI_Count *max_timestamp, |
| 3095 | + MPI_Info *info); |
| 3096 | +OMPI_DECLSPEC int MPI_T_source_get_timestamp (int source_id, MPI_Count *timestamp); |
| 3097 | + |
2992 | 3098 | /*
|
2993 | 3099 | * Even though MPI_Copy_function and MPI_Delete_function are
|
2994 | 3100 | * deprecated, we do not use the attributes marking them as such,
|
|
0 commit comments