Can now start/finalize/restart the run-time without crashing.
Add a unit test for that functionality - will test more fully next week. This commit was SVN r5806.
Этот коммит содержится в:
родитель
a419d9be72
Коммит
7b6db8a18f
@ -387,7 +387,9 @@ int ompi_iffinalize(void)
|
|||||||
while (NULL != (intf_ptr = (ompi_if_t*)ompi_list_remove_first(&ompi_if_list))) {
|
while (NULL != (intf_ptr = (ompi_if_t*)ompi_list_remove_first(&ompi_if_list))) {
|
||||||
OBJ_RELEASE(intf_ptr);
|
OBJ_RELEASE(intf_ptr);
|
||||||
}
|
}
|
||||||
|
OBJ_DESTRUCT(&ompi_if_list);
|
||||||
#endif
|
#endif
|
||||||
|
already_done = false;
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ OMPI_DECLSPEC orte_proc_info_t orte_process_info = {
|
|||||||
/* .proc_session_dir = */ NULL,
|
/* .proc_session_dir = */ NULL,
|
||||||
/* .sock_stdin = */ NULL,
|
/* .sock_stdin = */ NULL,
|
||||||
/* .sock_stdout = */ NULL,
|
/* .sock_stdout = */ NULL,
|
||||||
/* .sock_stderr = */ NULL};
|
/* .sock_stderr = */ NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
int orte_proc_info(void)
|
int orte_proc_info(void)
|
||||||
@ -83,55 +84,71 @@ int orte_proc_info_finalize(void)
|
|||||||
{
|
{
|
||||||
if (NULL != orte_process_info.my_name) {
|
if (NULL != orte_process_info.my_name) {
|
||||||
free(orte_process_info.my_name);
|
free(orte_process_info.my_name);
|
||||||
|
orte_process_info.my_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.ns_replica_uri) {
|
if (NULL != orte_process_info.ns_replica_uri) {
|
||||||
free(orte_process_info.ns_replica_uri);
|
free(orte_process_info.ns_replica_uri);
|
||||||
|
orte_process_info.ns_replica_uri = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.gpr_replica_uri) {
|
if (NULL != orte_process_info.gpr_replica_uri) {
|
||||||
free(orte_process_info.gpr_replica_uri);
|
free(orte_process_info.gpr_replica_uri);
|
||||||
|
orte_process_info.gpr_replica_uri = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.ns_replica) {
|
if (NULL != orte_process_info.ns_replica) {
|
||||||
free(orte_process_info.ns_replica);
|
free(orte_process_info.ns_replica);
|
||||||
|
orte_process_info.ns_replica = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.gpr_replica) {
|
if (NULL != orte_process_info.gpr_replica) {
|
||||||
free(orte_process_info.gpr_replica);
|
free(orte_process_info.gpr_replica);
|
||||||
|
orte_process_info.gpr_replica = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.tmpdir_base) {
|
if (NULL != orte_process_info.tmpdir_base) {
|
||||||
free(orte_process_info.tmpdir_base);
|
free(orte_process_info.tmpdir_base);
|
||||||
|
orte_process_info.tmpdir_base = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.top_session_dir) {
|
if (NULL != orte_process_info.top_session_dir) {
|
||||||
free(orte_process_info.top_session_dir);
|
free(orte_process_info.top_session_dir);
|
||||||
|
orte_process_info.top_session_dir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.universe_session_dir) {
|
if (NULL != orte_process_info.universe_session_dir) {
|
||||||
free(orte_process_info.universe_session_dir);
|
free(orte_process_info.universe_session_dir);
|
||||||
|
orte_process_info.universe_session_dir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.job_session_dir) {
|
if (NULL != orte_process_info.job_session_dir) {
|
||||||
free(orte_process_info.job_session_dir);
|
free(orte_process_info.job_session_dir);
|
||||||
|
orte_process_info.job_session_dir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.proc_session_dir) {
|
if (NULL != orte_process_info.proc_session_dir) {
|
||||||
free(orte_process_info.proc_session_dir);
|
free(orte_process_info.proc_session_dir);
|
||||||
|
orte_process_info.proc_session_dir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.sock_stdin) {
|
if (NULL != orte_process_info.sock_stdin) {
|
||||||
free(orte_process_info.sock_stdin);
|
free(orte_process_info.sock_stdin);
|
||||||
|
orte_process_info.sock_stdin = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.sock_stdout) {
|
if (NULL != orte_process_info.sock_stdout) {
|
||||||
free(orte_process_info.sock_stdout);
|
free(orte_process_info.sock_stdout);
|
||||||
|
orte_process_info.sock_stdout = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_process_info.sock_stderr) {
|
if (NULL != orte_process_info.sock_stderr) {
|
||||||
free(orte_process_info.sock_stderr);
|
free(orte_process_info.sock_stderr);
|
||||||
|
orte_process_info.sock_stderr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
orte_process_info.seed = false;
|
||||||
|
orte_process_info.daemon = false;
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -128,32 +128,52 @@ int orte_sys_info(void)
|
|||||||
|
|
||||||
int orte_sys_info_finalize(void)
|
int orte_sys_info_finalize(void)
|
||||||
{
|
{
|
||||||
if (NULL != orte_system_info.sysname)
|
if (NULL != orte_system_info.sysname) {
|
||||||
free(orte_system_info.sysname);
|
free(orte_system_info.sysname);
|
||||||
|
orte_system_info.sysname = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.nodename)
|
if (NULL != orte_system_info.nodename) {
|
||||||
free(orte_system_info.nodename);
|
free(orte_system_info.nodename);
|
||||||
|
orte_system_info.nodename = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.release)
|
if (NULL != orte_system_info.release) {
|
||||||
free(orte_system_info.release);
|
free(orte_system_info.release);
|
||||||
|
orte_system_info.release = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.version)
|
if (NULL != orte_system_info.version) {
|
||||||
free(orte_system_info.version);
|
free(orte_system_info.version);
|
||||||
|
orte_system_info.version = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.machine)
|
if (NULL != orte_system_info.machine) {
|
||||||
free(orte_system_info.machine);
|
free(orte_system_info.machine);
|
||||||
|
orte_system_info.machine = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.path_sep)
|
if (NULL != orte_system_info.path_sep) {
|
||||||
free(orte_system_info.path_sep);
|
free(orte_system_info.path_sep);
|
||||||
|
orte_system_info.path_sep = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.user)
|
if (NULL != orte_system_info.user) {
|
||||||
free(orte_system_info.user);
|
free(orte_system_info.user);
|
||||||
|
orte_system_info.user = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.enviro)
|
if (NULL != orte_system_info.enviro) {
|
||||||
free(orte_system_info.enviro);
|
free(orte_system_info.enviro);
|
||||||
|
orte_system_info.enviro = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_system_info.suffix)
|
if (NULL != orte_system_info.suffix) {
|
||||||
free(orte_system_info.suffix);
|
free(orte_system_info.suffix);
|
||||||
|
orte_system_info.suffix = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
orte_system_info.init = false;
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -127,17 +127,40 @@ int orte_univ_info(void)
|
|||||||
|
|
||||||
int orte_univ_info_finalize(void)
|
int orte_univ_info_finalize(void)
|
||||||
{
|
{
|
||||||
if (NULL != orte_universe_info.name) free(orte_universe_info.name);
|
if (NULL != orte_universe_info.name) {
|
||||||
|
free(orte_universe_info.name);
|
||||||
|
orte_universe_info.name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_universe_info.host) free(orte_universe_info.host);
|
if (NULL != orte_universe_info.host) {
|
||||||
|
free(orte_universe_info.host);
|
||||||
|
orte_universe_info.host = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_universe_info.uid) free(orte_universe_info.uid);
|
if (NULL != orte_universe_info.uid) {
|
||||||
|
free(orte_universe_info.uid);
|
||||||
|
orte_universe_info.uid = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_universe_info.scope) free(orte_universe_info.scope);
|
if (NULL != orte_universe_info.scope) {
|
||||||
|
free(orte_universe_info.scope);
|
||||||
|
orte_universe_info.scope = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_universe_info.seed_uri) free(orte_universe_info.seed_uri);
|
if (NULL != orte_universe_info.seed_uri) {
|
||||||
|
free(orte_universe_info.seed_uri);
|
||||||
|
orte_universe_info.seed_uri = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != orte_universe_info.scriptfile) free(orte_universe_info.scriptfile);
|
if (NULL != orte_universe_info.scriptfile) {
|
||||||
|
free(orte_universe_info.scriptfile);
|
||||||
|
orte_universe_info.scriptfile = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
orte_universe_info.init = false;
|
||||||
|
orte_universe_info.persistence = false;
|
||||||
|
orte_universe_info.console = false;
|
||||||
|
orte_universe_info.console_connected = false;
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,8 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir)/test/support
|
-I$(top_srcdir)/test/support
|
||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
sigchld
|
sigchld \
|
||||||
|
start_shut
|
||||||
|
|
||||||
TESTS = \
|
TESTS = \
|
||||||
$(check_PROGRAMS)
|
$(check_PROGRAMS)
|
||||||
@ -31,3 +32,10 @@ sigchld_LDADD = \
|
|||||||
$(top_builddir)/src/libmpi.la \
|
$(top_builddir)/src/libmpi.la \
|
||||||
$(top_builddir)/test/support/libsupport.a
|
$(top_builddir)/test/support/libsupport.a
|
||||||
sigchld_DEPENDENCIES = $(sigchld_LDADD)
|
sigchld_DEPENDENCIES = $(sigchld_LDADD)
|
||||||
|
|
||||||
|
start_shut_SOURCES = \
|
||||||
|
start_shut.c
|
||||||
|
start_shut_LDADD = \
|
||||||
|
$(top_builddir)/src/libmpi.la \
|
||||||
|
$(top_builddir)/test/support/libsupport.a
|
||||||
|
start_shut_DEPENDENCIES = $(start_shut_LDADD)
|
||||||
|
63
test/runtime/start_shut.c
Обычный файл
63
test/runtime/start_shut.c
Обычный файл
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "orte_config.h"
|
||||||
|
#include "../src/include/orte_constants.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "support.h"
|
||||||
|
#include "../src/runtime/runtime.h"
|
||||||
|
|
||||||
|
#define NUM_ITERS 3
|
||||||
|
|
||||||
|
FILE *test_out;
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int rc, i;
|
||||||
|
|
||||||
|
test_init("orte_start_shut");
|
||||||
|
test_out = stderr;
|
||||||
|
|
||||||
|
for (i=0; i < NUM_ITERS; i++) {
|
||||||
|
fprintf(test_out, "test iteration: %d\n", i);
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_init())) {
|
||||||
|
fprintf(test_out, "iter %d: couldn't complete init - error code %d\n", i, rc);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
fprintf(test_out, "\tinit successful\n");
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_system_finalize())) {
|
||||||
|
fprintf(test_out, "iter %d: couldn't complete finalize - error %d\n", i, rc);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
fprintf(test_out, "\tfinalize successful\n");
|
||||||
|
}
|
||||||
|
fprintf(test_out, "orte_start_shut: successful\n");
|
||||||
|
|
||||||
|
rc = test_finalize();
|
||||||
|
fclose(test_out);
|
||||||
|
return rc;
|
||||||
|
}
|
Загрузка…
x
Ссылка в новой задаче
Block a user