Skip to content

Commit

Permalink
framework: add the MCA_BASE_FRAMEWORK_FLAG_NOCOMPONENT flag
Browse files Browse the repository at this point in the history
When a framework has the MCA_BASE_FRAMEWORK_FLAG_NOCOMPONENT flag,
it will not try to register any components. That can prevent issues
at finalization when a component is registered but not properly
unregistered.

Thanks Kook Jin Noh for the bug report.

Refs. open-mpi#12282

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
  • Loading branch information
ggouaillardet committed Feb 2, 2024
1 parent e53e700 commit 2796864
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 7 additions & 3 deletions opal/mca/base/mca_base_framework.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Copyright (c) 2018 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* Copyright (c) 2024 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -129,9 +131,11 @@ int mca_base_framework_register(struct mca_base_framework_t *framework,
}

/* register components variables */
ret = mca_base_framework_components_register(framework, flags);
if (OPAL_SUCCESS != ret) {
return ret;
if (!(MCA_BASE_FRAMEWORK_FLAG_NOCOMPONENT & framework->framework_flags)) {
ret = mca_base_framework_components_register(framework, flags);
if (OPAL_SUCCESS != ret) {
return ret;
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions opal/mca/base/mca_base_framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2024 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -120,6 +122,8 @@ typedef enum {
MCA_BASE_FRAMEWORK_FLAG_NO_DSO = 4,
/** Internal. Don't set outside mca_base_framework.h */
MCA_BASE_FRAMEWORK_FLAG_OPEN = 8,
/** Do not register components */
MCA_BASE_FRAMEWORK_FLAG_NOCOMPONENT = 16,
/**
* The upper 16 bits are reserved for project specific flags.
*/
Expand Down
4 changes: 3 additions & 1 deletion opal/mca/pmix/base/pmix_base_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Copyright (c) 2022 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2024 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -114,4 +116,4 @@ static int opal_pmix_base_frame_open(mca_base_open_flag_t flags)

MCA_BASE_FRAMEWORK_DECLARE(opal, pmix, "OPAL PMI Client Framework", opal_pmix_base_frame_register,
opal_pmix_base_frame_open, opal_pmix_base_frame_close,
mca_pmix_base_static_components, 0);
mca_pmix_base_static_components, MCA_BASE_FRAMEWORK_FLAG_NOCOMPONENT);

0 comments on commit 2796864

Please sign in to comment.