1 /*
2 * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
4 * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
5 *
6 * $COPYRIGHT$
7 *
8 * Additional copyrights may follow
9 *
10 * $HEADER$
11 *
12 * @file:
13 *
14 */
15
16 #ifndef PMIX_PSENSOR_H_
17 #define PMIX_PSENSOR_H_
18
19 #include <src/include/pmix_config.h>
20
21 #include "src/class/pmix_list.h"
22 #include "src/mca/mca.h"
23 #include "src/include/pmix_globals.h"
24
25 BEGIN_C_DECLS
26
27 /*
28 * Component functions - all MUST be provided!
29 */
30
31 /* start a sensor operation:
32 *
33 * requestor - the process requesting this operation
34 *
35 * monitor - a PMIx attribute specifying what is to be monitored
36 *
37 * directives - an array of pmix_info_t specifying relevant limits on values, and action
38 * to be taken when limits exceeded. Can include
39 * user-provided "id" string */
40 typedef pmix_status_t (*pmix_psensor_base_module_start_fn_t)(pmix_peer_t *requestor, pmix_status_t error,
41 const pmix_info_t *monitor,
42 const pmix_info_t directives[], size_t ndirs);
43
44 /* stop a sensor operation:
45 *
46 * requestor - the process requesting this operation
47 *
48 * id - the "id" string provided by the user at the time the
49 * affected monitoring operation was started. A NULL indicates
50 * that all operations started by this requestor are to
51 * be terminated */
52 typedef pmix_status_t (*pmix_psensor_base_module_stop_fn_t)(pmix_peer_t *requestor,
53 char *id);
54
55 /* API module */
56 /*
57 * Ver 1.0
58 */
59 typedef struct pmix_psensor_base_module_1_0_0_t {
60 pmix_psensor_base_module_start_fn_t start;
61 pmix_psensor_base_module_stop_fn_t stop;
62 } pmix_psensor_base_module_t;
63
64 /*
65 * the standard component data structure
66 */
67 typedef struct pmix_psensor_base_component_1_0_0_t {
68 pmix_mca_base_component_t base;
69 pmix_mca_base_component_data_t data;
70 } pmix_psensor_base_component_t;
71
72
73
74 /*
75 * Macro for use in components that are of type sensor v1.0.0
76 */
77 #define PMIX_PSENSOR_BASE_VERSION_1_0_0 \
78 PMIX_MCA_BASE_VERSION_1_0_0("psensor", 1, 0, 0)
79
80 /* Global structure for accessing sensor functions
81 */
82 PMIX_EXPORT extern pmix_psensor_base_module_t pmix_psensor; /* holds API function pointers */
83
84 END_C_DECLS
85
86 #endif /* MCA_SENSOR_H */