|
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-2022 Triad National Security, LLC. All rights
|
30 | 29 | * reserved.
|
31 | 30 | * $COPYRIGHT$
|
@@ -461,6 +460,8 @@ typedef struct ompi_mpit_cvar_handle_t *MPI_T_cvar_handle;
|
461 | 460 | typedef struct mca_base_pvar_handle_t *MPI_T_pvar_handle;
|
462 | 461 | typedef struct mca_base_pvar_session_t *MPI_T_pvar_session;
|
463 | 462 | typedef struct ompi_instance_t *MPI_Session;
|
| 463 | +typedef unsigned long *MPI_T_event_instance; |
| 464 | +typedef unsigned long *MPI_T_event_registration; |
464 | 465 |
|
465 | 466 | /*
|
466 | 467 | * MPI_Status
|
@@ -920,6 +921,48 @@ enum {
|
920 | 921 | MPI_T_PVAR_CLASS_GENERIC
|
921 | 922 | };
|
922 | 923 |
|
| 924 | +/* |
| 925 | + * MPIT callback safety levels |
| 926 | + * |
| 927 | + * Values are set in configure.ac for consistency with mca_base_event.h |
| 928 | + */ |
| 929 | +#undef OPAL_MCA_BASE_CB_REQUIRE_NONE |
| 930 | +#undef OPAL_MCA_BASE_CB_REQUIRE_MPI_RESTRICTED |
| 931 | +#undef OPAL_MCA_BASE_CB_REQUIRE_THREAD_SAFE |
| 932 | +#undef OPAL_MCA_BASE_CB_REQUIRE_ASYNC_SIGNAL_SAFE |
| 933 | +typedef enum { |
| 934 | + MPI_T_CB_REQUIRE_NONE = OPAL_MCA_BASE_CB_REQUIRE_NONE, |
| 935 | + MPI_T_CB_REQUIRE_MPI_RESTRICTED = OPAL_MCA_BASE_CB_REQUIRE_MPI_RESTRICTED, |
| 936 | + MPI_T_CB_REQUIRE_THREAD_SAFE = OPAL_MCA_BASE_CB_REQUIRE_THREAD_SAFE, |
| 937 | + MPI_T_CB_REQUIRE_ASYNC_SIGNAL_SAFE = OPAL_MCA_BASE_CB_REQUIRE_ASYNC_SIGNAL_SAFE |
| 938 | +} MPI_T_cb_safety; |
| 939 | + |
| 940 | +/* |
| 941 | + * MPIT source ordering |
| 942 | + */ |
| 943 | +enum ompi_mpi_t_source_order_t { |
| 944 | + MPI_T_ORDERED, |
| 945 | + MPI_T_UNORDERED, |
| 946 | +}; |
| 947 | + |
| 948 | +typedef enum ompi_mpi_t_source_order_t MPI_T_source_order; |
| 949 | + |
| 950 | +/* |
| 951 | + * MPI Tool event functions |
| 952 | + */ |
| 953 | +typedef void (*MPI_T_event_free_cb_function) (MPI_T_event_registration handle, |
| 954 | + MPI_T_cb_safety cb_safety, |
| 955 | + void *user_data); |
| 956 | +typedef void (*MPI_T_event_dropped_cb_function) (MPI_Count count, |
| 957 | + MPI_T_event_registration handle, |
| 958 | + int source_index, |
| 959 | + MPI_T_cb_safety cb_safety, |
| 960 | + void *user_data); |
| 961 | +typedef void (*MPI_T_event_cb_function) (MPI_T_event_instance event, |
| 962 | + MPI_T_event_registration handle, |
| 963 | + MPI_T_cb_safety cb_safety, |
| 964 | + void *user_data); |
| 965 | + |
923 | 966 | /*
|
924 | 967 | * NULL handles
|
925 | 968 | */
|
@@ -955,6 +998,7 @@ enum {
|
955 | 998 | #define MPI_T_PVAR_HANDLE_NULL ((MPI_T_pvar_handle) 0)
|
956 | 999 | #define MPI_T_PVAR_SESSION_NULL ((MPI_T_pvar_session) 0)
|
957 | 1000 | #define MPI_T_CVAR_HANDLE_NULL ((MPI_T_cvar_handle) 0)
|
| 1001 | +#define MPI_T_EVENT_REGISTRATION_NULL ((MPI_T_event_registration) 0) |
958 | 1002 |
|
959 | 1003 | /* MPI-2 specifies that the name "MPI_TYPE_NULL_DELETE_FN" (and all
|
960 | 1004 | related friends) must be accessible in C, C++, and Fortran. This is
|
@@ -2953,6 +2997,41 @@ OMPI_DECLSPEC int PMPI_T_enum_get_info(MPI_T_enum enumtype, int *num, char *nam
|
2953 | 2997 | OMPI_DECLSPEC int PMPI_T_enum_get_item(MPI_T_enum enumtype, int index, int *value, char *name,
|
2954 | 2998 | int *name_len);
|
2955 | 2999 |
|
| 3000 | +OMPI_DECLSPEC int PMPI_T_event_get_num (int *num_events); |
| 3001 | +OMPI_DECLSPEC int PMPI_T_event_get_info (int event_index, char *name, int *name_len, |
| 3002 | + int *verbosity, MPI_Datatype *array_of_datatypes, |
| 3003 | + MPI_Aint *array_of_displacements, int *num_elements, |
| 3004 | + MPI_T_enum *enumtype, MPI_Info *info, |
| 3005 | + char *desc, int *desc_len, int *bind); |
| 3006 | +OMPI_DECLSPEC int PMPI_T_event_get_index (const char *name, int *event_index); |
| 3007 | +OMPI_DECLSPEC int PMPI_T_event_handle_alloc (int event_index, void *obj_handle, |
| 3008 | + MPI_Info info, MPI_T_event_registration *event_registration); |
| 3009 | +OMPI_DECLSPEC int PMPI_T_event_handle_set_info (MPI_T_event_registration event_registration, MPI_Info info); |
| 3010 | +OMPI_DECLSPEC int PMPI_T_event_handle_get_info (MPI_T_event_registration event_registration, |
| 3011 | + MPI_Info *info_used); |
| 3012 | +OMPI_DECLSPEC int PMPI_T_event_register_callback (MPI_T_event_registration event_registration, |
| 3013 | + MPI_T_cb_safety cb_safety, MPI_Info info, void *user_data, |
| 3014 | + MPI_T_event_cb_function event_cb_function); |
| 3015 | +OMPI_DECLSPEC int PMPI_T_event_callback_set_info (MPI_T_event_registration event_registration, |
| 3016 | + MPI_T_cb_safety cb_safety, MPI_Info info); |
| 3017 | +OMPI_DECLSPEC int PMPI_T_event_callback_get_info (MPI_T_event_registration event_registration, |
| 3018 | + MPI_T_cb_safety cb_safety, MPI_Info *info_used); |
| 3019 | +OMPI_DECLSPEC int PMPI_T_event_handle_free (MPI_T_event_registration event_registration, |
| 3020 | + void *user_data, |
| 3021 | + MPI_T_event_free_cb_function free_cb_function); |
| 3022 | +OMPI_DECLSPEC int PMPI_T_event_set_dropped_handler (MPI_T_event_registration handle, |
| 3023 | + MPI_T_event_dropped_cb_function dropped_cb_function); |
| 3024 | +OMPI_DECLSPEC int PMPI_T_event_read (MPI_T_event_instance event, int element_index, void *buffer); |
| 3025 | +OMPI_DECLSPEC int PMPI_T_event_copy (MPI_T_event_instance event, void *buffer); |
| 3026 | +OMPI_DECLSPEC int PMPI_T_event_get_timestamp (MPI_T_event_instance event, MPI_Count *event_time); |
| 3027 | +OMPI_DECLSPEC int PMPI_T_event_get_source (MPI_T_event_instance event, int *source_index); |
| 3028 | +OMPI_DECLSPEC int PMPI_T_source_get_num (int *num_source); |
| 3029 | +OMPI_DECLSPEC int PMPI_T_source_get_info (int source_id, char *name, int *name_len, |
| 3030 | + char *desc, int *desc_len, MPI_T_source_order *ordering, |
| 3031 | + MPI_Count *ticks_per_second, MPI_Count *max_timestamp, |
| 3032 | + MPI_Info *info); |
| 3033 | +OMPI_DECLSPEC int PMPI_T_source_get_timestamp (int source_id, MPI_Count *timestamp); |
| 3034 | + |
2956 | 3035 | /*
|
2957 | 3036 | * Tool MPI API
|
2958 | 3037 | */
|
@@ -3032,6 +3111,42 @@ OMPI_DECLSPEC int PMPI_Info_get_valuelen(MPI_Info info, const char *key, int *v
|
3032 | 3111 | int *flag)
|
3033 | 3112 | __mpi_interface_deprecated_in_mpi40__("PMPI_Info_get_valuelen was deprecated in MPI-4.0; use PMPI_Info_get_string instead");
|
3034 | 3113 |
|
| 3114 | +OMPI_DECLSPEC int MPI_T_event_get_num (int *num_events); |
| 3115 | +OMPI_DECLSPEC int MPI_T_event_get_info (int event_index, char *name, int *name_len, |
| 3116 | + int *verbosity, MPI_Datatype *array_of_datatypes, |
| 3117 | + MPI_Aint *array_of_displacements, int *num_elements, |
| 3118 | + MPI_T_enum *enumtype, MPI_Info *info, |
| 3119 | + char *desc, int *desc_len, int *bind); |
| 3120 | +OMPI_DECLSPEC int MPI_T_event_get_index (const char *name, int *event_index); |
| 3121 | +OMPI_DECLSPEC int MPI_T_event_handle_alloc (int event_index, void *obj_handle, |
| 3122 | + MPI_Info info, MPI_T_event_registration *event_registration); |
| 3123 | +OMPI_DECLSPEC int MPI_T_event_handle_set_info (MPI_T_event_registration event_registration, MPI_Info info); |
| 3124 | +OMPI_DECLSPEC int MPI_T_event_handle_get_info (MPI_T_event_registration event_registration, |
| 3125 | + MPI_Info *info_used); |
| 3126 | +OMPI_DECLSPEC int MPI_T_event_handle_free (MPI_T_event_registration event_registration, |
| 3127 | + void *user_data, |
| 3128 | + MPI_T_event_free_cb_function free_cb_function); |
| 3129 | +OMPI_DECLSPEC int MPI_T_event_register_callback (MPI_T_event_registration event_registration, |
| 3130 | + MPI_T_cb_safety cb_safety, MPI_Info info, void *user_data, |
| 3131 | + MPI_T_event_cb_function event_cb_function); |
| 3132 | +OMPI_DECLSPEC int MPI_T_event_callback_set_info (MPI_T_event_registration event_registration, |
| 3133 | + MPI_T_cb_safety cb_safety, MPI_Info info); |
| 3134 | +OMPI_DECLSPEC int MPI_T_event_callback_get_info (MPI_T_event_registration event_registration, |
| 3135 | + MPI_T_cb_safety cb_safety, MPI_Info *info_used); |
| 3136 | +OMPI_DECLSPEC int MPI_T_event_set_dropped_handler (MPI_T_event_registration handle, |
| 3137 | + MPI_T_event_dropped_cb_function dropped_cb_function); |
| 3138 | +OMPI_DECLSPEC int MPI_T_event_read (MPI_T_event_instance event, int element_index, void *buffer); |
| 3139 | +OMPI_DECLSPEC int MPI_T_event_copy (MPI_T_event_instance event, void *buffer); |
| 3140 | +OMPI_DECLSPEC int MPI_T_event_get_timestamp (MPI_T_event_instance event, MPI_Count *event_time); |
| 3141 | +OMPI_DECLSPEC int MPI_T_event_get_source (MPI_T_event_instance event, int *source_index); |
| 3142 | + |
| 3143 | +OMPI_DECLSPEC int MPI_T_source_get_num (int *num_source); |
| 3144 | +OMPI_DECLSPEC int MPI_T_source_get_info (int source_id, char *name, int *name_len, |
| 3145 | + char *desc, int *desc_len, MPI_T_source_order *ordering, |
| 3146 | + MPI_Count *ticks_per_second, MPI_Count *max_timestamp, |
| 3147 | + MPI_Info *info); |
| 3148 | +OMPI_DECLSPEC int MPI_T_source_get_timestamp (int source_id, MPI_Count *timestamp); |
| 3149 | + |
3035 | 3150 | /*
|
3036 | 3151 | * Even though MPI_Copy_function and MPI_Delete_function are
|
3037 | 3152 | * deprecated, we do not use the attributes marking them as such,
|
|
0 commit comments