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"
|
2009-03-21 04:26:27 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_STDINT_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
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
|
2004-09-03 20:26:15 +04:00
|
|
|
|
2009-03-21 04:26:27 +03:00
|
|
|
#include "orte/types.h"
|
2008-04-30 23:49:53 +04:00
|
|
|
#include "opal/dss/dss_types.h"
|
|
|
|
|
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
|
|
|
|
2009-01-31 01:47:30 +03:00
|
|
|
#define ORTE_MAX_HOSTNAME_SIZE 512
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
typedef uint32_t orte_proc_type_t;
|
|
|
|
#define ORTE_PROC_TYPE_NONE 0x0000
|
|
|
|
#define ORTE_PROC_SINGLETON 0x0001
|
|
|
|
#define ORTE_PROC_DAEMON 0x0002
|
|
|
|
#define ORTE_PROC_HNP 0x0004
|
|
|
|
#define ORTE_PROC_TOOL 0x0008
|
2009-05-11 18:11:44 +04:00
|
|
|
#define ORTE_PROC_NON_MPI 0x0010
|
2009-05-04 15:07:40 +04:00
|
|
|
#define ORTE_PROC_MPI 0x0020
|
2009-05-11 18:11:44 +04:00
|
|
|
#define ORTE_PROC_APP 0x0030
|
2009-05-04 15:07:40 +04:00
|
|
|
#define ORTE_PROC_CM 0x0040
|
2009-05-30 05:10:25 +04:00
|
|
|
#define ORTE_PROC_CM_APP 0x0080
|
2009-05-04 15:07:40 +04:00
|
|
|
|
|
|
|
#define ORTE_PROC_IS_SINGLETON (ORTE_PROC_SINGLETON & orte_process_info.proc_type)
|
|
|
|
#define ORTE_PROC_IS_DAEMON (ORTE_PROC_DAEMON & orte_process_info.proc_type)
|
|
|
|
#define ORTE_PROC_IS_HNP (ORTE_PROC_HNP & orte_process_info.proc_type)
|
|
|
|
#define ORTE_PROC_IS_TOOL (ORTE_PROC_TOOL & orte_process_info.proc_type)
|
2009-05-11 18:11:44 +04:00
|
|
|
#define ORTE_PROC_IS_NON_MPI (ORTE_PROC_NON_MPI & orte_process_info.proc_type)
|
2009-05-04 15:07:40 +04:00
|
|
|
#define ORTE_PROC_IS_MPI (ORTE_PROC_MPI & orte_process_info.proc_type)
|
2009-05-11 18:11:44 +04:00
|
|
|
#define ORTE_PROC_IS_APP (ORTE_PROC_APP & orte_process_info.proc_type)
|
2009-05-04 15:07:40 +04:00
|
|
|
#define ORTE_PROC_IS_CM (ORTE_PROC_CM & orte_process_info.proc_type)
|
2009-05-30 05:10:25 +04:00
|
|
|
#define ORTE_PROC_IS_CM_APP (ORTE_PROC_CM_APP & orte_process_info.proc_type)
|
2009-05-04 15:07:40 +04:00
|
|
|
|
|
|
|
|
2004-06-29 08:50:40 +04:00
|
|
|
/**
|
|
|
|
* Process information structure
|
|
|
|
*
|
2009-03-06 00:56:03 +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 {
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_process_name_t my_name; /**< My official process name */
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
orte_process_name_t my_daemon; /**< Name of my local daemon */
|
2008-02-28 04:57:57 +03:00
|
|
|
char *my_daemon_uri; /**< Contact info to local daemon */
|
|
|
|
orte_process_name_t my_hnp; /**< Name of my hnp */
|
|
|
|
char *my_hnp_uri; /**< Contact info for my hnp */
|
|
|
|
pid_t hnp_pid; /**< hnp pid - used if singleton */
|
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_std_cntr_t app_num; /**< our index into the app_context array */
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_vpid_t num_procs; /**< number of processes in this job */
|
2009-02-19 23:45:07 +03:00
|
|
|
int num_nodes; /**< number of nodes in the job */
|
2008-03-24 02:10:15 +03:00
|
|
|
char *nodename; /**< string name for this node */
|
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
|
|
|
pid_t pid; /**< Local process ID for this process */
|
2009-05-04 15:07:40 +04:00
|
|
|
orte_proc_type_t proc_type; /**< Type of process */
|
2008-04-30 23:49:53 +04:00
|
|
|
opal_buffer_t *sync_buf; /**< buffer to store sync response */
|
2009-01-30 21:31:43 +03:00
|
|
|
uint16_t my_port; /**< TCP port for out-of-band comm */
|
2008-02-28 04:57:57 +03:00
|
|
|
/* The session directory has the form
|
|
|
|
* <prefix>/<openmpi-sessions-user>/<jobid>/<procid>, where the prefix
|
|
|
|
* can either be provided by the user via the
|
|
|
|
* --tmpdir command-line flag, the use of one of several
|
|
|
|
* environmental variables, or else a default location.
|
|
|
|
*/
|
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
|
|
|
char *tmpdir_base; /**< Base directory of the session dir tree */
|
|
|
|
char *top_session_dir; /**< Top-most directory of the session tree */
|
2008-02-28 04:57:57 +03:00
|
|
|
char *job_session_dir; /**< Session directory for job */
|
|
|
|
char *proc_session_dir; /**< Session directory for the process */
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2008-02-28 04:57:57 +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
|
2009-03-06 00:56:03 +03:00
|
|
|
* orte_rte_init() (which calls \c orte_proc_info() to fill in the
|
2004-08-10 20:05:22 +04:00
|
|
|
* structure).
|
|
|
|
*
|
2009-03-06 00:56:03 +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
|
|
|
*/
|
2009-03-06 00:56:03 +03: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
|
2009-03-06 00:56:03 +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.
|
|
|
|
*/
|
|
|
|
|
2009-03-06 00:56:03 +03: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
|