1
1

split close into finalize/close so that rmgr can finalize all

sub-components prior to entering close. moved pls logic to
wait on children from close to finalize.

This commit was SVN r5392.
Этот коммит содержится в:
Tim Woodall 2005-04-15 17:04:57 +00:00
родитель 1581a8feb4
Коммит a831729d6f
14 изменённых файлов: 83 добавлений и 29 удалений

Просмотреть файл

@ -85,6 +85,7 @@ extern "C" {
/**
* Close the pls framework
*/
OMPI_DECLSPEC int orte_pls_base_finalize(void);
OMPI_DECLSPEC int orte_pls_base_close(void);
/**
* Utility routine to get/set proces pid

Просмотреть файл

@ -25,13 +25,11 @@
#include "util/output.h"
int orte_pls_base_close(void)
int orte_pls_base_finalize(void)
{
ompi_list_item_t* item;
/* Finalize all available modules */
if (orte_pls_base.pls_available_valid) {
ompi_list_item_t* item;
while (NULL !=
(item = ompi_list_remove_first(&orte_pls_base.pls_available))) {
orte_pls_base_cmp_t* cmp = (orte_pls_base_cmp_t*) item;
@ -45,15 +43,17 @@ int orte_pls_base_close(void)
}
}
orte_pls_base.pls_available_valid = false;
}
int orte_pls_base_close(void)
{
/* Close all remaining open components */
if (orte_pls_base.pls_opened_valid) {
mca_base_components_close(orte_pls_base.pls_output,
&orte_pls_base.pls_opened, NULL);
}
orte_pls_base.pls_opened_valid = false;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -71,6 +71,7 @@ static orte_pls_base_module_t *select_preferred(char *name)
mca_base_component_list_item_t *cli;
orte_pls_base_component_t *component;
orte_pls_base_module_t *module;
orte_pls_base_cmp_t *cmp;
int priority;
/* Look for a matching selected name */
@ -100,6 +101,13 @@ static orte_pls_base_module_t *select_preferred(char *name)
"orte:base:open: component %s returns priority %d",
component->pls_version.mca_component_name,
priority);
cmp = OBJ_NEW(orte_pls_base_cmp_t);
cmp->component = component;
cmp->module = module;
cmp->priority = priority;
ompi_list_append(&orte_pls_base.pls_available, &cmp->super);
return module;
}
}
@ -119,8 +127,8 @@ static orte_pls_base_module_t *select_any(void)
mca_base_component_list_item_t *cli;
orte_pls_base_component_t *component;
orte_pls_base_module_t *module;
int priority;
orte_pls_base_cmp_t *cmp;
int priority;
/* Query all the opened components and see if they want to run */

Просмотреть файл

