Allow apps to use pmi when launched by mpirun, if desired, without affecting daemons
This commit was SVN r25359.
Этот коммит содержится в:
родитель
e8af0d8589
Коммит
955d8e7d46
@ -25,6 +25,8 @@ static int pubsub_orte_component_open(void);
|
||||
static int pubsub_orte_component_close(void);
|
||||
static int pubsub_orte_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
static int my_priority = 50;
|
||||
|
||||
ompi_pubsub_orte_component_t mca_pubsub_orte_component = {
|
||||
{
|
||||
/* First, the mca_base_component_t struct containing meta
|
||||
@ -51,6 +53,12 @@ ompi_pubsub_orte_component_t mca_pubsub_orte_component = {
|
||||
|
||||
static int pubsub_orte_component_open(void)
|
||||
{
|
||||
mca_base_component_t *c = &mca_pubsub_orte_component.super.base_version;
|
||||
|
||||
mca_base_param_reg_int(c, "priority",
|
||||
"Priority of the pubsub pmi component",
|
||||
false, false, my_priority,
|
||||
&my_priority);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -74,7 +82,7 @@ static int pubsub_orte_component_query(mca_base_module_t **module, int *priority
|
||||
|
||||
mca_pubsub_orte_component.server_found = false;
|
||||
|
||||
*priority = 50;
|
||||
*priority = my_priority;
|
||||
*module = (mca_base_module_t *) &ompi_pubsub_orte_module;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
#endif
|
||||
|
||||
#include "orte/util/proc_info.h"
|
||||
#include "orte/util/name_fns.h"
|
||||
|
||||
#include "pubsub_pmi.h"
|
||||
|
||||
@ -23,6 +24,8 @@ static int pubsub_pmi_component_open(void);
|
||||
static int pubsub_pmi_component_close(void);
|
||||
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
static int my_priority = 5; /* must be below "orte" component */
|
||||
|
||||
ompi_pubsub_base_component_t mca_pubsub_pmi_component = {
|
||||
{
|
||||
OMPI_PUBSUB_BASE_VERSION_2_0_0,
|
||||
@ -44,6 +47,12 @@ ompi_pubsub_base_component_t mca_pubsub_pmi_component = {
|
||||
|
||||
static int pubsub_pmi_component_open(void)
|
||||
{
|
||||
mca_base_component_t *c = &mca_pubsub_pmi_component.base_version;
|
||||
|
||||
mca_base_param_reg_int(c, "priority",
|
||||
"Priority of the pubsub pmi component",
|
||||
false, false, my_priority,
|
||||
&my_priority);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -99,10 +108,10 @@ static bool pmi_startup(void)
|
||||
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* for now, only use PMI when direct launched */
|
||||
if (NULL == orte_process_info.my_hnp_uri &&
|
||||
if (ORTE_PROC_IS_MPI &&
|
||||
pmi_startup()) {
|
||||
/* if PMI is available, use it */
|
||||
*priority = 100;
|
||||
*priority = my_priority;
|
||||
*module = (mca_base_module_t *)&ompi_pubsub_pmi_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "grpcomm_pmi.h"
|
||||
|
||||
static int my_priority=5; /* must be below "bad" module */
|
||||
|
||||
/*
|
||||
* Struct of function pointers that need to be initialized
|
||||
*/
|
||||
@ -50,6 +52,16 @@ orte_grpcomm_base_component_t mca_grpcomm_pmi_component = {
|
||||
/* Open the component */
|
||||
int orte_grpcomm_pmi_open(void)
|
||||
{
|
||||
mca_base_component_t *c = &mca_grpcomm_pmi_component.base_version;
|
||||
|
||||
/* make the priority adjustable so users can select
|
||||
* pmi for use by apps without affecting daemons
|
||||
*/
|
||||
mca_base_param_reg_int(c, "priority",
|
||||
"Priority of the grpcomm pmi component",
|
||||
false, false, my_priority,
|
||||
&my_priority);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -105,11 +117,10 @@ static bool pmi_startup(void)
|
||||
int orte_grpcomm_pmi_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* for now, only use PMI when direct launched */
|
||||
if (!ORTE_PROC_IS_HNP &&
|
||||
NULL == orte_process_info.my_hnp_uri &&
|
||||
if (ORTE_PROC_IS_MPI &&
|
||||
pmi_startup()) {
|
||||
/* if PMI is available, use it */
|
||||
*priority = 100;
|
||||
*priority = my_priority;
|
||||
*module = (mca_base_module_t *)&orte_grpcomm_pmi_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user