diff --git a/config/opal_mca.m4 b/config/opal_mca.m4 index b425fe63bf2..cdeb935a3a3 100644 --- a/config/opal_mca.m4 +++ b/config/opal_mca.m4 @@ -499,7 +499,7 @@ extern "C" { `cat $outfile.extern` -const mca_base_component_t *mca_$2_base_static_components[[]] = { +const mca_base_component_t **mca_$2_base_static_components[[]] = { `cat $outfile.struct` NULL }; @@ -763,8 +763,8 @@ AC_DEFUN([MCA_PROCESS_COMPONENT],[ # $FRAMEWORK_LIB_NAME prefix. $7="mca/$2/$3/libmca_$2_$3.la $$7" fi - echo "extern const mca_base_component_t mca_$2_$3_component;" >> $outfile.extern - echo " &mca_$2_$3_component, " >> $outfile.struct + echo "extern const mca_base_component_t *mca_$2_$3_component_ptr;" >> $outfile.extern + echo " &mca_$2_$3_component_ptr," >> $outfile.struct $5="$$5 $3" fi diff --git a/ompi/mca/bml/r2/bml_r2_component.c b/ompi/mca/bml/r2/bml_r2_component.c index 9420a2e0bc2..72e0984cbec 100644 --- a/ompi/mca/bml/r2/bml_r2_component.c +++ b/ompi/mca/bml/r2/bml_r2_component.c @@ -52,6 +52,7 @@ mca_bml_base_component_2_0_0_t mca_bml_r2_component = { }, .bml_init = mca_bml_r2_component_init, }; +MCA_BASE_COMPONENT_INIT(ompi, bml, r2) static int mca_bml_r2_component_register(void) { diff --git a/ompi/mca/coll/accelerator/coll_accelerator_component.c b/ompi/mca/coll/accelerator/coll_accelerator_component.c index be0452668b2..c8c3a7c1ab3 100644 --- a/ompi/mca/coll/accelerator/coll_accelerator_component.c +++ b/ompi/mca/coll/accelerator/coll_accelerator_component.c @@ -75,6 +75,7 @@ mca_coll_accelerator_component_t mca_coll_accelerator_component = { /* Priority: make it above all point to point collectives including self */ .priority = 78, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, accelerator) static int accelerator_register(void) diff --git a/ompi/mca/coll/acoll/coll_acoll_component.c b/ompi/mca/coll/acoll/coll_acoll_component.c index eb16c68eeb9..c493e66867c 100644 --- a/ompi/mca/coll/acoll/coll_acoll_component.c +++ b/ompi/mca/coll/acoll/coll_acoll_component.c @@ -90,6 +90,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_acoll_component = { .collm_init_query = mca_coll_acoll_init_query, .collm_comm_query = mca_coll_acoll_comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, acoll) static int acoll_register(void) { diff --git a/ompi/mca/coll/adapt/coll_adapt_component.c b/ompi/mca/coll/adapt/coll_adapt_component.c index 3d7d7e16cbe..be2009c4a2f 100644 --- a/ompi/mca/coll/adapt/coll_adapt_component.c +++ b/ompi/mca/coll/adapt/coll_adapt_component.c @@ -74,6 +74,7 @@ mca_coll_adapt_component_t mca_coll_adapt_component = { /* default values for non-MCA parameters */ /* Not specifying values here gives us all 0's */ }; +MCA_BASE_COMPONENT_INIT(ompi, coll, adapt) /* Open the component */ static int adapt_open(void) diff --git a/ompi/mca/coll/basic/coll_basic_component.c b/ompi/mca/coll/basic/coll_basic_component.c index d38850744c0..8d3c27626ef 100644 --- a/ompi/mca/coll/basic/coll_basic_component.c +++ b/ompi/mca/coll/basic/coll_basic_component.c @@ -82,6 +82,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_basic_component = { .collm_init_query = mca_coll_basic_init_query, .collm_comm_query = mca_coll_basic_comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, basic) static int diff --git a/ompi/mca/coll/demo/coll_demo_component.c b/ompi/mca/coll/demo/coll_demo_component.c index 0740d98091c..b7c96cdcae4 100644 --- a/ompi/mca/coll/demo/coll_demo_component.c +++ b/ompi/mca/coll/demo/coll_demo_component.c @@ -82,6 +82,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_demo_component = { .collm_init_query = mca_coll_demo_init_query, .collm_comm_query = mca_coll_demo_comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, demo) static int demo_register(void) diff --git a/ompi/mca/coll/ftagree/coll_ftagree_component.c b/ompi/mca/coll/ftagree/coll_ftagree_component.c index 7414833d3fc..97e9ca4cee7 100644 --- a/ompi/mca/coll/ftagree/coll_ftagree_component.c +++ b/ompi/mca/coll/ftagree/coll_ftagree_component.c @@ -78,6 +78,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_ftagree_component = { mca_coll_ftagree_init_query, mca_coll_ftagree_comm_query }; +MCA_BASE_COMPONENT_INIT(ompi, coll, ftagree) static int ftagree_close(void) diff --git a/ompi/mca/coll/han/coll_han_component.c b/ompi/mca/coll/han/coll_han_component.c index a8a649dd080..1d78bf87158 100644 --- a/ompi/mca/coll/han/coll_han_component.c +++ b/ompi/mca/coll/han/coll_han_component.c @@ -104,6 +104,7 @@ mca_coll_han_component_t mca_coll_han_component = { /* workaround for nvcc compiler */ .dynamic_rules_filename = NULL, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, han) /* * Init the component diff --git a/ompi/mca/coll/hcoll/coll_hcoll_component.c b/ompi/mca/coll/hcoll/coll_hcoll_component.c index e34169a0781..2c276cf79a4 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_component.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_component.c @@ -64,6 +64,7 @@ mca_coll_hcoll_component_t mca_coll_hcoll_component = { 0, /* hcoll_enable */ NULL /*hcoll version */ }; +MCA_BASE_COMPONENT_INIT(ompi, coll, hcoll) diff --git a/ompi/mca/coll/inter/coll_inter_component.c b/ompi/mca/coll/inter/coll_inter_component.c index 4b3d28d1b74..3c71e4851fc 100644 --- a/ompi/mca/coll/inter/coll_inter_component.c +++ b/ompi/mca/coll/inter/coll_inter_component.c @@ -82,6 +82,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_inter_component = { .collm_init_query = mca_coll_inter_init_query, .collm_comm_query = mca_coll_inter_comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, inter) static int inter_register(void) diff --git a/ompi/mca/coll/libnbc/coll_libnbc_component.c b/ompi/mca/coll/libnbc/coll_libnbc_component.c index 4d0f6b74265..c5b616ef482 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_component.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_component.c @@ -142,6 +142,7 @@ ompi_coll_libnbc_component_t mca_coll_libnbc_component = { .collm_comm_query = libnbc_comm_query, } }; +MCA_BASE_COMPONENT_INIT(ompi, coll, libnbc) static int diff --git a/ompi/mca/coll/monitoring/coll_monitoring_component.c b/ompi/mca/coll/monitoring/coll_monitoring_component.c index 670081fb70c..934d426ced8 100644 --- a/ompi/mca/coll/monitoring/coll_monitoring_component.c +++ b/ompi/mca/coll/monitoring/coll_monitoring_component.c @@ -232,6 +232,7 @@ mca_coll_monitoring_component_t mca_coll_monitoring_component = { }, .priority = INT_MAX }; +MCA_BASE_COMPONENT_INIT(ompi, coll, monitoring) OBJ_CLASS_INSTANCE(mca_coll_monitoring_module_t, mca_coll_base_module_t, diff --git a/ompi/mca/coll/portals4/coll_portals4_component.c b/ompi/mca/coll/portals4/coll_portals4_component.c index 5c95f129703..2db7fee8616 100644 --- a/ompi/mca/coll/portals4/coll_portals4_component.c +++ b/ompi/mca/coll/portals4/coll_portals4_component.c @@ -209,6 +209,7 @@ mca_coll_portals4_component_t mca_coll_portals4_component = { .collm_comm_query = portals4_comm_query, }, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, portals4) int opal_stderr(const char *msg, const char *file, diff --git a/ompi/mca/coll/self/coll_self_component.c b/ompi/mca/coll/self/coll_self_component.c index 9afb69f6a4b..b8e1c6a2b3f 100644 --- a/ompi/mca/coll/self/coll_self_component.c +++ b/ompi/mca/coll/self/coll_self_component.c @@ -81,6 +81,7 @@ const mca_coll_base_component_3_0_0_t mca_coll_self_component = { .collm_init_query = mca_coll_self_init_query, .collm_comm_query = mca_coll_self_comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, self) static int self_register(void) { diff --git a/ompi/mca/coll/sync/coll_sync_component.c b/ompi/mca/coll/sync/coll_sync_component.c index 92d9fcd25c4..8e1030c5dcd 100644 --- a/ompi/mca/coll/sync/coll_sync_component.c +++ b/ompi/mca/coll/sync/coll_sync_component.c @@ -70,6 +70,7 @@ mca_coll_sync_component_t mca_coll_sync_component = { .collm_comm_query = mca_coll_sync_comm_query }, }; +MCA_BASE_COMPONENT_INIT(ompi, coll, sync) static int sync_register(void) diff --git a/ompi/mca/coll/tuned/coll_tuned_component.c b/ompi/mca/coll/tuned/coll_tuned_component.c index 39894bb1cf1..d8dbb7959e4 100644 --- a/ompi/mca/coll/tuned/coll_tuned_component.c +++ b/ompi/mca/coll/tuned/coll_tuned_component.c @@ -128,6 +128,7 @@ mca_coll_tuned_component_t mca_coll_tuned_component = { /* Tuned component specific information */ NULL /* ompi_coll_alg_rule_t ptr */ }; +MCA_BASE_COMPONENT_INIT(ompi, coll, tuned) static int tuned_register(void) { diff --git a/ompi/mca/coll/ucc/coll_ucc_component.c b/ompi/mca/coll/ucc/coll_ucc_component.c index b697ab787c2..2f065c8404e 100644 --- a/ompi/mca/coll/ucc/coll_ucc_component.c +++ b/ompi/mca/coll/ucc/coll_ucc_component.c @@ -55,6 +55,7 @@ mca_coll_ucc_component_t mca_coll_ucc_component = { COLL_UCC_CTS_STR, /* requested coll_types string */ UCC_VERSION_STRING /* ucc version */ }; +MCA_BASE_COMPONENT_INIT(ompi, coll, ucc) static int mca_coll_ucc_register(void) { diff --git a/ompi/mca/coll/xhc/coll_xhc_component.c b/ompi/mca/coll/xhc/coll_xhc_component.c index bfd03259de4..5c196db1e31 100644 --- a/ompi/mca/coll/xhc/coll_xhc_component.c +++ b/ompi/mca/coll/xhc/coll_xhc_component.c @@ -113,6 +113,7 @@ mca_coll_xhc_component_t mca_coll_xhc_component = { .op_mca = {{0}}, .op_mca_global = {0} }; +MCA_BASE_COMPONENT_INIT(ompi, coll, xhc) /* Rather than having the defaults directly inside the component, we keep * them in a separate structure and copy them over (in xhc_register()). The diff --git a/ompi/mca/fbtl/ime/fbtl_ime_component.c b/ompi/mca/fbtl/ime/fbtl_ime_component.c index 82d738879ff..d5bf5319b3d 100644 --- a/ompi/mca/fbtl/ime/fbtl_ime_component.c +++ b/ompi/mca/fbtl/ime/fbtl_ime_component.c @@ -54,6 +54,7 @@ mca_fbtl_base_component_2_0_0_t mca_fbtl_ime_component = { .fbtlm_file_query = mca_fbtl_ime_component_file_query, /* get priority and actions */ .fbtlm_file_unquery = mca_fbtl_ime_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fbtl, ime) static int register_component(void) { diff --git a/ompi/mca/fbtl/posix/fbtl_posix_component.c b/ompi/mca/fbtl/posix/fbtl_posix_component.c index 32f1d41e1a2..620d3e78b9e 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_component.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_component.c @@ -73,6 +73,7 @@ mca_fbtl_base_component_2_0_0_t mca_fbtl_posix_component = { .fbtlm_file_query = mca_fbtl_posix_component_file_query, /* get priority and actions */ .fbtlm_file_unquery = mca_fbtl_posix_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fbtl, posix) static int register_component(void) { diff --git a/ompi/mca/fcoll/dynamic/fcoll_dynamic_component.c b/ompi/mca/fcoll/dynamic/fcoll_dynamic_component.c index 711d4745bc1..304111417d3 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic_component.c +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic_component.c @@ -76,6 +76,7 @@ mca_fcoll_base_component_3_0_0_t mca_fcoll_dynamic_component = { .fcollm_file_query = mca_fcoll_dynamic_component_file_query, .fcollm_file_unquery = mca_fcoll_dynamic_component_file_unquery, }; +MCA_BASE_COMPONENT_INIT(ompi, fcoll, dynamic) static int diff --git a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c index 0b51382b2c1..92be3ecea89 100644 --- a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c +++ b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c @@ -77,6 +77,7 @@ mca_fcoll_base_component_3_0_0_t mca_fcoll_dynamic_gen2_component = { .fcollm_file_query = mca_fcoll_dynamic_gen2_component_file_query, .fcollm_file_unquery = mca_fcoll_dynamic_gen2_component_file_unquery, }; +MCA_BASE_COMPONENT_INIT(ompi, fcoll, dynamic_gen2) static int diff --git a/ompi/mca/fcoll/individual/fcoll_individual_component.c b/ompi/mca/fcoll/individual/fcoll_individual_component.c index 681bfbc3363..c967d2a916f 100644 --- a/ompi/mca/fcoll/individual/fcoll_individual_component.c +++ b/ompi/mca/fcoll/individual/fcoll_individual_component.c @@ -79,6 +79,7 @@ mca_fcoll_base_component_3_0_0_t mca_fcoll_individual_component = { .fcollm_file_query = mca_fcoll_individual_component_file_query, .fcollm_file_unquery = mca_fcoll_individual_component_file_unquery, }; +MCA_BASE_COMPONENT_INIT(ompi, fcoll, individual) static int diff --git a/ompi/mca/fcoll/vulcan/fcoll_vulcan_component.c b/ompi/mca/fcoll/vulcan/fcoll_vulcan_component.c index 5fc8254f164..4644a2fe238 100644 --- a/ompi/mca/fcoll/vulcan/fcoll_vulcan_component.c +++ b/ompi/mca/fcoll/vulcan/fcoll_vulcan_component.c @@ -78,6 +78,7 @@ mca_fcoll_base_component_3_0_0_t mca_fcoll_vulcan_component = { .fcollm_file_query = mca_fcoll_vulcan_component_file_query, .fcollm_file_unquery = mca_fcoll_vulcan_component_file_unquery, }; +MCA_BASE_COMPONENT_INIT(ompi, fcoll, vulcan) static int diff --git a/ompi/mca/fs/gpfs/fs_gpfs_component.c b/ompi/mca/fs/gpfs/fs_gpfs_component.c index 903e1b18d54..93c514f7428 100644 --- a/ompi/mca/fs/gpfs/fs_gpfs_component.c +++ b/ompi/mca/fs/gpfs/fs_gpfs_component.c @@ -65,6 +65,7 @@ mca_fs_base_component_2_0_0_t mca_fs_gpfs_component = { .fsm_file_query = mca_fs_gpfs_component_file_query, /* get priority and actions */ .fsm_file_unquery = mca_fs_gpfs_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fs, gpfs) static int gpfs_register(void) { diff --git a/ompi/mca/fs/ime/fs_ime_component.c b/ompi/mca/fs/ime/fs_ime_component.c index 5b6febff964..705550b6222 100644 --- a/ompi/mca/fs/ime/fs_ime_component.c +++ b/ompi/mca/fs/ime/fs_ime_component.c @@ -56,6 +56,7 @@ mca_fs_base_component_2_0_0_t mca_fs_ime_component = { .fsm_file_query = mca_fs_ime_component_file_query, /* get priority and actions */ .fsm_file_unquery = mca_fs_ime_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fs, ime) static int register_component(void) { diff --git a/ompi/mca/fs/lustre/fs_lustre_component.c b/ompi/mca/fs/lustre/fs_lustre_component.c index c3316654e4e..2b1b8d01116 100644 --- a/ompi/mca/fs/lustre/fs_lustre_component.c +++ b/ompi/mca/fs/lustre/fs_lustre_component.c @@ -82,6 +82,7 @@ mca_fs_base_component_2_0_0_t mca_fs_lustre_component = { .fsm_file_query = mca_fs_lustre_component_file_query, /* get priority and actions */ .fsm_file_unquery = mca_fs_lustre_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fs, lustre) static int lustre_register(void) diff --git a/ompi/mca/fs/ufs/fs_ufs_component.c b/ompi/mca/fs/ufs/fs_ufs_component.c index dd6e4bcb51b..55276b1e438 100644 --- a/ompi/mca/fs/ufs/fs_ufs_component.c +++ b/ompi/mca/fs/ufs/fs_ufs_component.c @@ -79,6 +79,7 @@ mca_fs_base_component_2_0_0_t mca_fs_ufs_component = { .fsm_file_query = mca_fs_ufs_component_file_query, /* get priority and actions */ .fsm_file_unquery = mca_fs_ufs_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, fs, ufs) static int register_component(void) { diff --git a/ompi/mca/hook/base/hook_base.c b/ompi/mca/hook/base/hook_base.c index ae1366fa6fc..b8afaf154bf 100644 --- a/ompi/mca/hook/base/hook_base.c +++ b/ompi/mca/hook/base/hook_base.c @@ -49,9 +49,9 @@ static int ompi_hook_base_register( mca_base_register_flag_t flags ) static int ompi_hook_base_open( mca_base_open_flag_t flags ) { int ret; - const mca_base_component_t **static_components = ompi_hook_base_framework.framework_static_components; + const mca_base_component_t ***static_components = ompi_hook_base_framework.framework_static_components; mca_base_component_list_item_t *cli = NULL; - mca_base_component_t *component = NULL; + const mca_base_component_t *component = NULL; bool found = false; additional_callback_components = OBJ_NEW(opal_list_t); @@ -68,13 +68,14 @@ static int ompi_hook_base_open( mca_base_open_flag_t flags ) */ if( NULL != static_components ) { for (int i = 0 ; NULL != static_components[i]; ++i) { - if( static_components[i]->mca_component_flags & MCA_BASE_COMPONENT_FLAG_REQUIRED ) { + const mca_base_component_t *static_component = *(static_components[i]); + if( static_component->mca_component_flags & MCA_BASE_COMPONENT_FLAG_REQUIRED ) { // Make sure that this component is in the list of components that // were included in the earlier framework_components_open() call. found = false; OPAL_LIST_FOREACH(cli, &ompi_hook_base_framework.framework_components, mca_base_component_list_item_t) { - component = (mca_base_component_t*)cli->cli_component; - if( component == static_components[i] ) { + component = cli->cli_component; + if( component == static_component ) { found = true; break; } @@ -82,7 +83,7 @@ static int ompi_hook_base_open( mca_base_open_flag_t flags ) if( !found ) { opal_show_help("help-mca-hook-base.txt", "hook:missing-required-component", true, ompi_hook_base_framework.framework_name, - static_components[i]->mca_component_name); + static_component->mca_component_name); return OPAL_ERR_NOT_SUPPORTED; } } @@ -180,18 +181,20 @@ MCA_BASE_FRAMEWORK_DECLARE(ompi, hook, "hook hooks", * Otherwise we would need to initialize opal outside of ompi_mpi_init and possibly * after ompi_mpi_finalize which gets messy (especially when trying to cleanup). */ -#define HOOK_CALL_COMMON_HOOK_NOT_INITIALIZED(fn_name, ...) \ - do { \ - ompi_hook_base_component_t *component; \ - int idx; \ - \ - for(idx = 0; NULL != mca_hook_base_static_components[idx]; ++idx ) { \ - component = (ompi_hook_base_component_t*)mca_hook_base_static_components[idx]; \ - if( NULL != component->hookm_ ## fn_name && \ - ompi_hook_base_ ## fn_name != component->hookm_ ## fn_name ) { \ - component->hookm_ ## fn_name ( __VA_ARGS__ ); \ - } \ - } \ +#define HOOK_CALL_COMMON_HOOK_NOT_INITIALIZED(fn_name, ...) \ + do { \ + const mca_base_component_t ***static_components = ompi_hook_base_framework.framework_static_components; \ + \ + if( NULL != static_components ) { \ + for (int i = 0 ; NULL != static_components[i]; ++i) { \ + const mca_base_component_t *base_component = *(static_components[i]); \ + const ompi_hook_base_component_t *component = (const ompi_hook_base_component_t*)base_component; \ + if( NULL != component->hookm_ ## fn_name && \ + ompi_hook_base_ ## fn_name != component->hookm_ ## fn_name ) { \ + component->hookm_ ## fn_name ( __VA_ARGS__ ); \ + } \ + } \ + } \ } while(0) /* @@ -204,10 +207,10 @@ MCA_BASE_FRAMEWORK_DECLARE(ompi, hook, "hook hooks", #define HOOK_CALL_COMMON_HOOK_INITIALIZED(fn_name, ...) \ do { \ mca_base_component_list_item_t *cli; \ - ompi_hook_base_component_t *component; \ \ OPAL_LIST_FOREACH(cli, &ompi_hook_base_framework.framework_components, mca_base_component_list_item_t) { \ - component = (ompi_hook_base_component_t*)cli->cli_component; \ + const mca_base_component_t *base_component = cli->cli_component; \ + const ompi_hook_base_component_t *component = (const ompi_hook_base_component_t*)base_component; \ if( NULL != component->hookm_ ## fn_name && \ ompi_hook_base_ ## fn_name != component->hookm_ ## fn_name ) { \ component->hookm_ ## fn_name ( __VA_ARGS__ ); \ @@ -215,7 +218,8 @@ MCA_BASE_FRAMEWORK_DECLARE(ompi, hook, "hook hooks", } \ \ OPAL_LIST_FOREACH(cli, additional_callback_components, mca_base_component_list_item_t) { \ - component = (ompi_hook_base_component_t*)cli->cli_component; \ + const mca_base_component_t *base_component = cli->cli_component; \ + const ompi_hook_base_component_t *component = (const ompi_hook_base_component_t*)base_component; \ if( NULL != component->hookm_ ## fn_name && \ ompi_hook_base_ ## fn_name != component->hookm_ ## fn_name ) { \ component->hookm_ ## fn_name ( __VA_ARGS__ ); \ diff --git a/ompi/mca/hook/comm_method/hook_comm_method_component.c b/ompi/mca/hook/comm_method/hook_comm_method_component.c index 0adbfccea18..ce32c98132a 100644 --- a/ompi/mca/hook/comm_method/hook_comm_method_component.c +++ b/ompi/mca/hook/comm_method/hook_comm_method_component.c @@ -65,6 +65,7 @@ ompi_hook_base_component_1_0_0_t mca_hook_comm_method_component = { .hookm_mpi_finalize_top = ompi_hook_comm_method_mpi_finalize_top, .hookm_mpi_finalize_bottom = NULL, }; +MCA_BASE_COMPONENT_INIT(ompi, hook, comm_method) enum mca_hook_comm_method_mode_flags_t { /* Display on MPI_INIT */ diff --git a/ompi/mca/hook/demo/hook_demo_component.c b/ompi/mca/hook/demo/hook_demo_component.c index 919b57cf902..24b745b4abd 100644 --- a/ompi/mca/hook/demo/hook_demo_component.c +++ b/ompi/mca/hook/demo/hook_demo_component.c @@ -65,6 +65,7 @@ const ompi_hook_base_component_1_0_0_t mca_hook_demo_component = { .hookm_mpi_finalize_top = ompi_hook_demo_mpi_finalize_top, .hookm_mpi_finalize_bottom = ompi_hook_demo_mpi_finalize_bottom, }; +MCA_BASE_COMPONENT_INIT(ompi, hook, demo) /* * Example 'extra' component with an additional callback that is dynamically diff --git a/ompi/mca/io/ompio/io_ompio_component.c b/ompi/mca/io/ompio/io_ompio_component.c index 0e6fcd01f6c..c4628f5782e 100644 --- a/ompi/mca/io/ompio/io_ompio_component.c +++ b/ompi/mca/io/ompio/io_ompio_component.c @@ -130,6 +130,7 @@ mca_io_base_component_3_0_0_t mca_io_ompio_component = { .io_register_datarep = register_datarep, }; +MCA_BASE_COMPONENT_INIT(ompi, io, ompio) static int register_component(void) { diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 27e52107638..a396a30a1fa 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -116,6 +116,7 @@ mca_mtl_ofi_component_t mca_mtl_ofi_component = { .mtl_init = ompi_mtl_ofi_component_init, } }; +MCA_BASE_COMPONENT_INIT(ompi, mtl, ofi) static int ompi_mtl_ofi_component_register(void) diff --git a/ompi/mca/mtl/portals4/mtl_portals4_component.c b/ompi/mca/mtl/portals4/mtl_portals4_component.c index e9610940e44..71ce5705212 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4_component.c +++ b/ompi/mca/mtl/portals4/mtl_portals4_component.c @@ -71,6 +71,8 @@ mca_mtl_base_component_2_0_0_t mca_mtl_portals4_component = { .mtl_init = ompi_mtl_portals4_component_init, }; +MCA_BASE_COMPONENT_INIT(ompi, mtl, portals4) + static mca_base_var_enum_value_t long_protocol_values[] = { {eager, "eager"}, diff --git a/ompi/mca/mtl/psm2/mtl_psm2_component.c b/ompi/mca/mtl/psm2/mtl_psm2_component.c index e6192e05169..2a61bd7106e 100644 --- a/ompi/mca/mtl/psm2/mtl_psm2_component.c +++ b/ompi/mca/mtl/psm2/mtl_psm2_component.c @@ -88,6 +88,7 @@ mca_mtl_psm2_component_t mca_mtl_psm2_component = { .mtl_init = ompi_mtl_psm2_component_init, } }; +MCA_BASE_COMPONENT_INIT(ompi, mtl, psm2) struct ompi_mtl_psm2_shadow_variable { int variable_type; diff --git a/ompi/mca/op/aarch64/op_aarch64_component.c b/ompi/mca/op/aarch64/op_aarch64_component.c index f8e42795433..bf72fd42a1f 100644 --- a/ompi/mca/op/aarch64/op_aarch64_component.c +++ b/ompi/mca/op/aarch64/op_aarch64_component.c @@ -61,6 +61,7 @@ ompi_op_aarch64_component_t mca_op_aarch64_component = { .opc_op_query = mca_op_aarch64_component_op_query, }, }; +MCA_BASE_COMPONENT_INIT(ompi, op, aarch64) /* * Component open diff --git a/ompi/mca/op/avx/op_avx_component.c b/ompi/mca/op/avx/op_avx_component.c index a2f01a373e2..c33399b2298 100644 --- a/ompi/mca/op/avx/op_avx_component.c +++ b/ompi/mca/op/avx/op_avx_component.c @@ -149,6 +149,7 @@ ompi_op_avx_component_t mca_op_avx_component = { .opc_op_query = avx_component_op_query, }, }; +MCA_BASE_COMPONENT_INIT(ompi, op, avx) /* * Component open diff --git a/ompi/mca/op/example/op_example_component.c b/ompi/mca/op/example/op_example_component.c index af2ac8f4c46..3faac13fdad 100644 --- a/ompi/mca/op/example/op_example_component.c +++ b/ompi/mca/op/example/op_example_component.c @@ -75,6 +75,7 @@ ompi_op_example_component_t mca_op_example_component = { 0/false/whatever. We'll fill them in with meaningful values during _component_init_query(). */ }; +MCA_BASE_COMPONENT_INIT(ompi, op, example) /* * Component open diff --git a/ompi/mca/osc/monitoring/osc_monitoring_component.c b/ompi/mca/osc/monitoring/osc_monitoring_component.c index dcb8a06492d..84cabc65142 100644 --- a/ompi/mca/osc/monitoring/osc_monitoring_component.c +++ b/ompi/mca/osc/monitoring/osc_monitoring_component.c @@ -137,3 +137,4 @@ ompi_osc_monitoring_component_t mca_osc_monitoring_component = { }, .priority = INT_MAX }; +MCA_BASE_COMPONENT_INIT(ompi, osc, monitoring) diff --git a/ompi/mca/osc/portals4/osc_portals4_component.c b/ompi/mca/osc/portals4/osc_portals4_component.c index 3e2b99ad039..75bdffaf278 100644 --- a/ompi/mca/osc/portals4/osc_portals4_component.c +++ b/ompi/mca/osc/portals4/osc_portals4_component.c @@ -66,6 +66,7 @@ ompi_osc_portals4_component_t mca_osc_portals4_component = { .osc_finalize = component_finalize, } }; +MCA_BASE_COMPONENT_INIT(ompi, osc, portals4) ompi_osc_portals4_module_t ompi_osc_portals4_module_template = { diff --git a/ompi/mca/osc/rdma/osc_rdma_component.c b/ompi/mca/osc/rdma/osc_rdma_component.c index a7a005a8afe..41b5f9fe553 100644 --- a/ompi/mca/osc/rdma/osc_rdma_component.c +++ b/ompi/mca/osc/rdma/osc_rdma_component.c @@ -110,6 +110,7 @@ ompi_osc_rdma_component_t mca_osc_rdma_component = { .osc_finalize = ompi_osc_rdma_component_finalize } }; +MCA_BASE_COMPONENT_INIT(ompi, osc, rdma) ompi_osc_base_module_t ompi_osc_rdma_module_rdma_template = { .osc_win_attach = ompi_osc_rdma_attach, diff --git a/ompi/mca/osc/sm/osc_sm_component.c b/ompi/mca/osc/sm/osc_sm_component.c index ae87b960a9d..87ed6a1431b 100644 --- a/ompi/mca/osc/sm/osc_sm_component.c +++ b/ompi/mca/osc/sm/osc_sm_component.c @@ -66,6 +66,7 @@ ompi_osc_sm_component_t mca_osc_sm_component = { .osc_finalize = component_finalize, } }; +MCA_BASE_COMPONENT_INIT(ompi, osc, sm) ompi_osc_sm_module_t ompi_osc_sm_module_template = { diff --git a/ompi/mca/osc/ucx/osc_ucx_component.c b/ompi/mca/osc/ucx/osc_ucx_component.c index 91886233fd6..27201eae8ff 100644 --- a/ompi/mca/osc/ucx/osc_ucx_component.c +++ b/ompi/mca/osc/ucx/osc_ucx_component.c @@ -85,6 +85,7 @@ ompi_osc_ucx_component_t mca_osc_ucx_component = { .comm_world_size = 0, .endpoints = NULL }; +MCA_BASE_COMPONENT_INIT(ompi, osc, ucx) ompi_osc_ucx_module_t ompi_osc_ucx_module_template = { { diff --git a/ompi/mca/part/persist/part_persist_component.c b/ompi/mca/part/persist/part_persist_component.c index 919284476b9..f0731c440b2 100644 --- a/ompi/mca/part/persist/part_persist_component.c +++ b/ompi/mca/part/persist/part_persist_component.c @@ -56,6 +56,7 @@ mca_part_base_component_4_0_0_t mca_part_persist_component = { .partm_init = mca_part_persist_component_init, .partm_finalize = mca_part_persist_component_fini, }; +MCA_BASE_COMPONENT_INIT(ompi, part, persist) static int mca_part_persist_component_register(void) diff --git a/ompi/mca/pml/cm/pml_cm_component.c b/ompi/mca/pml/cm/pml_cm_component.c index 7ea3678cb6e..9c6dac3e0e7 100644 --- a/ompi/mca/pml/cm/pml_cm_component.c +++ b/ompi/mca/pml/cm/pml_cm_component.c @@ -64,6 +64,7 @@ mca_pml_base_component_2_1_0_t mca_pml_cm_component = { .pmlm_init = mca_pml_cm_component_init, .pmlm_finalize = mca_pml_cm_component_fini, }; +MCA_BASE_COMPONENT_INIT(ompi, pml, cm) static int mca_pml_cm_component_register(void) diff --git a/ompi/mca/pml/example/pml_example_component.c b/ompi/mca/pml/example/pml_example_component.c index 17528c65f13..6ee8ff44415 100644 --- a/ompi/mca/pml/example/pml_example_component.c +++ b/ompi/mca/pml/example/pml_example_component.c @@ -54,6 +54,7 @@ mca_pml_base_component_2_1_0_t mca_pml_example_component = { .pmlm_init = mca_pml_example_component_init, .pmlm_finalize = mca_pml_example_component_fini, }; +MCA_BASE_COMPONENT_INIT(ompi, pml, example) static int mca_pml_example_component_register(void) { diff --git a/ompi/mca/pml/monitoring/pml_monitoring_component.c b/ompi/mca/pml/monitoring/pml_monitoring_component.c index e11f2826c7f..3e42ed28dd2 100644 --- a/ompi/mca/pml/monitoring/pml_monitoring_component.c +++ b/ompi/mca/pml/monitoring/pml_monitoring_component.c @@ -206,4 +206,5 @@ mca_pml_base_component_2_1_0_t mca_pml_monitoring_component = { .pmlm_init = mca_pml_monitoring_component_init, /* component init */ .pmlm_finalize = mca_pml_monitoring_component_finish /* component finalize */ }; +MCA_BASE_COMPONENT_INIT(ompi, pml, monitoring) diff --git a/ompi/mca/pml/ob1/pml_ob1_component.c b/ompi/mca/pml/ob1/pml_ob1_component.c index 74786121e4f..0736ed7d9ee 100644 --- a/ompi/mca/pml/ob1/pml_ob1_component.c +++ b/ompi/mca/pml/ob1/pml_ob1_component.c @@ -87,6 +87,7 @@ mca_pml_base_component_2_1_0_t mca_pml_ob1_component = { .pmlm_init = mca_pml_ob1_component_init, .pmlm_finalize = mca_pml_ob1_component_fini, }; +MCA_BASE_COMPONENT_INIT(ompi, pml, ob1) void *mca_pml_ob1_seg_alloc (void *ctx, size_t* size); diff --git a/ompi/mca/pml/ucx/pml_ucx_component.c b/ompi/mca/pml/ucx/pml_ucx_component.c index ec095e19fef..9e41ac57308 100644 --- a/ompi/mca/pml/ucx/pml_ucx_component.c +++ b/ompi/mca/pml/ucx/pml_ucx_component.c @@ -46,6 +46,7 @@ mca_pml_base_component_2_1_0_t mca_pml_ucx_component = { .pmlm_init = mca_pml_ucx_component_init, .pmlm_finalize = mca_pml_ucx_component_fini }; +MCA_BASE_COMPONENT_INIT(ompi, pml, ucx) static int mca_pml_ucx_component_register(void) { diff --git a/ompi/mca/pml/v/pml_v_component.c b/ompi/mca/pml/v/pml_v_component.c index a9da93e4661..0c710f56441 100644 --- a/ompi/mca/pml/v/pml_v_component.c +++ b/ompi/mca/pml/v/pml_v_component.c @@ -61,6 +61,7 @@ mca_pml_base_component_2_1_0_t mca_pml_v_component = .pmlm_init = mca_pml_v_component_init, .pmlm_finalize = mca_pml_v_component_finalize, }; +MCA_BASE_COMPONENT_INIT(ompi, pml, v) static char *ompi_pml_vprotocol_include_list; static char *ompi_pml_v_output; diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual_component.c b/ompi/mca/sharedfp/individual/sharedfp_individual_component.c index fff66f8bbf8..91829a8a3e5 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual_component.c +++ b/ompi/mca/sharedfp/individual/sharedfp_individual_component.c @@ -72,6 +72,7 @@ mca_sharedfp_base_component_3_0_0_t mca_sharedfp_individual_component = { .sharedfpm_file_query = mca_sharedfp_individual_component_file_query, /* get priority and actions */ .sharedfpm_file_unquery = mca_sharedfp_individual_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, sharedfp, individual) static int individual_register(void) { diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_component.c b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_component.c index 044fcb8fb97..d6f2109ce8f 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_component.c +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_component.c @@ -71,6 +71,7 @@ mca_sharedfp_base_component_3_0_0_t mca_sharedfp_lockedfile_component = { .sharedfpm_file_query = mca_sharedfp_lockedfile_component_file_query, /* get priority and actions */ .sharedfpm_file_unquery = mca_sharedfp_lockedfile_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, sharedfp, lockedfile) static int lockedfile_register(void) { diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm_component.c b/ompi/mca/sharedfp/sm/sharedfp_sm_component.c index 8198c99c042..8dab5e24fcd 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm_component.c +++ b/ompi/mca/sharedfp/sm/sharedfp_sm_component.c @@ -71,6 +71,7 @@ mca_sharedfp_base_component_3_0_0_t mca_sharedfp_sm_component = { .sharedfpm_file_query = mca_sharedfp_sm_component_file_query, /* get priority and actions */ .sharedfpm_file_unquery =mca_sharedfp_sm_component_file_unquery, /* undo what was done by previous function */ }; +MCA_BASE_COMPONENT_INIT(ompi, sharedfp, sm) static int sm_register(void) { diff --git a/ompi/mca/topo/basic/topo_basic_component.c b/ompi/mca/topo/basic/topo_basic_component.c index f8d2fd494c8..dc6dc4f4665 100644 --- a/ompi/mca/topo/basic/topo_basic_component.c +++ b/ompi/mca/topo/basic/topo_basic_component.c @@ -53,6 +53,7 @@ mca_topo_basic_component_t mca_topo_basic_component = .topoc_init_query = init_query, .topoc_query = mca_topo_basic_query, }; +MCA_BASE_COMPONENT_INIT(ompi, topo, basic) static int init_query(bool enable_progress_threads, bool enable_mpi_threads) diff --git a/ompi/mca/topo/example/topo_example_component.c b/ompi/mca/topo/example/topo_example_component.c index 799471a8a37..07d222dd6a4 100644 --- a/ompi/mca/topo/example/topo_example_component.c +++ b/ompi/mca/topo/example/topo_example_component.c @@ -59,6 +59,7 @@ mca_topo_base_component_2_2_0_t mca_topo_example_component = .topoc_init_query = init_query, .topoc_comm_query = comm_query, }; +MCA_BASE_COMPONENT_INIT(ompi, topo, example) static int init_query(bool enable_progress_threads, bool enable_mpi_threads) diff --git a/ompi/mca/topo/treematch/topo_treematch_component.c b/ompi/mca/topo/treematch/topo_treematch_component.c index ba1d870e5e3..ae19fcb9b54 100644 --- a/ompi/mca/topo/treematch/topo_treematch_component.c +++ b/ompi/mca/topo/treematch/topo_treematch_component.c @@ -54,6 +54,7 @@ mca_topo_treematch_component_2_2_0_t mca_topo_treematch_component = }, .reorder_mode = 0 /* reorder: by default centralized */ }; +MCA_BASE_COMPONENT_INIT(ompi, topo, treematch) static int init_query(bool enable_progress_threads, bool enable_mpi_threads) diff --git a/ompi/mca/vprotocol/example/vprotocol_example_component.c b/ompi/mca/vprotocol/example/vprotocol_example_component.c index 610171bb647..51c36e0198d 100644 --- a/ompi/mca/vprotocol/example/vprotocol_example_component.c +++ b/ompi/mca/vprotocol/example/vprotocol_example_component.c @@ -50,6 +50,7 @@ mca_pml_v_protocol_base_component_2_0_0_t mca_vprotocol_example_component = .pmlm_init = mca_vprotocol_example_component_init, .pmlm_finalize = mca_vprotocol_example_component_finalize, }; +MCA_BASE_COMPONENT_INIT(ompi, vprotocol, example) /** MCA level functions */ diff --git a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c index 005f55bc33f..07a3408a84b 100644 --- a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c +++ b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c @@ -56,6 +56,7 @@ mca_vprotocol_base_component_2_0_0_t mca_vprotocol_pessimist_component = .pmlm_init = mca_vprotocol_pessimist_component_init, .pmlm_finalize = mca_vprotocol_pessimist_component_finalize, }; +MCA_BASE_COMPONENT_INIT(ompi, vprotocol, pessimist) /** MCA level functions */ diff --git a/opal/mca/accelerator/cuda/accelerator_cuda_component.c b/opal/mca/accelerator/cuda/accelerator_cuda_component.c index e93e61a4a0d..f7ffe8f3228 100644 --- a/opal/mca/accelerator/cuda/accelerator_cuda_component.c +++ b/opal/mca/accelerator/cuda/accelerator_cuda_component.c @@ -108,6 +108,7 @@ opal_accelerator_cuda_component_t mca_accelerator_cuda_component = {{ .accelerator_init = accelerator_cuda_init, .accelerator_finalize = accelerator_cuda_finalize, }}; +MCA_BASE_COMPONENT_INIT(opal, accelerator, cuda) static int accelerator_cuda_open(void) { diff --git a/opal/mca/accelerator/null/accelerator_null_component.c b/opal/mca/accelerator/null/accelerator_null_component.c index 996e5d59bce..b5553d5af3d 100644 --- a/opal/mca/accelerator/null/accelerator_null_component.c +++ b/opal/mca/accelerator/null/accelerator_null_component.c @@ -134,6 +134,7 @@ opal_accelerator_null_component_t mca_accelerator_null_component = {{ .accelerator_init = accelerator_null_init, .accelerator_finalize = accelerator_null_finalize, }}; +MCA_BASE_COMPONENT_INIT(opal, accelerator, null) opal_accelerator_base_module_t opal_accelerator_null_module = { diff --git a/opal/mca/accelerator/rocm/accelerator_rocm_component.c b/opal/mca/accelerator/rocm/accelerator_rocm_component.c index 8e11f8ea7ee..48c6a70ee7f 100644 --- a/opal/mca/accelerator/rocm/accelerator_rocm_component.c +++ b/opal/mca/accelerator/rocm/accelerator_rocm_component.c @@ -115,6 +115,7 @@ opal_accelerator_rocm_component_t mca_accelerator_rocm_component = {{ .accelerator_init = accelerator_rocm_init, .accelerator_finalize = accelerator_rocm_finalize, }}; +MCA_BASE_COMPONENT_INIT(opal, accelerator, rocm) static int accelerator_rocm_open(void) { diff --git a/opal/mca/accelerator/ze/accelerator_ze_component.c b/opal/mca/accelerator/ze/accelerator_ze_component.c index 2a7aa985afe..723b4d5b487 100644 --- a/opal/mca/accelerator/ze/accelerator_ze_component.c +++ b/opal/mca/accelerator/ze/accelerator_ze_component.c @@ -95,6 +95,7 @@ opal_accelerator_ze_component_t mca_accelerator_ze_component = {{ .accelerator_init = accelerator_ze_init, .accelerator_finalize = accelerator_ze_finalize, }}; +MCA_BASE_COMPONENT_INIT(opal, accelerator, ze) static int accelerator_ze_open(void) { diff --git a/opal/mca/allocator/basic/allocator_basic.c b/opal/mca/allocator/basic/allocator_basic.c index ddb4d8193d7..f87aad3ff87 100644 --- a/opal/mca/allocator/basic/allocator_basic.c +++ b/opal/mca/allocator/basic/allocator_basic.c @@ -42,6 +42,7 @@ mca_allocator_base_component_t mca_allocator_basic_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, mca_allocator_basic_component_init}; +MCA_BASE_COMPONENT_INIT(opal, allocator, basic) OBJ_CLASS_INSTANCE(mca_allocator_basic_segment_t, opal_free_list_item_t, NULL, NULL); diff --git a/opal/mca/allocator/bucket/allocator_bucket.c b/opal/mca/allocator/bucket/allocator_bucket.c index 3d9a2617af6..47cbe66ed9e 100644 --- a/opal/mca/allocator/bucket/allocator_bucket.c +++ b/opal/mca/allocator/bucket/allocator_bucket.c @@ -124,3 +124,4 @@ mca_allocator_base_component_t mca_allocator_bucket_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, mca_allocator_bucket_module_init}; +MCA_BASE_COMPONENT_INIT(opal, allocator, bucket) diff --git a/opal/mca/backtrace/execinfo/backtrace_execinfo_component.c b/opal/mca/backtrace/execinfo/backtrace_execinfo_component.c index fd36bbffe0c..fdc27fb9e21 100644 --- a/opal/mca/backtrace/execinfo/backtrace_execinfo_component.c +++ b/opal/mca/backtrace/execinfo/backtrace_execinfo_component.c @@ -39,3 +39,4 @@ const opal_backtrace_base_component_2_0_0_t mca_backtrace_execinfo_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, backtrace, execinfo) diff --git a/opal/mca/backtrace/none/backtrace_none_component.c b/opal/mca/backtrace/none/backtrace_none_component.c index a5021183b86..f62b72b578b 100644 --- a/opal/mca/backtrace/none/backtrace_none_component.c +++ b/opal/mca/backtrace/none/backtrace_none_component.c @@ -43,3 +43,4 @@ const opal_backtrace_base_component_2_0_0_t mca_backtrace_none_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, backtrace, none) diff --git a/opal/mca/backtrace/printstack/backtrace_printstack_component.c b/opal/mca/backtrace/printstack/backtrace_printstack_component.c index 7174383bb72..d34b11d79cb 100644 --- a/opal/mca/backtrace/printstack/backtrace_printstack_component.c +++ b/opal/mca/backtrace/printstack/backtrace_printstack_component.c @@ -39,3 +39,4 @@ const opal_backtrace_base_component_2_0_0_t mca_backtrace_printstack_component = {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, backtrace, none) diff --git a/opal/mca/base/mca_base_component_find.c b/opal/mca/base/mca_base_component_find.c index 3f22f57a4d8..14dac152ad4 100644 --- a/opal/mca/base/mca_base_component_find.c +++ b/opal/mca/base/mca_base_component_find.c @@ -101,7 +101,7 @@ static bool use_component(const mca_base_framework_t *framework, const bool incl int mca_base_component_find(const char *directory, mca_base_framework_t *framework, bool ignore_requested, bool open_dso_components) { - const mca_base_component_t **static_components = framework->framework_static_components; + const mca_base_component_t ***static_components = framework->framework_static_components; char **requested_component_names = NULL; mca_base_component_list_item_t *cli; bool include_mode = true; @@ -118,14 +118,15 @@ int mca_base_component_find(const char *directory, mca_base_framework_t *framewo /* Find all the components that were statically linked in */ if (static_components) { for (int i = 0; NULL != static_components[i]; ++i) { + const mca_base_component_t *static_component = *(static_components[i]); if (use_component(framework, include_mode, (const char **) requested_component_names, - static_components[i]->mca_component_name)) { + static_component->mca_component_name)) { cli = OBJ_NEW(mca_base_component_list_item_t); if (NULL == cli) { ret = OPAL_ERR_OUT_OF_RESOURCE; goto component_find_out; } - cli->cli_component = static_components[i]; + cli->cli_component = static_component; opal_list_append(&framework->framework_components, (opal_list_item_t *) cli); } } diff --git a/opal/mca/base/mca_base_framework.h b/opal/mca/base/mca_base_framework.h index d79428cb43d..fde29f909b0 100644 --- a/opal/mca/base/mca_base_framework.h +++ b/opal/mca/base/mca_base_framework.h @@ -144,7 +144,7 @@ typedef struct mca_base_framework_t { /** Framework open count */ int framework_refcnt; /** List of static components */ - const mca_base_component_t **framework_static_components; + const mca_base_component_t ***framework_static_components; /** Component selection. This will be registered with the MCA variable system and should be either NULL (all components) or a heap allocated, comma-delimited list of components. */ diff --git a/opal/mca/btl/ofi/btl_ofi_component.c b/opal/mca/btl/ofi/btl_ofi_component.c index 3c3ff6da4e1..b303dde032f 100644 --- a/opal/mca/btl/ofi/btl_ofi_component.c +++ b/opal/mca/btl/ofi/btl_ofi_component.c @@ -820,3 +820,4 @@ mca_btl_ofi_component_t mca_btl_ofi_component = { .btl_progress = mca_btl_ofi_component_progress, }, }; +MCA_BASE_COMPONENT_INIT(opal, btl, ofi) diff --git a/opal/mca/btl/portals4/btl_portals4_component.c b/opal/mca/btl/portals4/btl_portals4_component.c index 36671327c96..69c19e653a9 100644 --- a/opal/mca/btl/portals4/btl_portals4_component.c +++ b/opal/mca/btl/portals4/btl_portals4_component.c @@ -66,6 +66,7 @@ mca_btl_portals4_component_t mca_btl_portals4_component = {{ .btl_init = mca_btl_portals4_component_init, .btl_progress = mca_btl_portals4_component_progress, }}; +MCA_BASE_COMPONENT_INIT(opal, btl, portals4) static int mca_btl_portals4_component_register(void) { diff --git a/opal/mca/btl/self/btl_self_component.c b/opal/mca/btl/self/btl_self_component.c index 875fd066bb7..4fc78e6abb8 100644 --- a/opal/mca/btl/self/btl_self_component.c +++ b/opal/mca/btl/self/btl_self_component.c @@ -66,6 +66,7 @@ mca_btl_self_component_t mca_btl_self_component = { .btl_init = mca_btl_self_component_init, } /* end super */ }; +MCA_BASE_COMPONENT_INIT(opal, btl, self) /* * Called by MCA framework to open the component, registers diff --git a/opal/mca/btl/sm/btl_sm_component.c b/opal/mca/btl/sm/btl_sm_component.c index a0ec85e1f40..21e1bcf2a6c 100644 --- a/opal/mca/btl/sm/btl_sm_component.c +++ b/opal/mca/btl/sm/btl_sm_component.c @@ -92,6 +92,7 @@ mca_btl_sm_component_t mca_btl_sm_component = { .btl_progress = mca_btl_sm_component_progress, } /* end super */ }; +MCA_BASE_COMPONENT_INIT(opal, btl, sm) static int mca_btl_sm_component_register(void) { diff --git a/opal/mca/btl/smcuda/btl_smcuda_component.c b/opal/mca/btl/smcuda/btl_smcuda_component.c index a3662e2db0e..72b75d67311 100644 --- a/opal/mca/btl/smcuda/btl_smcuda_component.c +++ b/opal/mca/btl/smcuda/btl_smcuda_component.c @@ -103,6 +103,7 @@ mca_btl_smcuda_component_t mca_btl_smcuda_component = { .btl_progress = mca_btl_smcuda_component_progress, } /* end super */ }; +MCA_BASE_COMPONENT_INIT(opal, btl, smcuda) /* * utility routines for parameter registration diff --git a/opal/mca/btl/tcp/btl_tcp_component.c b/opal/mca/btl/tcp/btl_tcp_component.c index 131d9c1fe53..39715729c96 100644 --- a/opal/mca/btl/tcp/btl_tcp_component.c +++ b/opal/mca/btl/tcp/btl_tcp_component.c @@ -126,6 +126,7 @@ mca_btl_tcp_component_t mca_btl_tcp_component = { .btl_init = mca_btl_tcp_component_init, .btl_progress = NULL, }}; +MCA_BASE_COMPONENT_INIT(opal, btl, tcp) /* * utility routines for parameter registration diff --git a/opal/mca/btl/template/btl_template_component.c b/opal/mca/btl/template/btl_template_component.c index af71db179a0..2aafbf697f5 100644 --- a/opal/mca/btl/template/btl_template_component.c +++ b/opal/mca/btl/template/btl_template_component.c @@ -67,6 +67,7 @@ mca_btl_template_component_t mca_btl_template_component = { .btl_init = mca_btl_template_component_init, .btl_progress = mca_btl_template_component_progress, }}; +MCA_BASE_COMPONENT_INIT(opal, btl, template) static int mca_btl_template_component_open(void) { diff --git a/opal/mca/btl/uct/btl_uct_component.c b/opal/mca/btl/uct/btl_uct_component.c index 5eec97ec487..3d7f2fb65f6 100644 --- a/opal/mca/btl/uct/btl_uct_component.c +++ b/opal/mca/btl/uct/btl_uct_component.c @@ -706,6 +706,7 @@ mca_btl_uct_component_t mca_btl_uct_component = { .btl_init = mca_btl_uct_component_init, .btl_progress = mca_btl_uct_component_progress, }}; +MCA_BASE_COMPONENT_INIT(opal, btl, uct) static void safety_valve(void) __opal_attribute_destructor__; void safety_valve(void) { diff --git a/opal/mca/btl/usnic/btl_usnic_component.c b/opal/mca/btl/usnic/btl_usnic_component.c index 84f96938be9..8a65f671ef9 100644 --- a/opal/mca/btl/usnic/btl_usnic_component.c +++ b/opal/mca/btl/usnic/btl_usnic_component.c @@ -145,6 +145,7 @@ opal_btl_usnic_component_t mca_btl_usnic_component = { .btl_init = usnic_component_init, .btl_progress = usnic_component_progress, }}; +MCA_BASE_COMPONENT_INIT(opal, btl, usnic) /* * Called by MCA framework to open the component diff --git a/opal/mca/dl/dlopen/dl_dlopen_component.c b/opal/mca/dl/dlopen/dl_dlopen_component.c index 046878bb9e9..79c1eab2792 100644 --- a/opal/mca/dl/dlopen/dl_dlopen_component.c +++ b/opal/mca/dl/dlopen/dl_dlopen_component.c @@ -68,6 +68,7 @@ opal_dl_dlopen_component_t mca_dl_dlopen_component = { /* The dl framework members */ .priority = 80}, }; +MCA_BASE_COMPONENT_INIT(opal, dl, dlopen) static int dlopen_component_register(void) { diff --git a/opal/mca/dl/libltdl/dl_libltdl_component.c b/opal/mca/dl/libltdl/dl_libltdl_component.c index a75ba852252..c3979934cf8 100644 --- a/opal/mca/dl/libltdl/dl_libltdl_component.c +++ b/opal/mca/dl/libltdl/dl_libltdl_component.c @@ -71,6 +71,7 @@ opal_dl_libltdl_component_t mca_dl_libltdl_component = { /* Now fill in the libltdl component-specific members */ }; +MCA_BASE_COMPONENT_INIT(opal, dl, libltdl) static int libltdl_component_register(void) { diff --git a/opal/mca/hwloc/base/static-components.h b/opal/mca/hwloc/base/static-components.h index 3e5b0f9b19d..4d95b68433e 100644 --- a/opal/mca/hwloc/base/static-components.h +++ b/opal/mca/hwloc/base/static-components.h @@ -5,9 +5,9 @@ extern "C" { #endif -const mca_base_component_t *mca_hwloc_base_static_components[] = { - - NULL}; +const mca_base_component_t **mca_hwloc_base_static_components[] = { + NULL +}; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/opal/mca/if/bsdx_ipv4/if_bsdx.c b/opal/mca/if/bsdx_ipv4/if_bsdx.c index 86fa2b5e784..87bc27b8d42 100644 --- a/opal/mca/if/bsdx_ipv4/if_bsdx.c +++ b/opal/mca/if/bsdx_ipv4/if_bsdx.c @@ -39,6 +39,7 @@ opal_if_base_component_t mca_if_bsdx_ipv4_component = { {/* This component is checkpointable */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, if, bsdx_ipv4_component) /* convert a netmask (in network byte order) to CIDR notation */ static int prefix(uint32_t netmask) diff --git a/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c b/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c index 7b219ac9e97..87c52019e53 100644 --- a/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c +++ b/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c @@ -75,6 +75,7 @@ opal_if_base_component_t mca_if_bsdx_ipv6_component = { {/* This component is checkpointable */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, if, bsdx_ipv6) /* configure using getifaddrs(3) */ static int if_bsdx_ipv6_open(void) diff --git a/opal/mca/if/linux_ipv6/if_linux_ipv6.c b/opal/mca/if/linux_ipv6/if_linux_ipv6.c index 583c1ab115f..1cef441e20c 100644 --- a/opal/mca/if/linux_ipv6/if_linux_ipv6.c +++ b/opal/mca/if/linux_ipv6/if_linux_ipv6.c @@ -74,6 +74,7 @@ opal_if_base_component_t mca_if_linux_ipv6_component = { {/* This component is checkpointable */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, if, linux_ipv6) #if OPAL_ENABLE_IPV6 static bool hex2int(char hex, int *dst) diff --git a/opal/mca/if/posix_ipv4/if_posix.c b/opal/mca/if/posix_ipv4/if_posix.c index 48574b1fa7a..4678042403c 100644 --- a/opal/mca/if/posix_ipv4/if_posix.c +++ b/opal/mca/if/posix_ipv4/if_posix.c @@ -41,6 +41,7 @@ opal_if_base_component_t mca_if_posix_ipv4_component = { {/* This component is checkpointable */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, if, posix_ipv4) /* convert a netmask (in network byte order) to CIDR notation */ static int prefix(uint32_t netmask) diff --git a/opal/mca/installdirs/config/opal_installdirs_config.c b/opal/mca/installdirs/config/opal_installdirs_config.c index 201cc497f16..63c494e7c79 100644 --- a/opal/mca/installdirs/config/opal_installdirs_config.c +++ b/opal/mca/installdirs/config/opal_installdirs_config.c @@ -30,3 +30,4 @@ const opal_installdirs_base_component_t mca_installdirs_config_component = { OPAL_DATADIR, OPAL_SYSCONFDIR, OPAL_SHAREDSTATEDIR, OPAL_LOCALSTATEDIR, OPAL_LIBDIR, OPAL_INCLUDEDIR, OPAL_INFODIR, OPAL_MANDIR, OPAL_PKGDATADIR, OPAL_PKGLIBDIR, OPAL_PKGINCLUDEDIR}}; +MCA_BASE_COMPONENT_INIT(opal, installdirs, config) diff --git a/opal/mca/installdirs/env/opal_installdirs_env.c b/opal/mca/installdirs/env/opal_installdirs_env.c index 63cada8ee93..dd3fbf50eda 100644 --- a/opal/mca/installdirs/env/opal_installdirs_env.c +++ b/opal/mca/installdirs/env/opal_installdirs_env.c @@ -37,6 +37,7 @@ opal_installdirs_base_component_t mca_installdirs_env_component = { NULL, }, }; +MCA_BASE_COMPONENT_INIT(opal, installdirs, env) #define SET_FIELD(field, envname) \ do { \ diff --git a/opal/mca/mca.h b/opal/mca/mca.h index a501d68bdaa..517c9458010 100644 --- a/opal/mca/mca.h +++ b/opal/mca/mca.h @@ -394,4 +394,15 @@ typedef struct mca_base_component_data_2_0_0_t mca_base_component_data_2_0_0_t; MCA_BASE_VERSION_2_1_0("opal", OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, OPAL_RELEASE_VERSION, \ type, type_major, type_minor, type_release) + +#define MCA_BASE_COMPONENT_DECLARE_STAMP(project, framework, component, suffix) \ + mca ## _ ## framework ## _ ## component ## _ ##suffix + +#define MCA_BASE_COMPONENT_DECLARE_EXPANDER(project, framework, component, suffix) \ + MCA_BASE_COMPONENT_DECLARE_STAMP(project, framework, component, suffix) + +#define MCA_BASE_COMPONENT_INIT(project, framework, comp_name) \ + const mca_base_component_t *MCA_BASE_COMPONENT_DECLARE_EXPANDER(project, framework, comp_name, component_ptr) = \ + (const mca_base_component_t *)&MCA_BASE_COMPONENT_DECLARE_EXPANDER(project, framework, comp_name, component); + #endif /* OPAL_MCA_H */ diff --git a/opal/mca/memchecker/valgrind/memchecker_valgrind_component.c b/opal/mca/memchecker/valgrind/memchecker_valgrind_component.c index ad7a1f322a9..3cdb58faa83 100644 --- a/opal/mca/memchecker/valgrind/memchecker_valgrind_component.c +++ b/opal/mca/memchecker/valgrind/memchecker_valgrind_component.c @@ -65,6 +65,7 @@ const opal_memchecker_base_component_2_0_0_t mca_memchecker_valgrind_component = .mca_register_component_params = valgrind_register}, .base_data = {/* Valgrind does not offer functionality to save the state */ MCA_BASE_METADATA_PARAM_CHECKPOINT}}; +MCA_BASE_COMPONENT_INIT(opal, memchecker, valgrind) static int valgrind_register(void) { diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index 02ddbc7a6e5..3d8af83779d 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -107,6 +107,7 @@ opal_memory_patcher_component_t mca_memory_patcher_component = { /* Component-specific data, filled in later (compiler will 0/NULL it out) */ }; +MCA_BASE_COMPONENT_INIT(opal, memory, patcher) #if HAVE_DECL___SYSCALL && defined(HAVE___SYSCALL) /* calling __syscall is preferred on some systems when some arguments may be 64-bit. it also diff --git a/opal/mca/mpool/hugepage/mpool_hugepage_component.c b/opal/mca/mpool/hugepage/mpool_hugepage_component.c index 191fc405e7b..41d2d70c4e9 100644 --- a/opal/mca/mpool/hugepage/mpool_hugepage_component.c +++ b/opal/mca/mpool/hugepage/mpool_hugepage_component.c @@ -107,6 +107,7 @@ mca_mpool_hugepage_component_t mca_mpool_hugepage_component = { .mpool_query = mca_mpool_hugepage_query, }, }; +MCA_BASE_COMPONENT_INIT(opal, mpool, hugepage) /** * component open/close/init function diff --git a/opal/mca/mpool/memkind/mpool_memkind_component.c b/opal/mca/mpool/memkind/mpool_memkind_component.c index 55be1a657e5..465ad79d138 100644 --- a/opal/mca/mpool/memkind/mpool_memkind_component.c +++ b/opal/mca/mpool/memkind/mpool_memkind_component.c @@ -67,6 +67,7 @@ mca_mpool_memkind_component_t mca_mpool_memkind_component = {{ .mpool_query = mca_mpool_memkind_query, }}; +MCA_BASE_COMPONENT_INIT(opal, mpool, memkind) static void mca_mpool_memkind_module_le_destroy(mca_mpool_memkind_module_le_t *elem) { diff --git a/opal/mca/patcher/overwrite/patcher_overwrite_component.c b/opal/mca/patcher/overwrite/patcher_overwrite_component.c index 90abcf6f418..42bdb373960 100644 --- a/opal/mca/patcher/overwrite/patcher_overwrite_component.c +++ b/opal/mca/patcher/overwrite/patcher_overwrite_component.c @@ -44,3 +44,4 @@ mca_patcher_base_component_t mca_patcher_overwrite_component = { .mca_register_component_params = mca_patcher_overwrite_register, }, }; +MCA_BASE_COMPONENT_INIT(opal, patcher, overwrite) diff --git a/opal/mca/pmix/base/static-components.h b/opal/mca/pmix/base/static-components.h index f2be97a0c2b..1429ed7c45b 100644 --- a/opal/mca/pmix/base/static-components.h +++ b/opal/mca/pmix/base/static-components.h @@ -5,11 +5,9 @@ extern "C" { #endif -extern const mca_base_component_t mca_pmix_pmix4x_component; - -const mca_base_component_t *mca_pmix_base_static_components[] = { - - NULL}; +const mca_base_component_t **mca_pmix_base_static_components[] = { + NULL +}; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/opal/mca/rcache/gpusm/rcache_gpusm_component.c b/opal/mca/rcache/gpusm/rcache_gpusm_component.c index 7c398a484d0..bf90590ac5a 100644 --- a/opal/mca/rcache/gpusm/rcache_gpusm_component.c +++ b/opal/mca/rcache/gpusm/rcache_gpusm_component.c @@ -63,6 +63,7 @@ mca_rcache_gpusm_component_t mca_rcache_gpusm_component = {{ .rcache_init = gpusm_init, }}; +MCA_BASE_COMPONENT_INIT(opal, rcache, gpusm) /** * Component open/close/init/register functions. Most do not do anything, diff --git a/opal/mca/rcache/grdma/rcache_grdma_component.c b/opal/mca/rcache/grdma/rcache_grdma_component.c index f55d752378b..92253820419 100644 --- a/opal/mca/rcache/grdma/rcache_grdma_component.c +++ b/opal/mca/rcache/grdma/rcache_grdma_component.c @@ -62,6 +62,7 @@ mca_rcache_grdma_component_t mca_rcache_grdma_component = {{ .rcache_init = grdma_init, }}; +MCA_BASE_COMPONENT_INIT(opal, rcache, grdma) /** * component open/close/init function diff --git a/opal/mca/rcache/rgpusm/rcache_rgpusm_component.c b/opal/mca/rcache/rgpusm/rcache_rgpusm_component.c index 7ab84873763..b0857a4116f 100644 --- a/opal/mca/rcache/rgpusm/rcache_rgpusm_component.c +++ b/opal/mca/rcache/rgpusm/rcache_rgpusm_component.c @@ -64,6 +64,7 @@ mca_rcache_rgpusm_component_t mca_rcache_rgpusm_component = { MCA_BASE_METADATA_PARAM_CHECKPOINT}, .rcache_init = rgpusm_init}}; +MCA_BASE_COMPONENT_INIT(opal, rcache, rgpusm) /** * component open/close/init function diff --git a/opal/mca/reachable/netlink/reachable_netlink_component.c b/opal/mca/reachable/netlink/reachable_netlink_component.c index f015e068faa..08bb1ae2102 100644 --- a/opal/mca/reachable/netlink/reachable_netlink_component.c +++ b/opal/mca/reachable/netlink/reachable_netlink_component.c @@ -65,6 +65,7 @@ opal_reachable_base_component_t mca_reachable_netlink_component = { /* Next the MCA v1.0.0 component meta data */ .base_data = {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}}; +MCA_BASE_COMPONENT_INIT(opal, reachable, netlink) static int reachable_netlink_open(void) { diff --git a/opal/mca/reachable/weighted/reachable_weighted_component.c b/opal/mca/reachable/weighted/reachable_weighted_component.c index 13222d0fb7b..ff825704ba8 100644 --- a/opal/mca/reachable/weighted/reachable_weighted_component.c +++ b/opal/mca/reachable/weighted/reachable_weighted_component.c @@ -76,6 +76,7 @@ opal_reachable_weighted_component_t mca_reachable_weighted_component = {{ {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }}; +MCA_BASE_COMPONENT_INIT(opal, reachable, weighted) static int reachable_weighted_open(void) { diff --git a/opal/mca/shmem/mmap/shmem_mmap_component.c b/opal/mca/shmem/mmap/shmem_mmap_component.c index ae006b2773c..b29580acbd2 100644 --- a/opal/mca/shmem/mmap/shmem_mmap_component.c +++ b/opal/mca/shmem/mmap/shmem_mmap_component.c @@ -81,6 +81,7 @@ opal_shmem_mmap_component_t mca_shmem_mmap_component = { .runtime_query = mmap_runtime_query, }, }; +MCA_BASE_COMPONENT_INIT(opal, shmem, mmap) /* ////////////////////////////////////////////////////////////////////////// */ static int mmap_runtime_query(mca_base_module_t **module, int *priority, const char *hint) diff --git a/opal/mca/shmem/posix/shmem_posix_component.c b/opal/mca/shmem/posix/shmem_posix_component.c index 0993b69246a..1da5bb5ccde 100644 --- a/opal/mca/shmem/posix/shmem_posix_component.c +++ b/opal/mca/shmem/posix/shmem_posix_component.c @@ -89,6 +89,7 @@ opal_shmem_posix_component_t mca_shmem_posix_component = { .runtime_query = posix_runtime_query, }, }; +MCA_BASE_COMPONENT_INIT(opal, shmem, posix) /* ////////////////////////////////////////////////////////////////////////// */ static int posix_register(void) diff --git a/opal/mca/shmem/sysv/shmem_sysv_component.c b/opal/mca/shmem/sysv/shmem_sysv_component.c index 33aa8f142bd..966a406e0aa 100644 --- a/opal/mca/shmem/sysv/shmem_sysv_component.c +++ b/opal/mca/shmem/sysv/shmem_sysv_component.c @@ -91,6 +91,7 @@ opal_shmem_sysv_component_t mca_shmem_sysv_component = { .runtime_query = sysv_runtime_query, }, }; +MCA_BASE_COMPONENT_INIT(opal, shmem, sysv) /* ////////////////////////////////////////////////////////////////////////// */ static int sysv_register(void) diff --git a/opal/mca/smsc/accelerator/smsc_accelerator_component.c b/opal/mca/smsc/accelerator/smsc_accelerator_component.c index 2bb276a98ba..d12caeb9b5f 100644 --- a/opal/mca/smsc/accelerator/smsc_accelerator_component.c +++ b/opal/mca/smsc/accelerator/smsc_accelerator_component.c @@ -36,6 +36,7 @@ mca_smsc_accelerator_component_t mca_smsc_accelerator_component = { .enable = mca_smsc_accelerator_component_enable, }, }; +MCA_BASE_COMPONENT_INIT(opal, smsc, accelerator) static int mca_smsc_accelerator_component_register(void) { diff --git a/opal/mca/smsc/cma/smsc_cma_component.c b/opal/mca/smsc/cma/smsc_cma_component.c index 4ccd731ba24..a0f635bbe42 100644 --- a/opal/mca/smsc/cma/smsc_cma_component.c +++ b/opal/mca/smsc/cma/smsc_cma_component.c @@ -39,6 +39,7 @@ mca_smsc_component_t mca_smsc_cma_component = { .query = mca_smsc_cma_component_query, .enable = mca_smsc_cma_component_enable, }; +MCA_BASE_COMPONENT_INIT(opal, smsc, cma) static int mca_smsc_cma_component_register(void) { diff --git a/opal/mca/smsc/knem/smsc_knem_component.c b/opal/mca/smsc/knem/smsc_knem_component.c index bd5c0f5a645..da8a1e3290e 100644 --- a/opal/mca/smsc/knem/smsc_knem_component.c +++ b/opal/mca/smsc/knem/smsc_knem_component.c @@ -47,6 +47,7 @@ mca_smsc_knem_component_t mca_smsc_knem_component = { .enable = mca_smsc_knem_component_enable, }, }; +MCA_BASE_COMPONENT_INIT(opal, smsc, knem) static int mca_smsc_knem_component_register(void) { diff --git a/opal/mca/smsc/xpmem/smsc_xpmem_component.c b/opal/mca/smsc/xpmem/smsc_xpmem_component.c index 0b48e95d712..98022c90b65 100644 --- a/opal/mca/smsc/xpmem/smsc_xpmem_component.c +++ b/opal/mca/smsc/xpmem/smsc_xpmem_component.c @@ -44,6 +44,7 @@ mca_smsc_xpmem_component_t mca_smsc_xpmem_component = { .enable = mca_smsc_xpmem_component_enable, }, }; +MCA_BASE_COMPONENT_INIT(opal, smsc, xpmem) static int mca_smsc_xpmem_component_register(void) { diff --git a/opal/mca/threads/argobots/threads_argobots_component.c b/opal/mca/threads/argobots/threads_argobots_component.c index bce182b1086..61ddf6a6a50 100644 --- a/opal/mca/threads/argobots/threads_argobots_component.c +++ b/opal/mca/threads/argobots/threads_argobots_component.c @@ -48,6 +48,7 @@ const opal_threads_base_component_1_0_0_t mca_threads_argobots_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, threads, argobots) int opal_threads_argobots_open(void) { diff --git a/opal/mca/threads/pthreads/threads_pthreads_component.c b/opal/mca/threads/pthreads/threads_pthreads_component.c index d2d51adc23a..f6cbe7a373a 100644 --- a/opal/mca/threads/pthreads/threads_pthreads_component.c +++ b/opal/mca/threads/pthreads/threads_pthreads_component.c @@ -47,6 +47,7 @@ const opal_threads_base_component_1_0_0_t mca_threads_pthreads_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, threads, pthreads) int opal_threads_pthreads_register(void) { diff --git a/opal/mca/threads/qthreads/threads_qthreads_component.c b/opal/mca/threads/qthreads/threads_qthreads_component.c index 9ce9ac6f630..494f5f7e5fa 100644 --- a/opal/mca/threads/qthreads/threads_qthreads_component.c +++ b/opal/mca/threads/qthreads/threads_qthreads_component.c @@ -48,6 +48,7 @@ const opal_threads_base_component_1_0_0_t mca_threads_qthreads_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, threads, qthreads) int opal_threads_qthreads_open(void) { diff --git a/opal/mca/timer/darwin/timer_darwin_component.c b/opal/mca/timer/darwin/timer_darwin_component.c index 0071c7e4b28..5b9bee54c55 100644 --- a/opal/mca/timer/darwin/timer_darwin_component.c +++ b/opal/mca/timer/darwin/timer_darwin_component.c @@ -49,6 +49,7 @@ const opal_timer_base_component_2_0_0_t mca_timer_darwin_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +MCA_BASE_COMPONENT_INIT(opal, timer, darwin) /* mach_timebase_info() returns a fraction that can be multiplied by the difference between two calls to mach_absolute_time() to diff --git a/opal/mca/timer/linux/timer_linux_component.c b/opal/mca/timer/linux/timer_linux_component.c index fabb3f4ea09..6c615cd412e 100644 --- a/opal/mca/timer/linux/timer_linux_component.c +++ b/opal/mca/timer/linux/timer_linux_component.c @@ -76,6 +76,10 @@ const opal_timer_base_component_2_0_0_t mca_timer_linux_component = { {/* The component is checkpoint ready */ MCA_BASE_METADATA_PARAM_CHECKPOINT}, }; +#ifdef linux +# undef linux +#endif +MCA_BASE_COMPONENT_INIT(opal, timer, linux) static char *find_info(FILE *fp, char *str, char *buf, size_t buflen) { diff --git a/oshmem/mca/atomic/basic/atomic_basic_component.c b/oshmem/mca/atomic/basic/atomic_basic_component.c index fc688164c2d..d0c6a0dabfa 100644 --- a/oshmem/mca/atomic/basic/atomic_basic_component.c +++ b/oshmem/mca/atomic/basic/atomic_basic_component.c @@ -66,6 +66,7 @@ mca_atomic_base_component_t mca_atomic_basic_component = { .atomic_finalize = mca_atomic_basic_finalize, .atomic_query = mca_atomic_basic_query, }; +MCA_BASE_COMPONENT_INIT(oshmem, atomic, basic) static int _basic_register(void) { diff --git a/oshmem/mca/atomic/ucx/atomic_ucx_component.c b/oshmem/mca/atomic/ucx/atomic_ucx_component.c index 27088440723..40e3e6b090b 100644 --- a/oshmem/mca/atomic/ucx/atomic_ucx_component.c +++ b/oshmem/mca/atomic/ucx/atomic_ucx_component.c @@ -74,6 +74,7 @@ mca_atomic_base_component_t mca_atomic_ucx_component = { mca_atomic_ucx_finalize, mca_atomic_ucx_query }; +MCA_BASE_COMPONENT_INIT(oshmem, atomic, ucx) static int ucx_register(void) { diff --git a/oshmem/mca/memheap/buddy/memheap_buddy_component.c b/oshmem/mca/memheap/buddy/memheap_buddy_component.c index 715f7743374..50edd3efe0f 100644 --- a/oshmem/mca/memheap/buddy/memheap_buddy_component.c +++ b/oshmem/mca/memheap/buddy/memheap_buddy_component.c @@ -40,6 +40,7 @@ mca_memheap_base_component_t mca_memheap_buddy_component = { }, .memheap_init = mca_memheap_buddy_module_init }; +MCA_BASE_COMPONENT_INIT(oshmem, memheap, buddy) /* Open component */ static int _basic_open(void) diff --git a/oshmem/mca/memheap/ptmalloc/memheap_ptmalloc_component.c b/oshmem/mca/memheap/ptmalloc/memheap_ptmalloc_component.c index 2e13e8cf995..aa25a09e248 100644 --- a/oshmem/mca/memheap/ptmalloc/memheap_ptmalloc_component.c +++ b/oshmem/mca/memheap/ptmalloc/memheap_ptmalloc_component.c @@ -41,6 +41,7 @@ mca_memheap_base_component_t mca_memheap_ptmalloc_component = { }, .memheap_init = mca_memheap_ptmalloc_module_init, }; +MCA_BASE_COMPONENT_INIT(oshmem, memheap, ptmalloc) /* Open component */ static int _basic_open(void) diff --git a/oshmem/mca/scoll/basic/scoll_basic_component.c b/oshmem/mca/scoll/basic/scoll_basic_component.c index 9ae785c1830..b271ddd6450 100644 --- a/oshmem/mca/scoll/basic/scoll_basic_component.c +++ b/oshmem/mca/scoll/basic/scoll_basic_component.c @@ -74,6 +74,7 @@ mca_scoll_base_component_t mca_scoll_basic_component = { .scoll_init = mca_scoll_basic_init, .scoll_query = mca_scoll_basic_query, }; +MCA_BASE_COMPONENT_INIT(oshmem, scoll, basic) static int basic_register(void) { diff --git a/oshmem/mca/scoll/mpi/scoll_mpi_component.c b/oshmem/mca/scoll/mpi/scoll_mpi_component.c index 0e5d46236ba..fb9b5bac950 100644 --- a/oshmem/mca/scoll/mpi/scoll_mpi_component.c +++ b/oshmem/mca/scoll/mpi/scoll_mpi_component.c @@ -60,6 +60,7 @@ mca_scoll_mpi_component_t mca_scoll_mpi_component = { 1, /* mpi_enable */ 2 /*mpi_np */ }; +MCA_BASE_COMPONENT_INIT(oshmem, scoll, mpi) /* * * Local flags diff --git a/oshmem/mca/scoll/ucc/scoll_ucc_component.c b/oshmem/mca/scoll/ucc/scoll_ucc_component.c index 5a7bcc84ff4..ef461380505 100644 --- a/oshmem/mca/scoll/ucc/scoll_ucc_component.c +++ b/oshmem/mca/scoll/ucc/scoll_ucc_component.c @@ -66,6 +66,7 @@ mca_scoll_ucc_component_t mca_scoll_ucc_component = { false, /* libucc_initialized */ NULL /* ucc_context */ }; +MCA_BASE_COMPONENT_INIT(oshmem, scoll, ucc) static int ucc_register(void) { diff --git a/oshmem/mca/spml/ucx/spml_ucx_component.c b/oshmem/mca/spml/ucx/spml_ucx_component.c index affc73f3f88..d63039fbd48 100644 --- a/oshmem/mca/spml/ucx/spml_ucx_component.c +++ b/oshmem/mca/spml/ucx/spml_ucx_component.c @@ -59,6 +59,7 @@ mca_spml_base_component_2_0_0_t mca_spml_ucx_component = { .spmlm_init = mca_spml_ucx_component_init, .spmlm_finalize = mca_spml_ucx_component_fini }; +MCA_BASE_COMPONENT_INIT(oshmem, spml, ucx) static inline void mca_spml_ucx_param_register_ulong(const char* param_name, unsigned long default_value, diff --git a/oshmem/mca/sshmem/mmap/sshmem_mmap_component.c b/oshmem/mca/sshmem/mmap/sshmem_mmap_component.c index ee71cbc8c2a..c63efcbdcc4 100644 --- a/oshmem/mca/sshmem/mmap/sshmem_mmap_component.c +++ b/oshmem/mca/sshmem/mmap/sshmem_mmap_component.c @@ -75,6 +75,7 @@ mca_sshmem_mmap_component_t mca_sshmem_mmap_component = { .runtime_query = mmap_runtime_query, }, }; +MCA_BASE_COMPONENT_INIT(oshmem, sshmem, mmap) /* ////////////////////////////////////////////////////////////////////////// */ static int diff --git a/oshmem/mca/sshmem/sysv/sshmem_sysv_component.c b/oshmem/mca/sshmem/sysv/sshmem_sysv_component.c index 4c72c571cfe..0d2c08ad3d1 100644 --- a/oshmem/mca/sshmem/sysv/sshmem_sysv_component.c +++ b/oshmem/mca/sshmem/sysv/sshmem_sysv_component.c @@ -87,6 +87,7 @@ mca_sshmem_sysv_component_t mca_sshmem_sysv_component = { /* sysv component-specific information */ /* see: shmem_sysv.h for more information */ }; +MCA_BASE_COMPONENT_INIT(oshmem, sshmem, sysv) /* ////////////////////////////////////////////////////////////////////////// */ static int diff --git a/oshmem/mca/sshmem/ucx/sshmem_ucx_component.c b/oshmem/mca/sshmem/ucx/sshmem_ucx_component.c index 46c6c61c880..d581dedb87a 100644 --- a/oshmem/mca/sshmem/ucx/sshmem_ucx_component.c +++ b/oshmem/mca/sshmem/ucx/sshmem_ucx_component.c @@ -70,6 +70,7 @@ mca_sshmem_ucx_component_t mca_sshmem_ucx_component = { .runtime_query = ucx_runtime_query, }, }; +MCA_BASE_COMPONENT_INIT(oshmem, sshmem, ucx) static int ucx_runtime_query(mca_base_module_t **module,