Skip to content

Commit c481e96

Browse files
committed
patcher: add priority parameters for patcher components
This commit adds a priority parameter to each of the patcher components. I also updated the relative priority of the linux and overwrite components until the linux component can be fixed. It misses some some calls to munmap at the moment. Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
1 parent fd83d8c commit c481e96

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

opal/mca/patcher/linux/patcher_linux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ typedef struct mca_patcher_linux_patch_t mca_patcher_linux_patch_t;
4040
OBJ_CLASS_DECLARATION(mca_patcher_linux_patch_t);
4141

4242
extern mca_patcher_base_module_t mca_patcher_linux_module;
43+
extern mca_patcher_base_component_t mca_patcher_linux_component;
4344

4445
#endif /* !defined(OPAL_PATCHER_LINUX_H) */

opal/mca/patcher/linux/patcher_linux_component.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,23 @@
1111

1212
#include "patcher_linux.h"
1313

14+
static int mca_patcher_linux_priority;
15+
16+
static int mca_patcher_linux_register (void)
17+
{
18+
mca_patcher_linux_priority = 13;
19+
mca_base_component_var_register (&mca_patcher_linux_component.patcherc_version,
20+
"priority", "Priority of the linux binary patcher component",
21+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_5,
22+
MCA_BASE_VAR_SCOPE_CONSTANT, &mca_patcher_linux_priority);
23+
24+
return OPAL_SUCCESS;
25+
}
26+
1427
static int mca_patcher_linux_query (mca_base_module_t **module, int *priority)
1528
{
1629
*module = &mca_patcher_linux_module.super;
17-
*priority = 37;
30+
*priority = mca_patcher_linux_priority;
1831
return OPAL_SUCCESS;
1932
}
2033

@@ -25,5 +38,6 @@ mca_patcher_base_component_t mca_patcher_linux_component = {
2538
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
2639
OPAL_RELEASE_VERSION),
2740
.mca_query_component = mca_patcher_linux_query,
41+
.mca_register_component_params = mca_patcher_linux_register,
2842
},
2943
};

opal/mca/patcher/overwrite/patcher_overwrite.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
#include "opal/class/opal_list.h"
2828

2929
extern mca_patcher_base_module_t mca_patcher_overwrite_module;
30+
extern mca_patcher_base_component_t mca_patcher_overwrite_component;
3031

3132
#endif /* !defined(OPAL_PATCHER_OVERWRITE_H) */

opal/mca/patcher/overwrite/patcher_overwrite_component.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,23 @@
1313
#include "opal/mca/mca.h"
1414
#include "opal/mca/base/base.h"
1515

16+
static int mca_patcher_overwrite_priority;
17+
18+
static int mca_patcher_overwrite_register (void)
19+
{
20+
mca_patcher_overwrite_priority = 37;
21+
mca_base_component_var_register (&mca_patcher_overwrite_component.patcherc_version,
22+
"priority", "Priority of the overwrite binary patcher component",
23+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_5,
24+
MCA_BASE_VAR_SCOPE_CONSTANT, &mca_patcher_overwrite_priority);
25+
26+
return OPAL_SUCCESS;
27+
}
28+
1629
static int mca_patcher_overwrite_query (mca_base_module_t **module, int *priority)
1730
{
1831
*module = &mca_patcher_overwrite_module.super;
19-
*priority = 10;
32+
*priority = mca_patcher_overwrite_priority;
2033
return OPAL_SUCCESS;
2134
}
2235

@@ -27,5 +40,6 @@ mca_patcher_base_component_t mca_patcher_overwrite_component = {
2740
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
2841
OPAL_RELEASE_VERSION),
2942
.mca_query_component = mca_patcher_overwrite_query,
43+
.mca_register_component_params = mca_patcher_overwrite_register,
3044
},
3145
};

0 commit comments

Comments
 (0)