@ -129,15 +129,6 @@ orte_pls_base_module_t *orte_pls_fork_component_init(int *priority)
int orte_pls_fork_component_close(void)
{
if(mca_pls_fork_component.reap) {
OMPI_THREAD_LOCK(&mca_pls_fork_component.lock);
while(mca_pls_fork_component.num_children > 0) {
ompi_condition_wait(&mca_pls_fork_component.cond,
&mca_pls_fork_component.lock);
}
OMPI_THREAD_UNLOCK(&mca_pls_fork_component.lock);
}
OBJ_DESTRUCT(&mca_pls_fork_component.lock);
OBJ_DESTRUCT(&mca_pls_fork_component.cond);
return ORTE_SUCCESS;

Просмотреть файл

@ -349,6 +349,14 @@ int orte_pls_fork_terminate_proc(const orte_process_name_t* proc)
int orte_pls_fork_finalize(void)
{
if(mca_pls_fork_component.reap) {
OMPI_THREAD_LOCK(&mca_pls_fork_component.lock);
while(mca_pls_fork_component.num_children > 0) {
ompi_condition_wait(&mca_pls_fork_component.cond,
&mca_pls_fork_component.lock);
}
OMPI_THREAD_UNLOCK(&mca_pls_fork_component.lock);
}
return ORTE_ERR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -191,14 +191,6 @@ orte_pls_base_module_t *orte_pls_rsh_component_init(int *priority)
int orte_pls_rsh_component_close(void)
{
if(mca_pls_rsh_component.reap) {
OMPI_THREAD_LOCK(&mca_pls_rsh_component.lock);
while(mca_pls_rsh_component.num_children > 0) {
ompi_condition_wait(&mca_pls_rsh_component.cond, &mca_pls_rsh_component.lock);
}
OMPI_THREAD_UNLOCK(&mca_pls_rsh_component.lock);
}
/* cleanup state */
OBJ_DESTRUCT(&mca_pls_rsh_component.lock);
OBJ_DESTRUCT(&mca_pls_rsh_component.cond);

Просмотреть файл

@ -543,6 +543,14 @@ int orte_pls_rsh_terminate_proc(const orte_process_name_t* proc)
int orte_pls_rsh_finalize(void)
{
if(mca_pls_rsh_component.reap) {
OMPI_THREAD_LOCK(&mca_pls_rsh_component.lock);
while(mca_pls_rsh_component.num_children > 0) {
ompi_condition_wait(&mca_pls_rsh_component.cond, &mca_pls_rsh_component.lock);
}
OMPI_THREAD_UNLOCK(&mca_pls_rsh_component.lock);
}
/* cleanup any pending recvs */
orte_rml.recv_cancel(ORTE_RML_NAME_ANY, ORTE_RML_TAG_RMGR_CLNT);
return ORTE_SUCCESS;

Просмотреть файл

@ -56,6 +56,7 @@ typedef struct orte_ras_base_cmp_t orte_ras_base_cmp_t;
* function definitions
*/
ORTE_DECLSPEC int orte_ras_base_open(void);
ORTE_DECLSPEC int orte_ras_base_finalize(void);
ORTE_DECLSPEC int orte_ras_base_close(void);
ORTE_DECLSPEC orte_ras_base_module_t* orte_ras_base_select(const char*);
ORTE_DECLSPEC int orte_ras_base_allocate(orte_jobid_t job);

Просмотреть файл

@ -26,17 +26,20 @@
#include "mca/ras/base/base.h"
int orte_ras_base_close(void)
int orte_ras_base_finalize(void)
{
ompi_list_item_t* item;
/* Finalize all available modules */
while((item = ompi_list_remove_first(&orte_ras_base.ras_available)) != NULL) {
orte_ras_base_cmp_t* cmp = (orte_ras_base_cmp_t*)item;
cmp->module->finalize();
OBJ_RELEASE(cmp);
}
}
int orte_ras_base_close(void)
{
/* Close all remaining available components (may be one if this is a
Open RTE program, or [possibly] multiple if this is ompi_info) */

Просмотреть файл

@ -54,6 +54,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_rds_base_selected_t);
*/
OMPI_DECLSPEC int orte_rds_base_open(void);
OMPI_DECLSPEC int orte_rds_base_select(void);
OMPI_DECLSPEC int orte_rds_base_finalize(void);
OMPI_DECLSPEC int orte_rds_base_close(void);
OMPI_DECLSPEC int orte_rds_base_query(void);

Просмотреть файл

@ -25,7 +25,7 @@
#include "mca/rds/base/base.h"
int orte_rds_base_close(void)
int orte_rds_base_finalize(void)
{
ompi_list_item_t* item;
@ -35,7 +35,10 @@ int orte_rds_base_close(void)
selected->module->finalize();
OBJ_RELEASE(selected);
}
}
int orte_rds_base_close(void)
{
/* Close all remaining available components (may be one if this is a
Open RTE program, or [possibly] multiple if this is ompi_info) */

Просмотреть файл

@ -99,6 +99,7 @@ extern "C" {
/**
* Close down the rmaps framework
*/
OMPI_DECLSPEC int orte_rmaps_base_finalize(void);
OMPI_DECLSPEC int orte_rmaps_base_close(void);
#if defined(c_plusplus) || defined(__cplusplus)

Просмотреть файл

@ -26,7 +26,7 @@
#include "mca/rmaps/base/base.h"
int orte_rmaps_base_close(void)
int orte_rmaps_base_finalize(void)
{
ompi_list_item_t* item;
@ -43,7 +43,10 @@ int orte_rmaps_base_close(void)
}
OBJ_RELEASE(cmp);
}
}
int orte_rmaps_base_close(void)
{
/* Close all remaining open components */
mca_base_components_close(orte_rmaps_base.rmaps_output,

Просмотреть файл

@ -299,6 +299,40 @@ static int orte_rmgr_urm_spawn(
static int orte_rmgr_urm_finalize(void)
{
int rc;
/**
* Finalize Process Launch Subsystem (PLS)
*/
if (ORTE_SUCCESS != (rc = orte_pls_base_finalize())) {
ORTE_ERROR_LOG(rc);
return rc;
}
/**
* Finalize Resource Mapping Subsystem (RMAPS)
*/
if (ORTE_SUCCESS != (rc = orte_rmaps_base_finalize())) {
ORTE_ERROR_LOG(rc);
return rc;
}
/**
* Finalize Resource Allocation Subsystem (RAS)
*/
if (ORTE_SUCCESS != (rc = orte_ras_base_finalize())) {
ORTE_ERROR_LOG(rc);
return rc;
}
/**
* Finalize Resource Discovery Subsystem (RDS)
*/
if (ORTE_SUCCESS != (rc = orte_rds_base_finalize())) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* Cancel pending receive. */
orte_rml.recv_cancel(ORTE_RML_NAME_ANY, ORTE_RML_TAG_RMGR_SVC);