Skip to content

build: Add static component pointers for LTO #13193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/opal_mca.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions ompi/mca/bml/r2/bml_r2_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/accelerator/coll_accelerator_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/acoll/coll_acoll_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/adapt/coll_adapt_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/basic/coll_basic_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/demo/coll_demo_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/ftagree/coll_ftagree_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/han/coll_han_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/hcoll/coll_hcoll_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/inter/coll_inter_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/libnbc/coll_libnbc_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/monitoring/coll_monitoring_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/portals4/coll_portals4_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/self/coll_self_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/sync/coll_sync_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/tuned/coll_tuned_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/ucc/coll_ucc_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/coll/xhc/coll_xhc_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fbtl/ime/fbtl_ime_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fbtl/posix/fbtl_posix_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fcoll/dynamic/fcoll_dynamic_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fcoll/individual/fcoll_individual_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fcoll/vulcan/fcoll_vulcan_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fs/gpfs/fs_gpfs_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fs/ime/fs_ime_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fs/lustre/fs_lustre_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/fs/ufs/fs_ufs_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
9 changes: 5 additions & 4 deletions ompi/mca/hook/base/hook_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ 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;
bool found = false;
Expand All @@ -68,21 +68,22 @@ 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] ) {
if( component == static_component ) {
found = true;
break;
}
}
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;
}
}
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/hook/comm_method/hook_comm_method_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/hook/demo/hook_demo_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/io/ompio/io_ompio_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/mtl/ofi/mtl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions ompi/mca/mtl/portals4/mtl_portals4_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/mtl/psm2/mtl_psm2_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/op/aarch64/op_aarch64_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/op/avx/op_avx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/op/example/op_example_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/osc/monitoring/osc_monitoring_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ ompi_osc_monitoring_component_t mca_osc_monitoring_component = {
},
.priority = INT_MAX
};
MCA_BASE_COMPONENT_INIT(ompi, osc, monitoring)
1 change: 1 addition & 0 deletions ompi/mca/osc/portals4/osc_portals4_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/osc/rdma/osc_rdma_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/osc/sm/osc_sm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/osc/ucx/osc_ucx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
{
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/part/persist/part_persist_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading