1
1

Cleanup a compiler warning on orteprobe.

Split the finalize process into two parts: one that finalizes the orte subsystems, and another that finalizes (what will become) the opal subsystems. Needed to properly restart the workstation process once remote launch accomplished.

This commit was SVN r5758.
Этот коммит содержится в:
Ralph Castain 2005-05-19 13:33:55 +00:00
родитель 2ec635b07c
Коммит 34e437a9af
8 изменённых файлов: 188 добавлений и 73 удалений

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

@ -28,13 +28,15 @@ headers = \
runtime_types.h \
runtime_internal.h \
ompi_progress.h \
orte_wait.h
orte_wait.h \
opal_finalize.h
libruntime_la_SOURCES = \
$(headers) \
orte_abort.c \
ompi_progress.c \
orte_finalize.c \
orte_system_finalize.c \
orte_init.c \
orte_init_stage1.c \
orte_init_stage2.c \
@ -42,7 +44,8 @@ libruntime_la_SOURCES = \
orte_setup_hnp.c \
orte_universe_exists.c \
orte_restart.c \
orte_wait.c
orte_wait.c \
opal_finalize.c
# Conditionally install the header files

52
src/runtime/opal_finalize.c Обычный файл
Просмотреть файл

@ -0,0 +1,52 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "class/ompi_object.h"
#include "util/output.h"
#include "util/malloc.h"
#include "mca/base/base.h"
#include "runtime/opal_finalize.h"
/**
* Finalize the OPAL utilities
*
* @retval ORTE_SUCCESS Upon success.
* @retval ORTE_ERROR Upon failure.
*
* This function performs
*/
int opal_finalize(void)
{
/* finalize the mca */
mca_base_close();
/* finalize the output system */
ompi_output_finalize();
/* finalize the class/object system */
ompi_class_finalize();
/* finalize the memory allocator */
ompi_malloc_finalize();
return ORTE_SUCCESS;
}

32
src/runtime/opal_finalize.h Обычный файл
Просмотреть файл

@ -0,0 +1,32 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#ifndef OPAL_FINALIZE_H
#define OPAL_FINALIZE_H
/**
* Finalize the OPAL utilities
*
* @retval ORTE_SUCCESS Upon success.
* @retval ORTE_ERROR Upon failure.
*
* This function performs
*/
int opal_finalize(void);
#endif

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

@ -19,23 +19,8 @@
#include "orte_config.h"
#include "include/orte_constants.h"
#include "runtime/opal_finalize.h"
#include "runtime/runtime.h"
#include "runtime/orte_wait.h"
#include "event/event.h"
#include "mca/rml/base/base.h"
#include "dps/dps.h"
#include "mca/ns/base/base.h"
#include "mca/gpr/base/base.h"
#include "mca/iof/base/base.h"
#include "mca/rmgr/base/base.h"
#include "util/if.h"
#include "util/malloc.h"
#include "util/output.h"
#include "util/session_dir.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/univ_info.h"
#include "util/os_path.h"
/**
* Leave ORTE.
@ -47,53 +32,11 @@
*/
int orte_finalize(void)
{
char *contact_path;
/* finalize the orte system */
orte_system_finalize();
/* if I'm the seed, remove the universe contact info file */
if (orte_process_info.seed) {
contact_path = orte_os_path(false, orte_process_info.universe_session_dir,
"universe-setup.txt", NULL);
unlink(contact_path);
free(contact_path);
}
/* rmgr close depends on wait/iof */
orte_rmgr_base_close();
orte_wait_finalize();
orte_iof_base_close();
orte_ns_base_close();
orte_gpr_base_close();
orte_rml_base_close();
orte_dps_close();
ompi_progress_finalize();
ompi_event_fini();
#ifndef WIN32
orte_session_dir_finalize(orte_process_info.my_name);
#endif
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
orte_univ_info_finalize();
/* cleanup the if data */
ompi_iffinalize();
/* finalize the mca */
mca_base_close();
/* finalize the output system */
ompi_output_finalize();
/* finalize the class/object system */
ompi_class_finalize();
/* finalize the memory allocator */
ompi_malloc_finalize();
/* finalize the opal utilities */
opal_finalize();
return ORTE_SUCCESS;
}

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

