This source file includes following definitions.
- pmix_psensor_base_start
- pmix_psensor_base_stop
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include <src/include/pmix_config.h>
15 #include <pmix_common.h>
16
17 #include "src/util/error.h"
18
19 #include "src/mca/psensor/base/base.h"
20
21 pmix_status_t pmix_psensor_base_start(pmix_peer_t *requestor, pmix_status_t error,
22 const pmix_info_t *monitor,
23 const pmix_info_t directives[], size_t ndirs)
24 {
25 pmix_psensor_active_module_t *mod;
26 pmix_status_t rc;
27 bool didit = false;
28
29 pmix_output_verbose(5, pmix_psensor_base_framework.framework_output,
30 "%s:%d sensor:base: starting sensors",
31 pmix_globals.myid.nspace, pmix_globals.myid.rank);
32
33
34 PMIX_LIST_FOREACH(mod, &pmix_psensor_base.actives, pmix_psensor_active_module_t) {
35 if (NULL != mod->module->start) {
36 rc = mod->module->start(requestor, error, monitor, directives, ndirs);
37 if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) {
38 return rc;
39 }
40 didit = true;
41 }
42 }
43
44
45
46
47 if (!didit) {
48 return PMIX_ERR_NOT_SUPPORTED;
49 }
50
51 return PMIX_SUCCESS;
52 }
53
54 pmix_status_t pmix_psensor_base_stop(pmix_peer_t *requestor,
55 char *id)
56 {
57 pmix_psensor_active_module_t *mod;
58 pmix_status_t rc, ret = PMIX_SUCCESS;
59
60 pmix_output_verbose(5, pmix_psensor_base_framework.framework_output,
61 "%s:%d sensor:base: stopping sensors",
62 pmix_globals.myid.nspace, pmix_globals.myid.rank);
63
64
65 PMIX_LIST_FOREACH(mod, &pmix_psensor_base.actives, pmix_psensor_active_module_t) {
66 if (NULL != mod->module->stop) {
67 rc = mod->module->stop(requestor, id);
68 if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) {
69 if (PMIX_SUCCESS == ret) {
70 ret = rc;
71 }
72
73
74 }
75 }
76 }
77
78 return ret;
79 }