2004-06-29 08:50:40 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-29 08:50:40 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* Populates global structure with process-specific information.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#ifndef _ORTE_PROC_INFO_H_
|
|
|
|
#define _ORTE_PROC_INFO_H_
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2004-10-25 18:14:20 +04:00
|
|
|
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-06-29 08:50:40 +04:00
|
|
|
#include <sys/types.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/ns/ns_types.h"
|
2004-09-03 20:26:15 +04:00
|
|
|
|
2007-07-02 05:33:35 +04:00
|
|
|
BEGIN_C_DECLS
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
|
2004-06-29 08:50:40 +04:00
|
|
|
/**
|
|
|
|
* Process information structure
|
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* The orte_proc_info() function fills the pid field and obtains the
|
2004-08-10 20:05:22 +04:00
|
|
|
* 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 08:50:40 +04:00
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_proc_info_t {
|
Compute and pass the local_rank and local number of procs (in that proc's job) on the node.
To be precise, given this hypothetical launching pattern:
host1: vpids 0, 2, 4, 6
host2: vpids 1, 3, 5, 7
The local_rank for these procs would be:
host1: vpids 0->local_rank 0, v2->lr1, v4->lr2, v6->lr3
host2: vpids 1->local_rank 0, v3->lr1, v5->lr2, v7->lr3
and the number of local procs on each node would be four. If vpid=0 then does a comm_spawn of one process on host1, the values of the parent job would remain unchanged. The local_rank of the child process would be 0 and its num_local_procs would be 1 since it is in a separate jobid.
I have verified this functionality for the rsh case - need to verify that slurm and other cases also get the right values. Some consolidation of common code is probably going to occur in the SDS components to make this simpler and more maintainable in the future.
This commit was SVN r14706.
2007-05-21 18:30:10 +04:00
|
|
|
orte_process_name_t *my_name; /**< My official process name */
|
|
|
|
orte_std_cntr_t app_num; /**< our index into the app_context array */
|
2007-07-02 05:33:35 +04:00
|
|
|
orte_std_cntr_t universe_size; /**< the size of the universe we are in */
|
Compute and pass the local_rank and local number of procs (in that proc's job) on the node.
To be precise, given this hypothetical launching pattern:
host1: vpids 0, 2, 4, 6
host2: vpids 1, 3, 5, 7
The local_rank for these procs would be:
host1: vpids 0->local_rank 0, v2->lr1, v4->lr2, v6->lr3
host2: vpids 1->local_rank 0, v3->lr1, v5->lr2, v7->lr3
and the number of local procs on each node would be four. If vpid=0 then does a comm_spawn of one process on host1, the values of the parent job would remain unchanged. The local_rank of the child process would be 0 and its num_local_procs would be 1 since it is in a separate jobid.
I have verified this functionality for the rsh case - need to verify that slurm and other cases also get the right values. Some consolidation of common code is probably going to occur in the SDS components to make this simpler and more maintainable in the future.
This commit was SVN r14706.
2007-05-21 18:30:10 +04:00
|
|
|
bool singleton; /**< I am a singleton */
|
|
|
|
orte_vpid_t vpid_start; /**< starting vpid for this job */
|
|
|
|
orte_std_cntr_t num_procs; /**< number of processes in this job */
|
|
|
|
orte_vpid_t local_rank; /**< local rank on this node */
|
|
|
|
orte_std_cntr_t num_local_procs; /**< total number of procs on this node */
|
|
|
|
pid_t pid; /**< Local process ID for this process */
|
|
|
|
bool seed; /**< Indicate whether or not this is seed daemon */
|
|
|
|
bool daemon; /**< Indicate whether or not I am a daemon */
|
|
|
|
char *ns_replica_uri; /**< contact info for name services replica */
|
|
|
|
char *gpr_replica_uri; /**< contact info for registry replica */
|
|
|
|
orte_process_name_t *ns_replica; /**< Name of my name server replica (NULL=>me) */
|
|
|
|
orte_process_name_t *gpr_replica; /**< Name of my registry replica (NULL=>me) */
|
|
|
|
char *tmpdir_base; /**< Base directory of the session dir tree */
|
|
|
|
char *top_session_dir; /**< Top-most directory of the session tree */
|
|
|
|
char *universe_session_dir; /**< Location of universe temp dir.
|
2004-06-29 08:50:40 +04:00
|
|
|
* The session directory has the form
|
2004-06-29 11:02:57 +04:00
|
|
|
* <prefix><openmpi-sessions-user><universe>, where the prefix
|
2004-06-29 08:50:40 +04:00
|
|
|
* can either be provided by the user via the
|
|
|
|
* --tmpdir command-line flag, the use of one of several
|
2004-06-29 11:02:57 +04:00
|
|
|
* environmental variables, or else a default location.
|
2004-06-29 08:50:40 +04:00
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
char *job_session_dir; /**< Session directory for job */
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
char *proc_session_dir; /**< Session directory for the process */
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
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. */
|
2004-06-29 08:50:40 +04:00
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef struct orte_proc_info_t orte_proc_info_t;
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2004-08-10 20:05:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Global process info descriptor. Initialized to almost no
|
|
|
|
* meaningful information - data is provided by calling \c
|
2005-03-14 23:57:21 +03:00
|
|
|
* orte_rte_init() (which calls \c orte_proc_info() to fill in the
|
2004-08-10 20:05:22 +04:00
|
|
|
* structure).
|
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* The exception to this rule is the \c orte_process_info.seed field,
|
2004-08-10 20:05:22 +04:00
|
|
|
* which will be initialized to \c false, but should be set to \c true
|
2005-03-14 23:57:21 +03:00
|
|
|
* before calling \c orte_rte_info() if the caller is a seed daemon.
|
2004-08-10 20:05:22 +04:00
|
|
|
*/
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC extern orte_proc_info_t orte_process_info;
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2004-08-10 20:05:22 +04:00
|
|
|
|
2004-06-29 08:50:40 +04:00
|
|
|
/**
|
2004-08-10 20:05:22 +04:00
|
|
|
* \internal
|
|
|
|
*
|
|
|
|
* Global structure to store a wide range of information about the
|
2005-03-14 23:57:21 +03:00
|
|
|
* process. orte_proc_info populates a global variable with
|
2004-08-10 20:05:22 +04:00
|
|
|
* information about the process being executing. This function should
|
2005-03-14 23:57:21 +03:00
|
|
|
* be called only once, from orte_rte_init().
|
2004-06-29 08:50:40 +04:00
|
|
|
*
|
|
|
|
* @param None.
|
|
|
|
*
|
2006-02-12 04:33:29 +03:00
|
|
|
* @retval ORTE_SUCCESS Successfully initialized the various fields.
|
2004-06-29 08:50:40 +04:00
|
|
|
* @retval OMPI_ERROR Failed to initialize one or more fields.
|
|
|
|
*/
|
|
|
|
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC int orte_proc_info(void);
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC int orte_proc_info_finalize(void);
|
2007-07-02 05:33:35 +04:00
|
|
|
|
|
|
|
END_C_DECLS
|
2004-10-22 20:06:05 +04:00
|
|
|
|
|
|
|
#endif
|