1
1
openmpi/orte/util/univ_info.h
Josh Hursey 0a931f9fad Brining over the session directory and universe changes
from the tmp/jjhursey-ft-cr branch.

In this commit we change the way universe names are created.
Before we by default first created "default-universe" then
if there was a conflict we created "default-universe-PID"
where PID is the PID of the HNP.
Now we create "default-universe-PID" all the time (when
a default universe name is used). This makes it much 
easier when trying to find a HNP from an outside app 
(e.g. orte-ps, orteconsole, ...)

This also adds a "search" function to find all of the 
universes on the machine. This is useful in many contexts
when trying to find a persistent daemon or when trying to 
connect to a HNP.

This commit also makes orte_universe_t an opal_object_t, 
which is something that needed to happen, and only effected
the SDS in one of it's base functions.


I was asked to bring this over to aid in fixing orteconsole
and orteprobe. Due to the change of orte_universe_t to 
an object orteprobe may need to be updated to reflect this 
change. Since orteprobe needs to be looked at anyway I'll
leave this to Ralph to take care of.

*Note*:
These changes do not depend upon any of the FT work (but
the FT work does depend upon them). These were brought over
to help in fixing some of the ORTE tool set that require
the functionality layed out in this patch.

Testing:
Ran the 'ibm' tests before and after this change, and all was
as well as before the change. If anyone notices additional
irregularities in the system let me know. But none are expected.

This commit was SVN r10550.
2006-06-28 21:03:31 +00:00

98 строки
2.9 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. 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:
*
* Populates global structure with system-specific information.
*
* Notes: add limits.h, compute size of integer and other types via sizeof(type)*CHAR_BIT
*
*/
#include "orte_config.h"
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "opal/class/opal_object.h"
#include "opal/class/opal_list.h"
#ifndef _ORTE_UNIV_INFO_H_
#define _ORTE_UNIV_INFO_H_
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/* Some states for the orte_universe_t.state field */
enum orte_universe_state_t {
ORTE_UNIVERSE_STATE_PRE_INIT, /* Before initialization */
ORTE_UNIVERSE_STATE_INIT, /* In initalization */
ORTE_UNIVERSE_STATE_RUNNING, /* After initalization */
ORTE_UNIVERSE_STATE_FINALIZE /* In Finalization */
};
typedef enum orte_universe_state_t orte_universe_state_t;
/* Define the info structure underlying the Open MPI universe system
* instanced in ompi_rte_init.c */
struct orte_universe_t {
/** This is an object, so it must have a super */
opal_list_item_t super;
orte_universe_state_t state; /**< Indicates state of the universe */
char *name;
char *host;
char *uid;
bool persistence;
char *scope;
bool console;
char *seed_uri; /**< OOB contact info for universe seed */
bool console_connected; /**< Indicates if console is connected */
char *scriptfile; /**< Name of file containing commands to be executed */
};
typedef struct orte_universe_t orte_universe_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_universe_t);
OMPI_DECLSPEC extern orte_universe_t orte_universe_info;
/**
* \internal
*
* Discover the universe info from the environment
*
* Called from \c orte_init.
*
* @retval ORTE_SUCCESS If values are successfully determined.
* @retval ORTE_ERROR If the system does not provide the requested information.
*/
OMPI_DECLSPEC int orte_univ_info(void);
OMPI_DECLSPEC int orte_univ_info_finalize(void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif