This source file includes following definitions.
- atomic_base_module_construct
- mca_atomic_base_register
- mca_atomic_base_close
- mca_atomic_base_open
1
2
3
4
5
6
7
8
9
10
11 #include <stdio.h>
12
13 #include "oshmem_config.h"
14
15 #include "oshmem/constants.h"
16
17 #include "oshmem/mca/mca.h"
18 #include "opal/util/output.h"
19 #include "opal/mca/base/base.h"
20
21 #include "oshmem/util/oshmem_util.h"
22 #include "oshmem/mca/atomic/atomic.h"
23 #include "oshmem/mca/atomic/base/base.h"
24
25
26
27
28
29
30
31 #include "oshmem/mca/atomic/base/static-components.h"
32
33
34
35
36
37
38
39
40
41 static void atomic_base_module_construct(mca_atomic_base_module_t *m)
42 {
43
44 m->atomic_fadd = NULL;
45 m->atomic_cswap = NULL;
46 }
47
48 OBJ_CLASS_INSTANCE(mca_atomic_base_module_t, opal_object_t,
49 atomic_base_module_construct, NULL);
50
51 static int mca_atomic_base_register(mca_base_register_flag_t flags)
52 {
53 return OSHMEM_SUCCESS;
54 }
55
56 static int mca_atomic_base_close(void)
57 {
58 mca_base_component_list_item_t *cli, *next;
59 const mca_base_component_t *component;
60
61 OPAL_LIST_FOREACH_SAFE(cli, next, &oshmem_atomic_base_framework.framework_components, mca_base_component_list_item_t) {
62 component = cli->cli_component;
63 mca_atomic_base_component_t *atomic =
64 (mca_atomic_base_component_t *) component;
65
66 if (NULL != atomic->atomic_finalize) {
67 atomic->atomic_finalize();
68 }
69 }
70
71
72 return mca_base_framework_components_close(&oshmem_atomic_base_framework, NULL);
73 }
74
75 static int mca_atomic_base_open(mca_base_open_flag_t flags)
76 {
77 oshmem_framework_open_output(&oshmem_atomic_base_framework);
78
79
80 if (OPAL_SUCCESS !=
81 mca_base_framework_components_open(&oshmem_atomic_base_framework, flags)) {
82 return OSHMEM_ERROR;
83 }
84
85 return OSHMEM_SUCCESS;
86 }
87
88 MCA_BASE_FRAMEWORK_DECLARE(oshmem, atomic,
89 "OSHMEM ATOMIC",
90 mca_atomic_base_register,
91 mca_atomic_base_open,
92 mca_atomic_base_close,
93 mca_atomic_base_static_components,
94 MCA_BASE_FRAMEWORK_FLAG_DEFAULT);