This source file includes following definitions.
- opal_event_base_open
- opal_event_base_close
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include "opal_config.h"
15
16 #include "opal/constants.h"
17 #include "opal/util/output.h"
18 #include "opal/mca/mca.h"
19 #include "opal/mca/base/base.h"
20
21 #include "opal/mca/event/event.h"
22 #include "opal/mca/event/base/base.h"
23
24
25
26
27
28
29
30 #include "opal/mca/event/base/static-components.h"
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 static int opal_event_base_open(mca_base_open_flag_t flags);
52 static int opal_event_base_close(void);
53
54
55 MCA_BASE_FRAMEWORK_DECLARE(opal, event, NULL, NULL, opal_event_base_open,
56 opal_event_base_close, mca_event_base_static_components,
57 0);
58
59
60
61
62 opal_event_base_t *opal_sync_event_base=NULL;
63
64 static int opal_event_base_open(mca_base_open_flag_t flags)
65 {
66 int rc = OPAL_SUCCESS;
67
68
69 (void) flags;
70
71
72
73
74 if (OPAL_SUCCESS != (rc = opal_event_init())) {
75 return rc;
76 }
77
78
79 opal_event_use_threads();
80
81
82 if (NULL == (opal_sync_event_base = opal_event_base_create())) {
83 return OPAL_ERROR;
84 }
85
86
87 if (0 < OPAL_EVENT_NUM_PRI) {
88 opal_event_base_priority_init(opal_sync_event_base, OPAL_EVENT_NUM_PRI);
89 }
90
91 return rc;
92 }
93
94 static int opal_event_base_close(void)
95 {
96 int rc;
97
98
99 if (OPAL_SUCCESS != (rc =mca_base_framework_components_close (&opal_event_base_framework,
100 NULL))) {
101 return rc;
102 }
103
104 opal_event_base_free(opal_sync_event_base);
105
106
107 return opal_event_finalize();
108
109 }
110