Skip to content

Commit f614438

Browse files
authored
Merge pull request #5480 from hoopoepg/topic/ucx-init-c99
PML/SPML/UCX: init global objects using C99 style
2 parents d67619b + d204b8a commit f614438

File tree

4 files changed

+87
-88
lines changed

4 files changed

+87
-88
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@
4949
#define MODEX_KEY "pml-ucx"
5050

5151
mca_pml_ucx_module_t ompi_pml_ucx = {
52-
{
53-
mca_pml_ucx_add_procs,
54-
mca_pml_ucx_del_procs,
55-
mca_pml_ucx_enable,
56-
NULL,
57-
mca_pml_ucx_add_comm,
58-
mca_pml_ucx_del_comm,
59-
mca_pml_ucx_irecv_init,
60-
mca_pml_ucx_irecv,
61-
mca_pml_ucx_recv,
62-
mca_pml_ucx_isend_init,
63-
mca_pml_ucx_isend,
64-
mca_pml_ucx_send,
65-
mca_pml_ucx_iprobe,
66-
mca_pml_ucx_probe,
67-
mca_pml_ucx_start,
68-
mca_pml_ucx_improbe,
69-
mca_pml_ucx_mprobe,
70-
mca_pml_ucx_imrecv,
71-
mca_pml_ucx_mrecv,
72-
mca_pml_ucx_dump,
73-
NULL, /* FT */
74-
1ul << (PML_UCX_CONTEXT_BITS),
75-
1ul << (PML_UCX_TAG_BITS - 1),
52+
.super = {
53+
.pml_add_procs = mca_pml_ucx_add_procs,
54+
.pml_del_procs = mca_pml_ucx_del_procs,
55+
.pml_enable = mca_pml_ucx_enable,
56+
.pml_progress = NULL,
57+
.pml_add_comm = mca_pml_ucx_add_comm,
58+
.pml_del_comm = mca_pml_ucx_del_comm,
59+
.pml_irecv_init = mca_pml_ucx_irecv_init,
60+
.pml_irecv = mca_pml_ucx_irecv,
61+
.pml_recv = mca_pml_ucx_recv,
62+
.pml_isend_init = mca_pml_ucx_isend_init,
63+
.pml_isend = mca_pml_ucx_isend,
64+
.pml_send = mca_pml_ucx_send,
65+
.pml_iprobe = mca_pml_ucx_iprobe,
66+
.pml_probe = mca_pml_ucx_probe,
67+
.pml_start = mca_pml_ucx_start,
68+
.pml_improbe = mca_pml_ucx_improbe,
69+
.pml_mprobe = mca_pml_ucx_mprobe,
70+
.pml_imrecv = mca_pml_ucx_imrecv,
71+
.pml_mrecv = mca_pml_ucx_mrecv,
72+
.pml_dump = mca_pml_ucx_dump,
73+
.pml_ft_event = NULL,
74+
.pml_max_contextid = 1ul << (PML_UCX_CONTEXT_BITS),
75+
.pml_max_tag = 1ul << (PML_UCX_TAG_BITS - 1)
7676
},
77-
NULL, /* ucp_context */
78-
NULL /* ucp_worker */
77+
.ucp_context = NULL,
78+
.ucp_worker = NULL
7979
};
8080

8181
#define PML_UCX_REQ_ALLOCA() \

ompi/mca/pml/ucx/pml_ucx_component.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ mca_pml_base_component_2_0_0_t mca_pml_ucx_component = {
2626

2727
/* First, the mca_base_component_t struct containing meta
2828
* information about the component itself */
29-
{
29+
.pmlm_version = {
3030
MCA_PML_BASE_VERSION_2_0_0,
3131

32-
"ucx", /* MCA component name */
33-
OMPI_MAJOR_VERSION, /* MCA component major version */
34-
OMPI_MINOR_VERSION, /* MCA component minor version */
35-
OMPI_RELEASE_VERSION, /* MCA component release version */
36-
mca_pml_ucx_component_open, /* component open */
37-
mca_pml_ucx_component_close, /* component close */
38-
NULL,
39-
mca_pml_ucx_component_register,
32+
.mca_component_name = "ucx",
33+
.mca_component_major_version = OMPI_MAJOR_VERSION,
34+
.mca_component_minor_version = OMPI_MINOR_VERSION,
35+
.mca_component_release_version = OMPI_RELEASE_VERSION,
36+
.mca_open_component = mca_pml_ucx_component_open,
37+
.mca_close_component = mca_pml_ucx_component_close,
38+
.mca_query_component = NULL,
39+
.mca_register_component_params = mca_pml_ucx_component_register,
4040
},
41-
{
41+
.pmlm_data = {
4242
/* This component is not checkpoint ready */
43-
MCA_BASE_METADATA_PARAM_NONE
43+
.param_field = MCA_BASE_METADATA_PARAM_NONE
4444
},
4545

46-
mca_pml_ucx_component_init, /* component init */
47-
mca_pml_ucx_component_fini /* component finalize */
46+
.pmlm_init = mca_pml_ucx_component_init,
47+
.pmlm_finalize = mca_pml_ucx_component_fini
4848
};
4949

5050
static int mca_pml_ucx_component_register(void)

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,47 +48,47 @@ static
4848
spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(int pe, void *va, void **rva);
4949

5050
mca_spml_ucx_t mca_spml_ucx = {
51-
{
51+
.super = {
5252
/* Init mca_spml_base_module_t */
53-
mca_spml_ucx_add_procs,
54-
mca_spml_ucx_del_procs,
55-
mca_spml_ucx_enable,
56-
mca_spml_ucx_register,
57-
mca_spml_ucx_deregister,
58-
mca_spml_base_oob_get_mkeys,
59-
mca_spml_ucx_ctx_create,
60-
mca_spml_ucx_ctx_destroy,
61-
mca_spml_ucx_put,
62-
mca_spml_ucx_put_nb,
63-
mca_spml_ucx_get,
64-
mca_spml_ucx_get_nb,
65-
mca_spml_ucx_recv,
66-
mca_spml_ucx_send,
67-
mca_spml_base_wait,
68-
mca_spml_base_wait_nb,
69-
mca_spml_base_test,
70-
mca_spml_ucx_fence,
71-
mca_spml_ucx_quiet,
72-
mca_spml_ucx_rmkey_unpack,
73-
mca_spml_ucx_rmkey_free,
74-
mca_spml_ucx_rmkey_ptr,
75-
mca_spml_ucx_memuse_hook,
76-
(void*)&mca_spml_ucx
53+
.spml_add_procs = mca_spml_ucx_add_procs,
54+
.spml_del_procs = mca_spml_ucx_del_procs,
55+
.spml_enable = mca_spml_ucx_enable,
56+
.spml_register = mca_spml_ucx_register,
57+
.spml_deregister = mca_spml_ucx_deregister,
58+
.spml_oob_get_mkeys = mca_spml_base_oob_get_mkeys,
59+
.spml_ctx_create = mca_spml_ucx_ctx_create,
60+
.spml_ctx_destroy = mca_spml_ucx_ctx_destroy,
61+
.spml_put = mca_spml_ucx_put,
62+
.spml_put_nb = mca_spml_ucx_put_nb,
63+
.spml_get = mca_spml_ucx_get,
64+
.spml_get_nb = mca_spml_ucx_get_nb,
65+
.spml_recv = mca_spml_ucx_recv,
66+
.spml_send = mca_spml_ucx_send,
67+
.spml_wait = mca_spml_base_wait,
68+
.spml_wait_nb = mca_spml_base_wait_nb,
69+
.spml_test = mca_spml_base_test,
70+
.spml_fence = mca_spml_ucx_fence,
71+
.spml_quiet = mca_spml_ucx_quiet,
72+
.spml_rmkey_unpack = mca_spml_ucx_rmkey_unpack,
73+
.spml_rmkey_free = mca_spml_ucx_rmkey_free,
74+
.spml_rmkey_ptr = mca_spml_ucx_rmkey_ptr,
75+
.spml_memuse_hook = mca_spml_ucx_memuse_hook,
76+
.self = (void*)&mca_spml_ucx
7777
},
7878

79-
NULL, /* ucp_context */
80-
1, /* num_disconnect */
81-
0, /* heap_reg_nb */
82-
0, /* enabled */
83-
mca_spml_ucx_get_mkey_slow
79+
.ucp_context = NULL,
80+
.num_disconnect = 1,
81+
.heap_reg_nb = 0,
82+
.enabled = 0,
83+
.get_mkey_slow = mca_spml_ucx_get_mkey_slow
8484
};
8585

8686
OBJ_CLASS_INSTANCE(mca_spml_ucx_ctx_list_item_t, opal_list_item_t, NULL, NULL);
8787

8888
mca_spml_ucx_ctx_t mca_spml_ucx_ctx_default = {
89-
NULL, /* ucp_worker */
90-
NULL, /* ucp_peers */
91-
0 /* options */
89+
.ucp_worker = NULL,
90+
.ucp_peers = NULL,
91+
.options = 0
9292
};
9393

9494
int mca_spml_ucx_enable(bool enable)

oshmem/mca/spml/ucx/spml_ucx_component.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,25 @@ mca_spml_base_component_2_0_0_t mca_spml_ucx_component = {
3838
/* First, the mca_base_component_t struct containing meta
3939
information about the component itself */
4040

41-
{
42-
MCA_SPML_BASE_VERSION_2_0_0,
43-
44-
"ucx", /* MCA component name */
45-
OSHMEM_MAJOR_VERSION, /* MCA component major version */
46-
OSHMEM_MINOR_VERSION, /* MCA component minor version */
47-
OSHMEM_RELEASE_VERSION, /* MCA component release version */
48-
mca_spml_ucx_component_open, /* component open */
49-
mca_spml_ucx_component_close, /* component close */
50-
NULL,
51-
mca_spml_ucx_component_register
41+
.spmlm_version = {
42+
MCA_SPML_BASE_VERSION_2_0_0,
43+
44+
.mca_component_name = "ucx",
45+
.mca_component_major_version = OSHMEM_MAJOR_VERSION,
46+
.mca_component_minor_version = OSHMEM_MINOR_VERSION,
47+
.mca_component_release_version = OSHMEM_RELEASE_VERSION,
48+
.mca_open_component = mca_spml_ucx_component_open,
49+
.mca_close_component = mca_spml_ucx_component_close,
50+
.mca_query_component = NULL,
51+
.mca_register_component_params = mca_spml_ucx_component_register
5252
},
53-
{
53+
.spmlm_data = {
5454
/* The component is checkpoint ready */
55-
MCA_BASE_METADATA_PARAM_CHECKPOINT
55+
.param_field = MCA_BASE_METADATA_PARAM_CHECKPOINT
5656
},
5757

58-
mca_spml_ucx_component_init, /* component init */
59-
mca_spml_ucx_component_fini /* component finalize */
60-
58+
.spmlm_init = mca_spml_ucx_component_init,
59+
.spmlm_finalize = mca_spml_ucx_component_fini
6160
};
6261

6362

0 commit comments

Comments
 (0)