@ -468,11 +468,9 @@ static void orte_setup_hnp_recv(int status, orte_process_name_t* sender,
int rc;
OMPI_THREAD_LOCK(&orte_setup_hnp_mutex);
ompi_output(0, "HE CALLED HOME!!");
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &orted_uri, &n, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
}
ompi_output(0, "got a uri of: %s", orted_uri);
ompi_condition_signal(&orte_setup_hnp_condition);
OMPI_THREAD_UNLOCK(&orte_setup_hnp_mutex);
}

85
src/runtime/orte_system_finalize.c Обычный файл
Просмотреть файл

@ -0,0 +1,85 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "runtime/runtime.h"
#include "runtime/orte_wait.h"
#include "event/event.h"
#include "mca/rml/base/base.h"
#include "dps/dps.h"
#include "mca/ns/base/base.h"
#include "mca/gpr/base/base.h"
#include "mca/iof/base/base.h"
#include "mca/rmgr/base/base.h"
#include "util/if.h"
#include "util/session_dir.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/univ_info.h"
#include "util/os_path.h"
/**
* Leave ORTE.
*
* @retval ORTE_SUCCESS Upon success.
* @retval ORTE_ERROR Upon failure.
*
* This function performs
*/
int orte_system_finalize(void)
{
char *contact_path;
/* if I'm the seed, remove the universe contact info file */
if (orte_process_info.seed) {
contact_path = orte_os_path(false, orte_process_info.universe_session_dir,
"universe-setup.txt", NULL);
unlink(contact_path);
free(contact_path);
}
/* rmgr close depends on wait/iof */
orte_rmgr_base_close();
orte_wait_finalize();
orte_iof_base_close();
orte_ns_base_close();
orte_gpr_base_close();
orte_rml_base_close();
orte_dps_close();
ompi_progress_finalize();
ompi_event_fini();
#ifndef WIN32
orte_session_dir_finalize(orte_process_info.my_name);
#endif
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
orte_univ_info_finalize();
/* cleanup the if data */
ompi_iffinalize();
return ORTE_SUCCESS;
}

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

@ -19,10 +19,10 @@
*
* Interface into the Open MPI Run Time Environment
*/
#ifndef OMPI_RUNTIME_H
#define OMPI_RUNTIME_H
#ifndef ORTE_RUNTIME_H
#define ORTE_RUNTIME_H
#include "ompi_config.h"
#include "orte_config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -113,6 +113,7 @@ OMPI_DECLSPEC int orte_restart(orte_process_name_t* name, const char* uri);
*
*/
OMPI_DECLSPEC int orte_finalize(void);
OMPI_DECLSPEC int orte_system_finalize(void);
/*
* Change state as processes complete registration/unregistration

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

@ -131,7 +131,7 @@ int main(int argc, char *argv[])
ompi_cmd_line_t *cmd_line = NULL;
char *contact_path = NULL, *orted=NULL;
char *log_path = NULL, **ortedargv;
char *universe, orted_uri[256], *orted_uri_ptr, *path, *param;
char *universe, orted_uri[256], **orted_uri_ptr, *path, *param;
orte_universe_t univ;
orte_buffer_t buffer;
orte_process_name_t requestor;
@ -315,8 +315,8 @@ int main(int argc, char *argv[])
/* universe is here! send info back and die */
fprintf(stderr, "contacted existing universe - sending contact info back\n");
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
orted_uri_ptr = &univ.seed_uri;
if (ORTE_SUCCESS != (ret = orte_dps.pack(&buffer, &orte_uri_ptr, 1, ORTE_STRING))) {
orted_uri_ptr = &(univ.seed_uri);
if (ORTE_SUCCESS != (ret = orte_dps.pack(&buffer, &orted_uri_ptr, 1, ORTE_STRING))) {
fprintf(stderr, "orteprobe: failed to pack contact info for existing universe\n");
exit(1);
}
@ -417,7 +417,8 @@ fprintf(stderr, "attempting to read from daemon\n");
/* send back the info */
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
orted_uri_ptr = &orted_uri;
param = orted_uri;
orted_uri_ptr = &param;
if (ORTE_SUCCESS != (ret = orte_dps.pack(&buffer, &orted_uri_ptr, 1, ORTE_STRING))) {
fprintf(stderr, "orteprobe: failed to pack daemon uri\n");
exit(1);