2004-06-29 04:50:40 +00:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* Populates global structure with process-specific information.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2004-06-29 21:17:46 +00:00
|
|
|
#include "mca/ns/ns.h"
|
2004-06-29 04:50:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process information structure
|
|
|
|
*
|
2004-08-10 16:05:22 +00:00
|
|
|
* The ompi_proc_info() function fills the pid field and obtains the
|
|
|
|
* process name, storing that information in the global structure. The
|
|
|
|
* structure also holds path names to the universe, job, and process
|
|
|
|
* session directories, and to the stdin, stdout, and stderr temp
|
|
|
|
* files - however, these are all initialized elsewhere.
|
2004-06-29 04:50:40 +00:00
|
|
|
*/
|
|
|
|
struct ompi_proc_info_t {
|
|
|
|
bool init; /**< Certifies that values have been filled.
|
|
|
|
* Certifies that the ompi_sys_info() function has been
|
|
|
|
* called at least once so fields have valid values
|
|
|
|
*/
|
|
|
|
pid_t pid; /**< Local process ID for this process */
|
|
|
|
ompi_process_name_t *name; /**< Process name structure */
|
2004-07-08 12:43:30 +00:00
|
|
|
bool seed; /**< Indicate whether or not this is seed daemon */
|
2004-08-23 21:39:22 +00:00
|
|
|
char *my_universe; /**< The name of the universe to which this process belongs */
|
|
|
|
char *tmpdir_base; /**< Base directory of the session dir tree */
|
2004-06-29 07:02:57 +00:00
|
|
|
char *universe_session_dir; /**< Location of universe temp dir.
|
2004-06-29 04:50:40 +00:00
|
|
|
* The session directory has the form
|
2004-06-29 07:02:57 +00:00
|
|
|
* <prefix><openmpi-sessions-user><universe>, where the prefix
|
2004-06-29 04:50:40 +00:00
|
|
|
* can either be provided by the user via the
|
|
|
|
* --tmpdir command-line flag, the use of one of several
|
2004-06-29 07:02:57 +00:00
|
|
|
* environmental variables, or else a default location.
|
2004-06-29 04:50:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
char *job_session_dir; /**< Session directory for job */
|
|
|
|
|
|
|
|
char *proc_session_dir; /**< Session directory for the process */
|
|
|
|
|
|
|
|
char *sock_stdin; /**< Path name to temp file for stdin. */
|
|
|
|
char *sock_stdout; /**< Path name to temp file for stdout. */
|
|
|
|
char *sock_stderr; /**< Path name to temp file for stderr. */
|
|
|
|
};
|
|
|
|
typedef struct ompi_proc_info_t ompi_proc_info_t;
|
|
|
|
|
2004-08-10 16:05:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Global process info descriptor. Initialized to almost no
|
|
|
|
* meaningful information - data is provided by calling \c
|
|
|
|
* ompi_rte_init() (which calls \c ompi_proc_info() to fill in the
|
|
|
|
* structure).
|
|
|
|
*
|
|
|
|
* The exception to this rule is the \c ompi_process_info.seed field,
|
|
|
|
* which will be initialized to \c false, but should be set to \c true
|
|
|
|
* before calling \c ompi_rte_info() if the caller is a seed daemon.
|
|
|
|
*/
|
2004-06-29 04:50:40 +00:00
|
|
|
extern ompi_proc_info_t ompi_process_info;
|
|
|
|
|
2004-08-10 16:05:22 +00:00
|
|
|
|
2004-06-29 04:50:40 +00:00
|
|
|
/**
|
2004-08-10 16:05:22 +00:00
|
|
|
* \internal
|
|
|
|
*
|
|
|
|
* Global structure to store a wide range of information about the
|
|
|
|
* process. ompi_proc_info populates a global variable with
|
|
|
|
* information about the process being executing. This function should
|
|
|
|
* be called only once, from ompi_rte_init().
|
2004-06-29 04:50:40 +00:00
|
|
|
*
|
|
|
|
* @param None.
|
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS Successfully initialized the various fields.
|
|
|
|
* @retval OMPI_ERROR Failed to initialize one or more fields.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int ompi_proc_info(void);
|