diff --git a/src/mca/schizo/pmix/schizo_pmix.c b/src/mca/schizo/pmix/schizo_pmix.c index ab2a53b88f..c4f45dac43 100644 --- a/src/mca/schizo/pmix/schizo_pmix.c +++ b/src/mca/schizo/pmix/schizo_pmix.c @@ -74,14 +74,14 @@ prte_schizo_base_module_t prte_schizo_pmix_module = { static prte_cmd_line_init_t cmd_line_init[] = { /* setup MCA parameters */ { '\0', "pmixmca", 2, PRTE_CMD_LINE_TYPE_STRING, - "Pass context-specific PMIx MCA parameters; they are considered global if --gmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", + "Pass context-specific PMIx MCA parameters; they are considered global if --gpmixmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", + PRTE_CMD_LINE_OTYPE_LAUNCH }, + { '\0', "gmca", 2, PRTE_CMD_LINE_TYPE_STRING, + "Pass global MCA parameters that are applicable to all contexts (arg0 is the parameter name; arg1 is the parameter value)", PRTE_CMD_LINE_OTYPE_LAUNCH }, { '\0', "gpmixmca", 2, PRTE_CMD_LINE_TYPE_STRING, "Pass global PMIx MCA parameters that are applicable to all contexts (arg0 is the parameter name; arg1 is the parameter value)", PRTE_CMD_LINE_OTYPE_LAUNCH }, - { '\0', "pmixam", 1, PRTE_CMD_LINE_TYPE_STRING, - "Aggregate PMIx MCA parameter set file list", - PRTE_CMD_LINE_OTYPE_LAUNCH }, /* End of list */ { '\0', NULL, 0, PRTE_CMD_LINE_TYPE_NULL, NULL } diff --git a/src/mca/schizo/prte/schizo_prte.c b/src/mca/schizo/prte/schizo_prte.c index 899500af0c..9943cd34eb 100644 --- a/src/mca/schizo/prte/schizo_prte.c +++ b/src/mca/schizo/prte/schizo_prte.c @@ -111,11 +111,15 @@ static prte_cmd_line_init_t cmd_line_init[] = { /* setup MCA parameters */ { '\0', "mca", 2, PRTE_CMD_LINE_TYPE_STRING, - "Pass context-specific MCA parameters; they are considered global if --gmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", + "Pass context-specific MCA parameters; they are considered global if --gpmixmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", PRTE_CMD_LINE_OTYPE_LAUNCH }, { '\0', "prtemca", 2, PRTE_CMD_LINE_TYPE_STRING, - "Pass context-specific PRTE MCA parameters; they are considered global if --gmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", + "Pass context-specific PRTE MCA parameters; they are considered global if --gpmixmca is not used and only one context is specified (arg0 is the parameter name; arg1 is the parameter value)", PRTE_CMD_LINE_OTYPE_LAUNCH }, + { '\0', "gprtemca", 2, PRTE_CMD_LINE_TYPE_STRING, + "Pass global PRRTE MCA parameters that are applicable to all contexts (arg0 is the parameter name; arg1 is the parameter value)", + PRTE_CMD_LINE_OTYPE_LAUNCH }, + /* Request parseable help output */ { '\0', "prte_info_pretty", 0, PRTE_CMD_LINE_TYPE_BOOL, @@ -230,7 +234,8 @@ static int parse_cli(int argc, int start, char **argv, for (i = 0; i < (argc-start); ++i) { ignore = true; - if (0 == strcmp("--prtemca", argv[i])) { + if (0 == strcmp("--prtemca", argv[i]) || + 0 == strcmp("--gprtemca", argv[i])) { if (NULL == argv[i+1] || NULL == argv[i+2]) { /* this is an error */ return PRTE_ERR_FATAL; diff --git a/src/tools/prte/prte.1.md b/src/tools/prte/prte.1.md index 0dd414abc2..2b59b96b1a 100644 --- a/src/tools/prte/prte.1.md +++ b/src/tools/prte/prte.1.md @@ -1,13 +1,19 @@ # NAME -prte - Establish a PRTE Distributed Virtual Machine (DVM). +prte - Establish a PRRTE Distributed Virtual Machine (DVM). # SYNOPSIS +Persistent DVM mode: ``` prte [ options ] ``` +Single-Use DVM mode: +``` +prte [ options ] [ ] +``` + Invoking `prte` via an absolute path name is equivalent to specifying the `--prefix` option with a `` value equivalent to the directory where `prte` resides, minus its last subdirectory. @@ -20,22 +26,36 @@ $ /usr/local/bin/prte ... is equivalent to ``` -$ prte --prefix /usr/local +$ prte --prefix /usr/local ... ``` # QUICK SUMMARY -`prte` will establish a DVM that can be used to execute subsequent -applications. Use of `prte` can be advantageous, for example, when -you want to execute a number of short-lived tasks. In such cases, the -time required to start the PRTE DVM can be a significant fraction of -the time to execute the overall application. Thus, creating a persistent -DVM can speed the overall execution. In addition, a persistent DVM will -support executing multiple parallel applications while maintaining -separation between their respective cores. +`prte` can be invoked in one of two DVM modes, namely, Persistent and Single-Use +modes. + +In Persistent mode, `prte` will establish a Distributed Virtual Machine (DVM) +that can be used to execute subsequent applications. Use of `prte` in this mode +can be advantageous, for example, when you want to execute a number of +short-lived tasks (e.g., in a workflow scenario). In such cases, the time +required to start the PRRTE DVM can be a significant fraction of the time to +execute the overall application. Thus, creating a persistent PRRTE DVM can +speed the overall execution. In addition, a persistent DVM will support +executing multiple parallel applications while maintaining separation between +their respective cores. + +In Single-Use mode, `prte` will establish a Distributed Virtual Machine (DVM), +run the specified ``, then shutdown the PRRTE DVM. Use of `prte` in +this mode can streamline applications that only want to execute a single +application. In this mode `prte` accepts all of the `prun` command line options +for starting the application. # OPTIONS +`prte` accepts all of the command line options from `prun`. Some of which are +only meaningful when `prte` is used in the Single-Use mode. Below are frequently +used options and those options unique to `prte`. + `-h, --help` : Display help for this command @@ -43,92 +63,101 @@ separation between their respective cores. `-V, --version` : Print version number. If no other arguments are given, this will - also cause prte to exit. + also cause `prte` to exit. -Use one of the following options to specify which hosts (nodes) of the -cluster to use for the DVM. +`--daemonize` -`-H, --host ` +: Daemonize the DVM daemons into the background -: List of hosts for the DVM. +`--no-ready-msg` -`--hostfile ` +: Do not print a "DVM ready" message -: Provide a hostfile to use. +`--report-pid ` + +: Print out `prte`'s PID during startup. The `` must be + either a '-' to indicate that the URI is to be output to stdout, a + '+' to indicate that the URI is to be output to stderr, or a + filename to which the URI is to be written. -`--machinefile ` +`--report-uri ` -: Synonym for `-hostfile`. +: Print out `prte`'s URI during startup. The `` must be + either a '-' to indicate that the URI is to be output to stdout, a + '+' to indicate that the URI is to be output to stderr, or a + filename to which the URI is to be written. -`--prefix ` +`--system-server` -: Prefix directory that will be used to set the `PATH` and - `LD_LIBRARY_PATH` on the remote node before invoking the PRTE - daemon. +: Start the DVM as the system server -Setting MCA parameters: +`--set-sid` -`--gmca ` +: Direct the DVM daemons to separate from the current session -: Pass global MCA parameters that are applicable to all contexts. - `` is the parameter name; `` is the parameter value. +`--max-vm-size ` -`--mca ` +: The number of DVM daemons to start -: Send arguments to various MCA modules. See the "MCA" section, - below. +`--launch-agent ` -`--report-uri ` +: Name of DVM daemon executable used to start processes on remote nodes. + Default: `prted` -: Print out prte's URI during startup. The channel must be - either a '-' to indicate that the URI is to be output to stdout, a - '+' to indicate that the URI is to be output to stderr, or a - filename to which the URI is to be written. +## Debugging Options The following options are useful for developers; they are not generally -useful to most PRTE users: +useful to most PRRTE users: `-d, --debug-devel` -: Enable debugging of the PRTE layer. +: Enable debugging of the PRRTE layer. + +`--debug` + +: Top-level PRRTE debug switch (default: false) + +`--debug-daemons` + +: Enable debugging of the PRRTE daemons in the DVM, output to the terminal. `--debug-daemons-file` -: Enable debugging of the PRTE daemons in the DVM, storing output in +: Enable debugging of the PRRTE daemons in the DVM, storing output in files. +`--debug-verbose ` + +: Verbosity level for PRRTE debug messages (default: `1`) + +`--leave-session-attached` + +: Do not discard stdout/stderr of remote PRRTE daemons + +`--test-suicide ` + +: Suicide instead of clean abort after delay + There may be other options listed with `prte --help`. + # DESCRIPTION `prte` starts a Distributed Virtual Machine (DVM) by launching a daemon on each node of the allocation, as modified or specified by the -`--host` and `--hostfile` options. Applications can subsequently be -executed using the `prun` command. The DVM remains in operation until -receiving the `pterm` command. - -## Specifying Host Nodes +`--host` and `--hostfile` options. -Host nodes can be identified on the `prte` command line with the -`--host` option or in a hostfile. +In the Persistent mode, applications can subsequently be executed using the +`prun` command. In this mode, the DVM remains in operation until receiving the +`pterm` command. -For example, +In the Single-Use mode, applications are executed immediately after `prte` +establishes the DVM, and the DVM is cleaned up when the application terminates. -`prte -H aa,aa,bb ./a.out` +# RETURN VALUE -: launches two processes on node aa and one on bb. - -Or, consider the hostfile - -``` -$ cat myhostfile aa slots=2 bb slots=2 cc slots=2 -``` +In the Persistent mode, `prte` returns 0 if no abnormal daemon failure occurs +during the life of the DVM, and non-zero otherwise. -Here, we list both the host names (`aa`, `bb`, and `cc`) but also how -many "slots" there are for each. Slots indicate how many processes can -potentially execute on a node. For best performance, the number of -slots may be chosen to be the number of cores on the node or the -number of processor sockets. If the hostfile does not provide slots -information, a default of 1 is assumed. When running under resource -managers (e.g., SLURM, Torque, etc.), PRTE will obtain both the -hostnames and the number of slots directly from the resource manger. +In the Single-Use mode, `prte` returns the value that `prun` would have returned +for that application. See the `prun` man page for details. diff --git a/src/tools/prun/help-prun.txt b/src/tools/prun/help-prun.txt index 5e204d7a02..9cbeeb1c4f 100644 --- a/src/tools/prun/help-prun.txt +++ b/src/tools/prun/help-prun.txt @@ -27,7 +27,7 @@ attempting to %s. Returned value %d instead of PRTE_SUCCESS. [prun:usage] %s (%s) %s -Usage: %s [OPTION]... +Usage: %s [ options ] [ ] Submit job to the PMIx Reference RTE %s diff --git a/src/tools/prun/prte-map.1.md b/src/tools/prun/prte-map.1.md new file mode 100644 index 0000000000..e8ac934003 --- /dev/null +++ b/src/tools/prun/prte-map.1.md @@ -0,0 +1,498 @@ +# NAME + +PRRTE - Mapping / Binding / Ranking Processes. + +# SYNOPSIS + +PRRTE employs a three-phase procedure for assigning process locations and ranks: + + 1. **mapping**: Assigns a default location to each process + 2. **ranking**: Assigns a unique rank value to each process + 3. **binding**: Constrains each process to run on specific processors + +This document describes these three phases with examples. + + +# QUICK SUMMARY + +The two binaries that most influence process layout are `prte` and `prun`. +The `prte` process discovers the allocation, starts the daemons, and defines the +default mapping/ranking/binding for all jobs. +The `prun` process defines the specific mapping/ranking/binding for a specific +job. Most of the command line controls are targeted to `prun` since each job has +its own unique requirements. + +The `prte` process attempts to automatically discover the nodes in the +allocation by querying supported resource managers. If a support resource +manager is not present then `prte` relies on a hostfile provided by the user. +In the absence of such a hostfile it will run all processes on the localhost. + +If running under a supported resource manager, the `prte` process will start the +daemon processes (`prted`) on the remote nodes using the corresponding resource +manager process starter. If no such starter is available then `rsh` or `ssh` +is used. + +Nodes are scheduled (by default) in a round-robin fashion by CPU slot. + +Please note that prun automatically binds processes. Three binding +patterns are used in the absence of any further directives: + +`Bind to core:` + +: when the number of processes is <= 2 + +`Bind to package:` + +: when the number of processes is > 2 + +`Bind to none:` + +: when oversubscribed + +If your application uses threads, then you probably want to ensure that +you are either not bound at all (by specifying `--bind-to none`), or +bound to multiple cores using an appropriate binding level or specific +number of processing elements per application process. + +Default ranking is by `slot` if number of processes <= 2, otherwise default to +ranking by `package` (formally known as "socket"). + +The `prte` process can be run in a Single-Use mode in which it serves the role +of `prte` and `prun` at the same time for a single application. In the +Single-Use mode all of the `prun` command line options are passed to `prte` +instead. + +In this manual page, unless otherwise noted, the Persistent mode is being used +and the PRRTE DVM is assumed to be running. The examples use `prun` without +showing the `prte` step for brevity unless the `prte` step is critical to the +example. If you are running in a Single-Use mode you can replace all `prun` +calls with `prte` and the same set of arguments. See the sections on +"Persistent Mode Considerations" and "Single-Use Mode Considerations" at the +end of this document for details specific to those modes. + +# OPTIONS + +Listed here are the subset of command line options that will be used in the +process mapping/ranking/binding discussion in this manual page. + +Unless otherwise noted, these should be passed to the `prun` process when +running in Persistent mode, and `prte` when running in Single-Use mode. + +## Specifying Host Nodes + +Use one of the following options to specify which hosts (nodes) within +the PRRTE DVM environment to run on. + +`-H, --host ` + +: List of hosts on which to invoke processes. + +`--hostfile ` + +: Provide a hostfile to use. + + +## Process Mapping / Ranking / Binding Options + +The following options specify the number of processes to launch. Note +that none of the options imply a particular binding policy - e.g., +requesting `N` processes for each socket does not imply that the processes +will be bound to the socket. + +`-c, -n, --n, --np <#>` + +: Run this many copies of the program on the given nodes. This option + indicates that the specified file is an executable program and not + an application context. If no value is provided for the number of + copies to execute (i.e., neither the `-np` nor its synonyms are + provided on the command line), `prun` will automatically execute a + copy of the program on each process slot (see below for description + of a "process slot"). This feature, however, can only be used in + the SPMD model and will return an error (without beginning execution + of the application) otherwise. + +To map processes across sets of objects: + +`--map-by ` + +: Map to the specified object. See defaults in Quick Summary. Supported + options include `slot`, `hwthread`, `core`, `L1cache`, `L2cache`, `L3cache`, + `package`, `node`, `seq`, `dist`, and `ppr`. Any object can include modifiers + by adding a : and any combination of `PE=n` (bind n processing elements to + each process), `SPAN` (load balance the processes across the allocation), + `OVERSUBSCRIBE` (allow more processes on a node than processing elements), + `NOOVERSUBSCRIBE` (`!OVERSUBSCRIBE`), `NOLOCAL` (do not launch processes on + the same node as `prun`), `HWTCPUS` (use hardware threads as cpu slots), + `CORECPUS` (use cores as cpu slots), `DEVICE` (for `dist` policy), + `INHERIT` (??), `NOINHERIT` (`!INHERIT`), `PE-LIST=a,b` (comma-delimited + ranges of cpus to use for this job). + `ppr` policy example: `--map-by ppr:N:` will launch `N` times the + number of objects of the specified type on each node. + +To order processes' ranks: + +`--rank-by ` + +: Rank in round-robin fashion according to the specified object. See defaults + in Quick Summary. + Supported options include `slot`, `hwthread`, `core`, `L1cache`, `L2cache`, + `L3cache`, `package`, and `node`. Any object can include modifiers by adding + either `:SPAN` (??) or `:FILL` (??). + +To bind processes to sets of objects: + +`--bind-to ` + +: Bind processes to the specified object. See defaults in Quick Summary. + Supported options include `none`, `slot`, `hwthread`, `core`, `l1cache`, + `l2cache`, `l3cache`, and `package`. Any object can include modifiers + by adding a : and any combination of `overload-allowed` (if overloading + of this object is allowed), and `if-supported` (if that object is + supported on this system). + + +## Diagnostics + +`--display-map` + +: Display a table showing the mapped location of each process prior to + launch. + +`--display-allocation` + +: Display the detected allocation of resources (e.g., nodes, slots) + +`--report-bindings` + +: Report bindings for launched processes to `stderr`. + +# DESCRIPTION + +PRRTE employs a three-phase procedure for assigning process locations and ranks: + + 1. **mapping**: Assigns a default location to each process + 2. **ranking**: Assigns a unique rank value to each process + 3. **binding**: Constrains each process to run on specific processors + +The first phase of **mapping** is used to assign a default location to each +process based on the mapper being employed. Mapping by slot, node, and +sequentially results in the assignment of the processes to the node level. In +contrast, mapping by object, allows the mapper to assign the process to an +actual object on each node. + +*Note:* The location assigned to the process is independent of where it will be +bound - the assignment is used solely as input to the binding algorithm. + +The second phase focuses on the **ranking** of the process within the job's +namespace. PRRTE separates this from the mapping procedure to allow more +flexibility in the relative placement of processes. + +The third phase of *binding* actually binds each process to a given set of +processors. This can improve performance if the operating system is placing +processes suboptimally. For example, it might oversubscribe some multi-core +processor sockets, leaving other sockets idle; this can lead processes to +contend unnecessarily for common resources. Or, it might spread processes out +too widely; this can be suboptimal if application performance is sensitive to +interprocess communication costs. Binding can also keep the operating system +from migrating processes excessively, regardless of how optimally those +processes were placed to begin with. + +PRRTE's support for process binding depends on the underlying operating system. +Therefore, certain process binding options may not be available on every system. + +**Note:** The examples in this document assume a Persistent Mode and assume that +the PRRTE DVM has been started (via `prte`) with the requried set of nodes +before calling any of the `prun` examples, unless otherwise noted. If you are +running in a Single-Use mode then you can replace the `prun` calls with `prte`. + +## Specifying Host Nodes + +Host nodes can be specified on the command line with the `--host` option or in +a hostfile with the `--hostfile` option. See the `prun` manual page for details. + +## Specifying Number of Processes + +The number of processes can be set using the `--host` or `--hostfile` options. +Other mechanism exist. See the `prun` manual page for details. + +## Mapping Processes to Nodes: Using Policies + +The examples from the `prun` manual page illustrate the default mapping of +process processes to nodes. This mapping can also be controlled with various +`prun` options that describe mapping policies. + +``` +$ cat myhostfile +aa slots=4 +bb slots=4 +cc slots=4 +``` + +Consider the same hostfile above, with `--np 6`: + +``` + node aa node bb node cc +prun 0 1 2 3 4 5 +prun --map-by node 0 1 2 3 4 5 +prun --map-by node:NOLOCAL 0 1 2 3 4 5 +``` + +The `--map-by node` option will load balance the processes across the +available nodes, numbering each process in a sequential fashion. + +The `:NOLOCAL` option to `--map-by` prevents any processes from being mapped +onto the local host (in this case node `aa`). While `prun` typically consumes +few system resources, `:NOLOCAL` specifier can be helpful for launching very +large jobs where `prun` may actually need to use noticeable amounts of memory +and/or processing time. + +Just as `--np` can specify fewer processes than there are slots, it can +also oversubscribe the slots. For example, with the same hostfile: + +`prun --hostfile myhostfile --np 14 ./a.out` + +: will launch processes 0-3 on node `aa`, 4-7 on `bb`, and 8-11 on `cc`. It + will then add the remaining two processes to whichever nodes it + chooses. + +One can also specify limits to oversubscription. For example, with the +same hostfile: + +`prun --hostfile myhostfile --np 14 --map-by :NOOVERSUBSCRIBE ./a.out` + +: will produce an error since the `:NOOVERSUBSCRIBE` option to `--map-by` + prevents oversubscription. + +Limits to oversubscription can also be specified in the hostfile itself: +``` +% cat myhostfile +aa slots=4 max_slots=4 +bb max_slots=4 +cc slots=4 +``` + +The `max_slots` field specifies such a limit. When it does, the `slots` +value defaults to the limit. Now: + +`prun --hostfile myhostfile --np 14 ./a.out` + +: causes the first 12 processes to be launched as before, but the + remaining two processes will be forced onto node `cc`. The other two + nodes are protected by the hostfile against oversubscription by this + job since they specified the `max_slots` option. + +Using the `:NOOVERSUBSCRIBE` option to `--map-by` can be helpful since PRRTE +currently does not get "max_slots" values from the resource manager. + +Of course, `--np` can also be used with the `--host` option. For +example, + +`prun --host aa,bb --np 8 ./a.out` + +: launches 8 processes. Since only two hosts are specified, after the + first two processes are mapped, one to `aa` and one to `bb`, the + remaining processes oversubscribe the specified hosts. + +And here is a MIMD example: + +`prun --host aa --np 1 hostname : --host bb,cc --np 2 uptime` + +: will launch process 0 running `hostname` on node `aa` and processes 1 + and 2 each running `uptime` on nodes `bb` and `cc`, respectively. + + +## Mapping, Ranking, and Binding: Fundamentals + +The mapping of process processes to nodes can be defined not just with +general policies but also, if necessary, using arbitrary mappings that +cannot be described by a simple policy. One can use the "sequential +mapper," which reads the hostfile line by line, assigning processes to +nodes in whatever order the hostfile specifies. Use the +`--prtemca rmaps seq` option. + +For example, using the hostfile below: +``` +% cat myhostfile +aa slots=4 +bb slots=4 +cc slots=4 +``` + +The command below will launch three processes, one on each of nodes `aa`, `bb`, +and `cc`, respectively. The slot counts don't matter; one process is launched +per line on whatever node is listed on the line. +``` +% prun --hostfile myhostfile --prtemca rmaps seq ./a.out +``` + +The *ranking* phase is best illustrated by considering the following two cases +where we used the `--map-by ppr:2:package` option: + +``` + node aa node bb +rank-by core 0 1 ! 2 3 4 5 ! 6 7 +rank-by package 0 2 ! 1 3 4 6 ! 5 7 +rank-by package:SPAN 0 4 ! 1 5 2 6 ! 3 7 +``` + +Ranking by core and by slot provide the identical result - a simple +progression of ranks across each node. Ranking by socket does a +round-robin ranking within each node until all processes have been +assigned a rank, and then progresses to the next node. Adding the `span` +modifier to the ranking directive causes the ranking algorithm to treat +the entire allocation as a single entity - thus, the MCW ranks are +assigned across all sockets before circling back around to the +beginning. + +The *binding* phase restricts the process to a subset of the cpu resources +on the node. + +The processors to be used for binding can be identified in terms of +topological groupings - e.g., binding to an l3cache will bind each +process to all processors within the scope of a single L3 cache within +their assigned location. Thus, if a process is assigned by the mapper to +a certain socket, then a `--bind-to l3cache` directive will cause the +process to be bound to the processors that share a single L3 cache +within that socket. + +To help balance loads, the binding directive uses a round-robin method +when binding to levels lower than used in the mapper. For example, +consider the case where a job is mapped to the socket level, and then +bound to core. Each socket will have multiple cores, so if multiple +processes are mapped to a given socket, the binding algorithm will +assign each process located to a socket to a unique core in a +round-robin manner. + +Alternatively, processes mapped by l2cache and then bound to socket will +simply be bound to all the processors in the socket where they are +located. In this manner, users can exert detailed control over relative +MCW rank location and binding. + +(??? Is the below true? MCA parameters can be used instead of CLI options?) + +Process binding can also be set with MCA parameters. Their usage is less +convenient than that of `prun` options. On the other hand, MCA +parameters can be set not only on the `prun` command line, but +alternatively in a system or user mca-params.conf file or as environment +variables, as described in the MCA section below. Some examples include: + + +``` +prun option MCA parameter key value +--map-by core rmaps_base_mapping_policy core +--map-by package rmaps_base_mapping_policy package +--rank-by core rmaps_base_ranking_policy core +--bind-to core hwloc_base_binding_policy core +--bind-to socket hwloc_base_binding_policy socket +--bind-to none hwloc_base_binding_policy none +``` + +## Mapping, Ranking, and Binding: Advanced + +Cgroups... TODO + + +## Diagnostics + +PRRTE provides various diagnostic reports that aid the user in verifying and tuning the mapping /binding / ranking for a specific job. + +The `--report-bindings` command line option can be used to report bindings. + +As an example, consider a node with two processor sockets, each comprising four cores. We run `prun` with `-np 4 --report-bindings` and the following additional options: + +``` +$ prun ... --map-by core --bind-to core ./a.out +[...] ... binding child [...,0] to cpus 0001 +[...] ... binding child [...,1] to cpus 0002 +[...] ... binding child [...,2] to cpus 0004 +[...] ... binding child [...,3] to cpus 0008 + +$ prun ... --map-by package --bind-to package ./a.out +[...] ... binding child [...,0] to socket 0 cpus 000f +[...] ... binding child [...,1] to socket 1 cpus 00f0 +[...] ... binding child [...,2] to socket 0 cpus 000f +[...] ... binding child [...,3] to socket 1 cpus 00f0 + +$ prun ... --map-by core:PE=2 --bind-to core ./a.out +[...] ... binding child [...,0] to cpus 0003 +[...] ... binding child [...,1] to cpus 000c +[...] ... binding child [...,2] to cpus 0030 +[...] ... binding child [...,3] to cpus 00c0 + +$ prun ... --bind-to none ./a.out +``` + +Here, `--report-bindings` shows the binding of each process as a mask. In the first case, the processes bind to successive cores as indicated by the masks 0001, 0002, 0004, and 0008. In the second case, processes bind to all cores on successive sockets as indicated by the masks 000f and 00f0. The processes cycle through the processor sockets in a round-robin fashion as many times as are needed. In the third case, the masks show us that 2 cores have been bound per process. In the fourth case, binding is turned off and no bindings are reported. + + +## Rankfiles + +Another way to specify arbitrary mappings is with a rankfile, which gives you detailed control over process binding as well. Rankfiles are discussed below. + +Rankfiles are text files that specify detailed information about how individual processes should be mapped to nodes, and to which processor(s) they should be bound. Each line of a rankfile specifies the location of one process. The general form of each line in the rankfile is: + +``` +rank = slot= +``` + +For example: +``` +$ cat myrankfile +rank 0=aa slot=1:0-2 +rank 1=bb slot=0:0,1 +rank 2=cc slot=1-2 +$ prun --host aa,bb,cc,dd --rf myrankfile ./a.out +``` + +Means that + +``` +Rank 0 runs on node aa, bound to logical socket 1, cores 0-2. +Rank 1 runs on node bb, bound to logical socket 0, cores 0 and 1. +Rank 2 runs on node cc, bound to logical cores 1 and 2. +``` + +Rankfiles can alternatively be used to specify *physical* processor locations. In this case, the syntax is somewhat different. Sockets are no longer recognized, and the slot number given must be the number of the physical PU as most OS's do not assign a unique physical identifier to each core in the node. Thus, a proper physical rankfile looks something like the following: + +``` +$ cat myphysicalrankfile +rank 0=aa slot=1 +rank 1=bb slot=8 +rank 2=cc slot=6 +``` + +This means that + +``` +Rank 0 will run on node aa, bound to the core that contains physical PU 1 +Rank 1 will run on node bb, bound to the core that contains physical PU 8 +Rank 2 will run on node cc, bound to the core that contains physical PU 6 +``` + +Rankfiles are treated as *logical* by default, and the MCA parameter `rmaps_rank_file_physical` must be set to `1` to indicate that the rankfile is to be considered as *physical*. + +The hostnames listed above are "absolute," meaning that actual resolveable hostnames are specified. However, hostnames can also be specified as "relative," meaning that they are specified in relation to an externally-specified list of hostnames (e.g., by prun's `--host` argument, a hostfile, or a job scheduler). + +The "relative" specification is of the form "`+n`", where `X` is an integer specifying the Xth hostname in the set of all available hostnames, indexed from 0. For example: + +``` +$ cat myrankfile +rank 0=+n0 slot=1:0-2 +rank 1=+n1 slot=0:0,1 +rank 2=+n2 slot=1-2 +$ prun -H aa,bb,cc,dd -rf myrankfile ./a.out +``` + +All socket/core slot locations are be specified as *logical* indexes. You can use tools such as HWLOC's "lstopo" to find the logical indexes of socket and cores. + +# Persistent Mode Considerations + +... + +# Single-Use Mode Considerations + +... + +# Examples + +## ... diff --git a/src/tools/prun/prun.1.md b/src/tools/prun/prun.1.md index 8316b11218..ae18c18ae4 100644 --- a/src/tools/prun/prun.1.md +++ b/src/tools/prun/prun.1.md @@ -4,6 +4,9 @@ prun - Execute serial and parallel jobs with the PMIx Reference Server. # SYNOPSIS +`prun` requires a running `prte` Distributed Virtual Machine (DVM) to be running +at the time of the call. See prte(1) for more information. + Single Process Multiple Data (SPMD) Model: ``` @@ -14,10 +17,10 @@ Multiple Instruction Multiple Data (MIMD) Model: ``` prun [ global_options ] \ - [ local_options1 ] [ ] : \ - [ local_options2 ] [ ] : \ - ... : \ - [ local_optionsN ] [ ] + [ local_options1 ] [ ] : \ + [ local_options2 ] [ ] : \ + ... : \ + [ local_optionsN ] [ ] ``` Note that in both models, invoking `prun` via an absolute path name is @@ -44,13 +47,15 @@ want to use a command line of the following form: $ prun [ -np X ] [ --hostfile ] ``` -This will run X copies of `` in your current run-time -environment (if running under a supported resource manager, PSRVR's -`prun` will usually automatically use the corresponding resource manager -process starter, as opposed to, for example, `rsh or `ssh`, which -require the use of a hostfile, or will default to running all X copies -on the localhost), scheduling (by default) in a round-robin fashion by -CPU slot. See the rest of this page for more details. +This will run `X` copies of `` in your current run-time environment +over the set of hosts specified by ``, scheduling (by default) +in a round-robin fashion by CPU slot. + +When starting the Distributed Virtual Machine, PRRTE will prefer to use the +process starter provided by a supported resource manager to start the `prted` +daemons on the allocated compute nodes. If a supported resource manager is +not available then `rsh` or `ssh` are used with a corresponding hostfile, or +if no hostfile is provided then all `X` copies are run on the `localhost`. Please note that prun automatically binds processes. Three binding patterns are used in the absence of any further directives: @@ -59,7 +64,7 @@ patterns are used in the absence of any further directives: : when the number of processes is <= 2 -`Bind to socket:` +`Bind to package:` : when the number of processes is > 2 @@ -72,6 +77,9 @@ you are either not bound at all (by specifying `--bind-to none`), or bound to multiple cores using an appropriate binding level or specific number of processing elements per application process. +Default ranking is by `slot` if number of processes <= 2, otherwise default to +ranking by `package` (formally known as "socket"). + # OPTIONS `prun` will send the name of the directory where it was invoked on the @@ -82,13 +90,13 @@ further details. `` : The program executable. This is identified as the first - non-recognized argument to prun. + non-recognized argument to `prun`. `` : Pass these run-time arguments to every new process. These must - always be the last arguments to `prun`. If an app context file is - used, `` will be ignored. + always be the last arguments to `prun` after the ``. + If an app context file is used, `` will be ignored. `-h, --help` @@ -96,7 +104,7 @@ further details. `-q, --quiet` -: Suppress informative messages from prun during application +: Suppress informative messages from `prun` during application execution. `-v, --verbose` @@ -106,271 +114,181 @@ further details. `-V, --version` : Print version number. If no other arguments are given, this will - also cause prun to exit. + also cause `prun` to exit. `-N ` -: - Launch num processes per node on all allocated nodes (synonym for - npernode). +: Launch num processes per node on all allocated nodes (synonym for + `--map-by ppr::node`). -`-display-map, --display-map` +`--display-map` : Display a table showing the mapped location of each process prior to launch. -`-display-allocation, --display-allocation` - -: Display the detected resource allocation. - -`-output-proctable, --output-proctable` - -: Output the debugger proctable after launch. - -`-max-vm-size, --max-vm-size ` - -: Number of processes to run. +`--display-allocation` -`-novm, --novm` +: Display the detected allocation of resources (e.g., nodes, slots) -: Execute without creating an allocation-spanning virtual machine - (only start daemons on nodes hosting application procs). +`--output-proctable ` -`-hnp, --hnp ` +: Output the debugger proctable after launch. If `` is `-` then display + to `stdout`. If `` is `+` then display to `stderr`. If `` is + anything else then it is assumed to be a filename into which the proctable + will be written. -: Specify the URI of the psrvr process, or the name of the file - (specified as file:filename) that contains that info. +## Hostfile Options Use one of the following options to specify which hosts (nodes) within -the psrvr to run on. +the PRRTE DVM environment to run on. -`-H, -host, --host ` +`-H, --host ` : List of hosts on which to invoke processes. -`-hostfile, --hostfile ` +`--hostfile ` : Provide a hostfile to use. -`-default-hostfile, --default-hostfile ` +`--default-hostfile ` : Provide a default hostfile. -`-machinefile, --machinefile ` +`--machinefile ` -: Synonym for `-hostfile`. +: Synonym for `--hostfile`. -`-cpu-set, --cpu-set ` - -: Restrict launched processes to the specified logical cpus on each - node (comma-separated list). Note that the binding options will - still apply within the specified envelope - e.g., you can elect to - bind each process to only one cpu within the specified cpu set. +## Process Mapping / Ranking / Binding Options The following options specify the number of processes to launch. Note that none of the options imply a particular binding policy - e.g., -requesting N processes for each socket does not imply that the processes -will be bound to the socket. +requesting `N` processes for each package (formally known as "socket") does not +imply that the processes will be bound to the package. -`-c, -n, --n, -np <#>` +`-c, -n, --n, --np <#>` : Run this many copies of the program on the given nodes. This option indicates that the specified file is an executable program and not an application context. If no value is provided for the number of - copies to execute (i.e., neither the "-np" nor its synonyms are - provided on the command line), prun will automatically execute a + copies to execute (i.e., neither the `-np` nor its synonyms are + provided on the command line), `prun` will automatically execute a copy of the program on each process slot (see below for description of a "process slot"). This feature, however, can only be used in the SPMD model and will return an error (without beginning execution of the application) otherwise. -`-map-by,----map-by ppr:N:` - -: Launch N times the number of objects of the specified type on each - node. - -`-npersocket, --npersocket <#persocket>` - -: On each node, launch this many processes times the number of - processor sockets on the node. The `-npersocket` option also turns - on the `-bind-to-socket` option. (deprecated in favor of --map-by - ppr:n:socket) - -`-npernode, --npernode <#pernode>` - -: On each node, launch this many processes. (deprecated in favor of - --map-by ppr:n:node) - -`-pernode, --pernode` - -: On each node, launch one process -- equivalent to `-npernode` 1. - (deprecated in favor of --map-by ppr:1:node) - -To map processes: - -`-map-by,--map-by ` - -: Map to the specified object, defaults to `socket`. Supported options - include `slot`, `hwthread`, `core`, `L1cache`, `L2cache`, `L3cache`, - `socket`, `numa`, `board`, `node`, `sequential`, `distance`, and - `ppr`. Any object can include modifiers by adding a : and any - combination of PE=n (bind n processing elements to each proc), SPAN - (load balance the processes across the allocation), OVERSUBSCRIBE - (allow more processes on a node than processing elements), and - NOOVERSUBSCRIBE. This includes PPR, where the pattern would be - terminated by another colon to separate it from the modifiers. - -`-bycore, --bycore` - -: Map processes by core (deprecated in favor of --map-by core) - -`-byslot, --byslot` - -: Map and rank processes round-robin by slot. - -`-nolocal, --nolocal` - -: Do not run any copies of the launched application on the same node - as prun is running. This option will override listing the localhost - with `--host` or any other host-specifying mechanism. - -`-nooversubscribe, --nooversubscribe` - -: Do not oversubscribe any nodes; error (without starting any - processes) if the requested number of processes would cause - oversubscription. This option implicitly sets "max_slots" equal - to the "slots" value for each node. (Enabled by default). - -`-oversubscribe, --oversubscribe` - -: Nodes are allowed to be oversubscribed, even on a managed system, - and overloading of processing elements. - -`-bynode, --bynode` - -: Launch processes one per node, cycling by node in a round-robin - fashion. This spreads processes evenly among nodes and assigns ranks - in a round-robin, "by node" manner. +To map processes across sets of objects: -`-cpu-list, --cpu-list ` +`--map-by ` -: List of processor IDs to bind processes to [default=NULL]. +: Map to the specified object. See defaults in Quick Summary. Supported + options include `slot`, `hwthread`, `core`, `L1cache`, `L2cache`, `L3cache`, + `package`, `node`, `seq`, `dist`, and `ppr`. Any object can include modifiers + by adding a : and any combination of `PE=n` (bind n processing elements to + each process), `SPAN` (load balance the processes across the allocation), + `OVERSUBSCRIBE` (allow more processes on a node than processing elements), + `NOOVERSUBSCRIBE` (`!OVERSUBSCRIBE`), `NOLOCAL` (do not launch processes on + the same node as `prun`), `HWTCPUS` (use hardware threads as cpu slots), + `CORECPUS` (use cores as cpu slots), `DEVICE` (for `dist` policy), + `INHERIT` (??), `NOINHERIT` (`!INHERIT`), `PE-LIST=a,b` (comma-delimited + ranges of cpus to use for this job). + `ppr` policy example: `--map-by ppr:N:` will launch `N` times the + number of objects of the specified type on each node. To order processes' ranks: -`--rank-by ` +`--rank-by ` -: Rank in round-robin fashion according to the specified object, - defaults to `slot`. Supported options include slot, hwthread, core, - L1cache, L2cache, L3cache, socket, numa, board, and node. +: Rank in round-robin fashion according to the specified object. See defaults + in Quick Summary. + Supported options include `slot`, `hwthread`, `core`, `L1cache`, `L2cache`, + `L3cache`, `package`, and `node`. Any object can include modifiers by adding + either `:SPAN` (??) or `:FILL` (??). -For process binding: +To bind processes to sets of objects: -`--bind-to ` +`--bind-to ` -: Bind processes to the specified object, defaults to `core`. - Supported options include slot, hwthread, core, l1cache, l2cache, - l3cache, socket, numa, board, and none. - -`-cpus-per-proc, --cpus-per-proc <#perproc>` - -: Bind each process to the specified number of cpus. (deprecated in - favor of --map-by :PE=n) - -`-cpus-per-rank, --cpus-per-rank <#perrank>` - -: Alias for `-cpus-per-proc`. (deprecated in favor of --map-by - :PE=n) - -`-bind-to-core, --bind-to-core` - -: Bind processes to cores (deprecated in favor of --bind-to core) - -`-bind-to-socket, --bind-to-socket` +: Bind processes to the specified object. See defaults in Quick Summary. + Supported options include `none`, `slot`, `hwthread`, `core`, `l1cache`, + `l2cache`, `l3cache`, and `package`. Any object can include modifiers + by adding a : and any combination of `overload-allowed` (if overloading + of this object is allowed), and `if-supported` (if that object is + supported on this system). -: Bind processes to processor sockets (deprecated in favor of - --bind-to socket) +`--report-bindings` -`-report-bindings, --report-bindings` +: Report bindings for launched processes to `stderr`. -: Report any bindings for launched processes. -For rankfiles: - -`-rf, --rankfile ` - -: Provide a rankfile file. +## IO Handling Options To manage standard I/O: -`-output-filename, --output-filename ` +`--output-filename ` : Redirect the stdout, stderr, and stddiag of all processes to a - process-unique version of the specified filename. Any directories in - the filename will automatically be created. Each output file will - consist of filename.id, where the id will be the processes' rank, - left-filled with zero's for correct ordering in listings.B oth + process-unique version of the specified filename ("filename.id"). Any + directories in the filename will automatically be created. Each output + file will consist of "filename.id", where the "id" will be the processes' + rank, left-filled with zero's for correct ordering in listings. Both stdout and stderr will be redirected to the file. A relative path - value will be converted to an absolute path based on the cwd where - prun is executed. Note that this *will not* work on environments - where the file system on compute nodes differs from that where prun - is executed. This option accepts one case-insensitive directive, - specified after a colon: NOCOPY indicates that the output is not to + value will be converted to an absolute path based on the current working + directory where `prun` is executed. Note that this *will not* work in + environments where the file system on compute nodes differs from that + where `prun` is executed. This option accepts one case-insensitive directive, + specified after a colon : `NOCOPY` indicates that the output is not to be echoed to the terminal. -`-output-directory, --output-directory ` +`--output-directory ` : Redirect the stdout, stderr, and stddiag of all processes to a - process-unique location consisting of - "//rank.id/stdout[err]", where the id will be - the processes' rank, left-filled with zero's for correct ordering - in listings. Any directories in the filename will automatically be - created. A relative path value will be converted to an absolute path - based on the cwd where prun is executed. Note that this *will not* - work on environments where the file system on compute nodes differs - from that where prun is executed. This option also supports two - case-insensitive directives, specified in comma-delimited form after - a colon: NOJOBID (omits the jobid directory layer) and NOCOPY (do - not copy the output to the terminal). - -`-stdin, --stdin ` + process-unique location consisting of "//id/std[out,err,diag]", + where the "id" will be the processes' rank, left-filled with zero's for + correct ordering in listings. Any directories in the filename will + automatically be created. A relative path value will be converted to an + absolute path based on the current working directory where `prun` is + executed. Note that this *will not* work in environments where the file + system on compute nodes differs from that where `prun` is executed. This + option also supports two case-insensitive directives, specified in + comma-delimited form after a colon : `NOJOBID` (omits the jobid directory + layer) and `NOCOPY` (output is not to be echoed to the terminal). + +`--stdin ` : The rank of the process that is to receive stdin. The default is to forward stdin to rank 0, but this option can be used to forward - stdin to any process. It is also acceptable to specify `none`, - indicating that no processes are to receive stdin. + stdin to any process. It is also acceptable to specify any one of the + following keywords: `none` (indicating that no processes are to receive + stdin), and `all` (indicating that all processes are to receive stdin). -`-merge-stderr-to-stdout, --merge-stderr-to-stdout` +`--merge-stderr-to-stdout` : Merge stderr to stdout for each process. -`-tag-output, --tag-output` +`--tag-output` : Tag each line of output to stdout, stderr, and stddiag with - `[jobid, MCW_rank]` indicating the process jobid and - rank of the process that generated the output, and the channel which - generated it. + `[jobid,rank]` indicating the jobid and rank of the process that + generated the output, and the channel which generated it. -`-timestamp-output, --timestamp-output` +`--timestamp-output` : Timestamp each line of output to stdout, stderr, and stddiag. -`-xml, --xml` +`--xml` -: Provide all output to stdout, stderr, and stddiag in an xml format. +: Provide all output to stdout, stderr, and stddiag in an XML format. -`-xml-file, --xml-file ` -: Provide all output in XML format to the specified file. - -`-xterm, --xterm ` +`--xterm ` : Display the output from the processes identified by their ranks in separate xterm windows. The ranks are specified as a comma-separated - list of ranges, with a -1 indicating all. A separate window will be + list of ranges, with a `-1` indicating all. A separate window will be created for each specified process. **Note:** xterm will normally terminate the window upon termination of the process running within - it. However, by adding a "!" to the end of the list of specified + it. However, by adding a `!` to the end of the list of specified ranks, the proper options will be provided to ensure that xterm keeps the window open *after* the process terminates, thus allowing you to see the process' output. Each xterm window will subsequently @@ -378,16 +296,32 @@ To manage standard I/O: may require that the executable be in the user's path, or be specified in absolute or relative terms. Thus, it may be necessary to specify a local executable as "./foo" instead of just "foo". - If xterm fails to find the executable, prun will hang, but still + If xterm fails to find the executable, `prun` will hang, but still respond correctly to a ctrl-c. If this happens, please check that the executable is being specified correctly and try again. +`--parsable` + +: When used in conjunction with other parameters, the output is displayed + in a machine-parsable format + +`--parseable` + +: Synonym for `--parsable` + +`--prte_info_pretty` + +: When used in conjunction with other parameters, the output is displayed + in `prte_info_prettyprint` format (default) + +## File Management Options + To manage files and runtime environment: -`-path, --path ` +`--path ` -: that will be used when attempting to locate the requested - executables. This is used prior to using the local PATH setting. +: `` that will be used when attempting to locate the requested + executables. This is used prior to using the local `PATH` setting. `--prefix ` @@ -397,11 +331,11 @@ To manage files and runtime environment: `--noprefix` -: Disable the automatic --prefix behavior +: Disable the automatic `--prefix` behavior `-s, --preload-binary` -: Copy the specified executable(s) to remote machines prior to +: Copy the application executable(s) to remote machines prior to starting remote processes. The executables will be copied to the session directory and will be deleted upon completion of the job. @@ -411,65 +345,88 @@ To manage files and runtime environment: directory of the remote machines where processes will be launched prior to starting those processes. -`-set-cwd-to-session-dir, --set-cwd-to-session-dir` +`--set-cwd-to-session-dir` : Set the working directory of the started processes to their session directory. -`-wd ` - -: Synonym for `-wdir`. - `-wdir ` -: Change to the directory before the user's program executes. +: Change to the directory `` before the user's program executes. See the "Current Working Directory" section for notes on relative paths. **Note:** If the `-wdir` option appears both on the command line and in an application context, the context will take precedence - over the command line. Thus, if the path to the desired wdir is + over the command line. Thus, if the path to the desired `` is different on the backend nodes, then it must be specified as an absolute path that is correct for the backend node. +`-wd ` + +: Synonym for `-wdir`. + + `-x ` -: Export the specified environment variables to the remote nodes +: Export the specified environment variable to the remote nodes before executing the program. Only one environment variable can be specified per `-x` option. Existing environment variables can be specified or new variable names specified with corresponding values. - For example: `$ prun -x DISPLAY -x OFILE=/tmp/out ...` + Further, an asterisk (with proper shell escaping) can be used to export + all current environment variables starting with the value. + For example: `$ prun -x DISPLAY -x OFILE=/tmp/out -x foo\* ...` The parser for the `-x` option is not very sophisticated; it does not even understand quoted values. Users are advised to set variables in the environment, and then use `-x` to export (not define) them. -Setting MCA parameters: +## MCA Options + +Setting MCA parameters take a few different forms depending the target +project for the parameter. For example, MCA parameters targeting OpenPMIx +will contain the string `pmix` in their name, and MCA parameters targeting +PRRTE will contain the string `prte` in their name. See the "MCA" section, +below, for finer details on the MCA. + +`--gmca ` + +: Pass global MCA parameters for the current personality that are applicable + to all contexts. + `` is the parameter name; `` is the parameter value. -`-gpmca, --gpmca ` +`--gpmixmca ` -: Pass global MCA parameters that are applicable to all contexts. +: Pass global MCA parameters for OpenPMIx that are applicable to all contexts. `` is the parameter name; `` is the parameter value. -`-pmca, --pmca ` +`--gprtemca ` -: Send arguments to various MCA modules. See the "MCA" section, - below. +: Pass global MCA parameters for PRRTE that are applicable to all contexts. + `` is the parameter name; `` is the parameter value. -`-am ` +`--mca ` -: Aggregate MCA parameter set file list. +: Send arguments to various MCA modules in the current personality. These + parameters are considered global if `--gmca` is not used and only one + application context is specified. + `` is the parameter name; `` is the parameter value. -`-tune, --tune ` +`--pmixmca ` -: Specify a tune file to set arguments for various MCA modules and - environment variables. See the "Setting MCA parameters and - environment variables from file" section, below. +: Send arguments to various MCA modules in OpenPMIx. These parameters are + considered global if `--gpmixmca` is not used and only one application context + is specified. + `` is the parameter name; `` is the parameter value. -For debugging: +`--prtemca ` -`-debug, --debug` +: Send arguments to various MCA modules in PRRTE. These parameters are + considered global if `--gprtemca` is not used and only one application context + is specified. + `` is the parameter name; `` is the parameter value. + +## Debugging Options -: Invoke the user-level debugger indicated by the - `prte_base_user_debugger` MCA parameter. +For debugging: `--get-stack-traces` @@ -479,22 +436,35 @@ For debugging: take a little time and produce a lot of output, especially for large process-count jobs. -`-debugger, --debugger ` - -: Sequence of debuggers to search for when `--debug` is used (i.e. a - synonym for `prte_base_user_debugger` MCA parameter). - `--timeout ` : The maximum number of seconds that `prun` will run. After this many seconds, `prun` will abort the launched job and exit with a non-zero - exit status. Using `--timeout` can be also useful when combined - with the `--get-stack-traces` option. + exit status. Using `--timeout` can be useful when combined with the + `--get-stack-traces` option. + +## Fault Tolerance Options + +These are fault tolerance options: + +`--continuous` -`-tv, --tv` +: Job is to run until explicitly terminated. + +`--enable-recovery` + +: Enable recovery from process failure [Default = disabled]. -: Launch processes under the TotalView debugger. Deprecated backwards - compatibility flag. Synonym for `--debug`. +`--disable-recovery` + +: Disable recovery (resets all recovery options to off). + +`--max-restarts ` + +: Maximum number of times to restart a failed process. + + +## Other Options There are also other options: @@ -507,103 +477,108 @@ There are also other options: : Provide an appfile, ignoring all other command line options. -`-cf, --cartofile ` +`--do-not-launch` -: Provide a cartography file. +: Perform all necessary operations to prepare to launch the + application, but do not actually launch it. This can be helpful when + testing mapping patterns. -`-continuous, --continuous` +`--do-not-resolve` -: Job is to run until explicitly terminated. +: Do not attempt to resolve interfaces. This can be helpful when determining + proposed process mapping and binding prior to obtaining an allocation. -`-disable-recovery, --disable-recovery` +`--index-argv-by-rank` -: Disable recovery (resets all recovery options to off). +: Uniquely index `argv[0]` for each process using its rank. -`-do-not-launch, --do-not-launch` +`--report-child-jobs-separately` -: Perform all necessary operations to prepare to launch the - application, but do not actually launch it. +: Return the exit status of the primary job only. -`-do-not-resolve, --do-not-resolve` +`--show-progress` -: Do not attempt to resolve interfaces. +: Output a brief periodic report on launch progress. -`-enable-recovery, --enable-recovery` +`--terminate` -: Enable recovery from process failure [Default = disabled]. +: Terminate the DVM. See pterm(1). -`-index-argv-by-rank, --index-argv-by-rank` +`--stop-on-exec` -: Uniquely index argv[0] for each process using its rank. +: If supported, stop each process at start of execution. -`-max-restarts, --max-restarts ` +`--personality ` -: Max number of times to restart a failed process. +: Comma-separated list of programming model, languages, and containers + being used (default="prte"). See `prte_info | grep schizo` for a list + of available personalities on your machine. -`--ppr ` +`--pset ` -: Comma-separated list of number of processes on a given resource type - [default: none]. (deprecated in favor of --map-by ppr:) +: User-specified name assigned to the processes in their given application -`-report-child-jobs-separately, --report-child-jobs-separately` +`--do-not-connect` -: Return the exit status of the primary job only. +: Do not connect to a server -`-report-events, --report-events ` +`--dvm-uri ` -: Report events to a tool listening at the specified URI. +: Specify the URI of the DVM master, or the name of the file (specified as + `file:`) that contains that information. -`-report-pid, --report-pid ` +`--forward-signals ` -: Print out prun's PID during startup. The channel must be either a - '-' to indicate that the pid is to be output to stdout, a '+' to - indicate that the pid is to be output to stderr, or a filename to - which the pid is to be written. +: Comma-delimited list of additional signals (names or integers) to forward + to application processes. The keyword `none` indicates that no signals should + be forwarded. Signals provided by default include SIGTSTP, SIGUSR1, SIGUSR2, + SIGABRT, SIGALRM, and SIGCONT. -`-report-uri, --report-uri ` +`--namespace ` -: Print out prun's URI during startup. The channel must be either a - '-' to indicate that the URI is to be output to stdout, a '+' to - indicate that the URI is to be output to stderr, or a filename to - which the URI is to be written. +: Namespace of the DVM daemon to which we should connect. -`-show-progress, --show-progress` +`--num-connect-retries` -: Output a brief periodic report on launch progress. +: Maximum number of times to try to connect -`-terminate, --terminate` +`--pid ` -: Terminate the DVM. +: PID of the DVM daemon to which we should connect -`-use-hwthread-cpus, --use-hwthread-cpus` +`--system-server-first` -: Use hardware threads as independent cpus. +: First look for a system server and connect to it if found. -`-use-regexp, --use-regexp` +`--system-server-only` -: Use regular expressions for launch. +: Connect only to a system-level server -The following options are useful for developers; they are not generally -useful to most users: +`--tmpdir ` -`-d, --debug-devel` +: Set the root directory for the session directory tree to `` -: Enable debugging. This is not generally useful for most users. +`--wait-to-connect` -`-display-devel-allocation, --display-devel-allocation` +: Delay specified number of seconds before trying to connect + +The following options are useful for developers; they are not generally +useful to most users: + +`--display-devel-allocation` : Display a detailed list of the allocation being used by this job. -`-display-devel-map, --display-devel-map` +`--display-devel-map` : Display a more detailed table showing the mapped location of each process prior to launch. -`-display-diffable-map, --display-diffable-map` +`--display-diffable-map` : Display a diffable process map just before launch. -`-display-topo, --display-topo` +`--display-topo` : Display the topology as part of the process map just before launch. @@ -612,11 +587,91 @@ useful to most users: : When paired with the `--timeout` command line option, report the run-time subsystem state of each process when the timeout expires. + There may be other options listed with `prun --help`. +## Deprecated Options + +These deprecated options will be removed in a future release. + +`--bycore` + +: **(Deprecated: Use `--map-by core`)** + Map processes by core + +`--byslot` + +: **(Deprecated: Use `--map-by slot`)** + Map and rank processes round-robin by slot. + +`-bynode, --bynode` + +: **(Deprecated: Use `--map-by node`)** + Launch processes one per node, cycling by node in a round-robin + fashion. This spreads processes evenly among nodes and assigns ranks + in a round-robin, "by node" manner. + +`--npersocket <#persocket>` + +: **(Deprecated: Use `--map-by ppr:<#perpackage>:package`)** + On each node, launch this many processes times the number of + processor sockets on the node. The `--npersocket` option also turns + on the `--bind-to socket` option. + +`--npernode <#pernode>` + +: **(Deprecated: Use `--map-by ppr:<#pernode>:node`)** + On each node, launch this many processes. + +`--pernode` + +: **(Deprecated: Use `--map-by ppr:1:node`)** + On each node, launch one process. + +`--nolocal` + +: **(Deprecated: Use `--map-by :NOLOCAL`)** + Do not run any copies of the launched application on the same node + as `prun` is running. This option will override listing the `localhost` + with `--host` or any other host-specifying mechanism. + +`--nooversubscribe` + +: **(Deprecated: Use `--map-by :NOOVERSUBSCRIBE`)** + Do not oversubscribe any nodes; error (without starting any + processes) if the requested number of processes would cause + oversubscription. This option implicitly sets "max_slots" equal + to the "slots" value for each node. (Enabled by default). + +`--oversubscribe` + +: **(Deprecated: Use `--map-by :OVERSUBSCRIBE`)** + Nodes are allowed to be oversubscribed, even on a managed system, + and overloading of processing elements. + +`--cpus-per-proc <#perproc>` + +: **(Deprecated: Use `--map-by :PE=<#perproc>`)** + Bind each process to the specified number of cpus. + +`--cpus-per-rank <#perrank>` + +: **(Deprecated: Use `--map-by :PE=<#perrank>`)** + Alias for `--cpus-per-proc`. + +`--bind-to-core` + +: **(Deprecated: Use `--bind-to core`)** + Bind processes to cores + +`-bind-to-socket, --bind-to-socket` + +: **(Deprecated: Use `--bind-to package`)** + Bind processes to processor sockets + # DESCRIPTION -One invocation of `prun` starts an application running under PSRVR. If +One invocation of `prun` starts an application running under the PRRTE DVM. If the application is single process multiple data (SPMD), the application can be specified on the `prun` command line. @@ -634,57 +689,62 @@ another reason to use an application context. Extended command line arguments allow for the description of the application layout on the command line using colons (`:`) to separate the specification of programs and arguments. Some options are globally -set across all specified programs (e.g. --hostfile), while others are -specific to a single program (e.g. -np). +set across all specified programs (e.g. `--hostfile`), while others are +specific to a single program (e.g. `--np`). ## Specifying Host Nodes -Host nodes can be identified on the `prun` command line with the `-host` +Host nodes can be identified on the `prun` command line with the `--host` option or in a hostfile. -For example, +For example, the following `prun` launches two processes on node `aa` and one +on node `bb`. -prun -H aa,aa,bb ./a.out - -: launches two processes on node aa and one on bb. +``` +$ prun -H aa,aa,bb ./a.out +``` Or, consider the hostfile ``` -$ cat myhostfile aa slots=2 bb slots=2 cc slots=2 +$ cat myhostfile +aa slots=2 +bb slots=2 +cc slots=2 ``` -Here, we list both the host names (aa, bb, and cc) but also how many +Here, we list both the host names (`aa`, `bb`, and `cc`) but also how many "slots" there are for each. Slots indicate how many processes can potentially execute on a node. For best performance, the number of slots may be chosen to be the number of cores on the node or the number of -processor sockets. If the hostfile does not provide slots information, -PSRVR will attempt to discover the number of cores (or hwthreads, if the -use-hwthreads-as-cpus option is set) and set the number of slots to that -value. This default behavior also occurs when specifying the `-host` +processor sockets. If the hostfile does not provide slots information, the +PRRTE DVM will attempt to discover the number of cores (or hwthreads, if the +`--map-by` option `HWTCPUS` is set) and set the number of slots to that +value. This default behavior also occurs when specifying the `--host` option with a single hostname. Thus, the command -prun -H aa ./a.out +`prun -H aa ./a.out` : launches a number of processes equal to the number of cores on node - aa. + `aa`. + +`prun --hostfile myhostfile ./a.out` -prun -hostfile myhostfile ./a.out +: will launch two processes on each of the three nodes in the hostfile. -: will launch two processes on each of the three nodes. +`prun --hostfile myhostfile --host aa ./a.out` -prun -hostfile myhostfile -host aa ./a.out +: will launch two processes, both on node `aa`. -: will launch two processes, both on node aa. +`prun --hostfile myhostfile --host dd ./a.out` -prun -hostfile myhostfile -host dd ./a.out +: will find no hosts to run on and abort with an error. That is because the + specified host `dd` is not in the specified hostfile. -: will find no hosts to run on and abort with an error. That is, the - specified host dd is not in the specified hostfile. +When running under resource managers (e.g., SLURM, Torque, LSF, etc.), the +PRRTE DVM will obtain both the hostnames and the number of slots directly from +the resource manager. -When running under resource managers (e.g., SLURM, Torque, etc.), PSRVR -will obtain both the hostnames and the number of slots directly from the -resource manger. ## Specifying Number of Processes @@ -694,383 +754,96 @@ the hostfile. Other mechanisms exist. The number of processes launched can be specified as a multiple of the number of nodes or processor sockets available. For example, -prun -H aa,bb -npersocket 2 ./a.out +`prun -H aa,bb --map-by ppr:2:package ./a.out` -: launches processes 0-3 on node aa and process 4-7 on node bb, where - aa and bb are both dual-socket nodes. The `-npersocket` option also - turns on the `-bind-to-socket` option, which is discussed in a later - section. +: launches processes 0-3 on node `aa` and process 4-7 on node `bb`, where + `aa` and `bb` are both dual-socket nodes. The `--map-by ppr:2:package` + option also turns on the `--bind-to package` option, which is discussed + in a later section. -prun -H aa,bb -npernode 2 ./a.out +`prun -H aa,bb --map-by ppr:2:node ./a.out` -: launches processes 0-1 on node aa and processes 2-3 on node bb. +: launches processes 0-1 on node `aa` and processes 2-3 on node `bb`. -prun -H aa,bb -npernode 1 ./a.out +`prun -H aa,bb --map-by ppr:1:node ./a.out` : launches one process per host node. -prun -H aa,bb -pernode ./a.out -: is the same as `-npernode` 1. - -Another alternative is to specify the number of processes with the `-np` +Another alternative is to specify the number of processes with the `--np` option. Consider now the hostfile ``` -$ cat myhostfile aa slots=4 bb slots=4 cc slots=4 +$ cat myhostfile +aa slots=4 +bb slots=4 +cc slots=4 ``` Now, -`prun -hostfile myhostfile -np 6 ./a.out` +`prun --hostfile myhostfile --np 6 ./a.out` -: will launch processes 0-3 on node aa and processes 4-5 on node bb. - The remaining slots in the hostfile will not be used since the `-np` +: will launch processes 0-3 on node `aa` and processes 4-5 on node `bb`. + The remaining slots in the hostfile will not be used since the `--np` option indicated that only 6 processes should be launched. -## Mapping Processes to Nodes: Using Policies - -The examples above illustrate the default mapping of process processes -to nodes. This mapping can also be controlled with various `prun` -options that describe mapping policies. - -Consider the same hostfile as above, again with `-np` 6: - -node aa node bb node cc - -prun 0 1 2 3 4 5 - -prun --map-by node 0 3 1 4 2 5 - -prun -nolocal 0 1 2 3 4 5 - -The `--map-by node` option will load balance the processes across the -available nodes, numbering each process in a round-robin fashion. - -The `-nolocal` option prevents any processes from being mapped onto the -local host (in this case node aa). While `prun` typically consumes few -system resources, `-nolocal` can be helpful for launching very large -jobs where `prun` may actually need to use noticeable amounts of memory -and/or processing time. - -Just as `-np` can specify fewer processes than there are slots, it can -also oversubscribe the slots. For example, with the same hostfile: - -prun -hostfile myhostfile -np 14 ./a.out - -: will launch processes 0-3 on node aa, 4-7 on bb, and 8-11 on cc. It - will then add the remaining two processes to whichever nodes it - chooses. - -One can also specify limits to oversubscription. For example, with the -same hostfile: - -prun -hostfile myhostfile -np 14 -nooversubscribe ./a.out - -: will produce an error since `-nooversubscribe` prevents - oversubscription. - -Limits to oversubscription can also be specified in the hostfile itself: -% cat myhostfile aa slots=4 max_slots=4 bb max_slots=4 cc slots=4 - -The `max_slots` field specifies such a limit. When it does, the `slots` -value defaults to the limit. Now: - -prun -hostfile myhostfile -np 14 ./a.out - -: causes the first 12 processes to be launched as before, but the - remaining two processes will be forced onto node cc. The other two - nodes are protected by the hostfile against oversubscription by this - job. - -Using the `--nooversubscribe` option can be helpful since PSRVR -currently does not get "max_slots" values from the resource manager. - -Of course, `-np` can also be used with the `-H` or `-host` option. For -example, - -prun -H aa,bb -np 8 ./a.out - -: launches 8 processes. Since only two hosts are specified, after the - first two processes are mapped, one to aa and one to bb, the - remaining processes oversubscribe the specified hosts. - -And here is a MIMD example: - -prun -H aa -np 1 hostname : -H bb,cc -np 2 uptime - -: will launch process 0 running `hostname` on node aa and processes 1 - and 2 each running `uptime` on nodes bb and cc, respectively. - -## Mapping, Ranking, and Binding: Oh My! - -PSRVR employs a three-phase procedure for assigning process locations -and ranks: - -**Mapping** - -: Assigns a default location to each process - -**Ranking** - -: Assigns a rank value to each process - -**Binding** - -: Constrains each process to run on specific processors - -The *mapping* step is used to assign a default location to each process -based on the mapper being employed. Mapping by slot, node, and -sequentially results in the assignment of the processes to the node -level. In contrast, mapping by object, allows the mapper to assign the -process to an actual object on each node. +## Mapping , Ranking, and Binding Processes to Nodes -**Note:** the location assigned to the process is independent of where -it will be bound - the assignment is used solely as input to the binding -algorithm. - -The mapping of process processes to nodes can be defined not just with -general policies but also, if necessary, using arbitrary mappings that -cannot be described by a simple policy. One can use the "sequential -mapper," which reads the hostfile line by line, assigning processes to -nodes in whatever order the hostfile specifies. Use the `-pmca rmaps -seq` option. For example, using the same hostfile as before: - -prun -hostfile myhostfile -pmca rmaps seq ./a.out - -will launch three processes, one on each of nodes aa, bb, and cc, -respectively. The slot counts don't matter; one process is launched per -line on whatever node is listed on the line. - -Another way to specify arbitrary mappings is with a rankfile, which -gives you detailed control over process binding as well. Rankfiles are -discussed below. - -The second phase focuses on the *ranking* of the process within the job. -PSRVR separates this from the mapping procedure to allow more -flexibility in the relative placement of processes. This is best -illustrated by considering the following two cases where we used the ----map-by ppr:2:socket option: - -node aa node bb - -rank-by core 0 1 ! 2 3 4 5 ! 6 7 - -rank-by socket 0 2 ! 1 3 4 6 ! 5 7 - -rank-by socket:span 0 4 ! 1 5 2 6 ! 3 7 - -Ranking by core and by slot provide the identical result - a simple -progression of ranks across each node. Ranking by socket does a -round-robin ranking within each node until all processes have been -assigned a rank, and then progresses to the next node. Adding the `span` -modifier to the ranking directive causes the ranking algorithm to treat -the entire allocation as a single entity - thus, the MCW ranks are -assigned across all sockets before circling back around to the -beginning. - -The *binding* phase actually binds each process to a given set of -processors. This can improve performance if the operating system is -placing processes suboptimally. For example, it might oversubscribe some -multi-core processor sockets, leaving other sockets idle; this can lead -processes to contend unnecessarily for common resources. Or, it might -spread processes out too widely; this can be suboptimal if application -performance is sensitive to interprocess communication costs. Binding -can also keep the operating system from migrating processes excessively, -regardless of how optimally those processes were placed to begin with. - -The processors to be used for binding can be identified in terms of -topological groupings - e.g., binding to an l3cache will bind each -process to all processors within the scope of a single L3 cache within -their assigned location. Thus, if a process is assigned by the mapper to -a certain socket, then a `---bind-to l3cache` directive will cause the -process to be bound to the processors that share a single L3 cache -within that socket. - -To help balance loads, the binding directive uses a round-robin method -when binding to levels lower than used in the mapper. For example, -consider the case where a job is mapped to the socket level, and then -bound to core. Each socket will have multiple cores, so if multiple -processes are mapped to a given socket, the binding algorithm will -assign each process located to a socket to a unique core in a -round-robin manner. - -Alternatively, processes mapped by l2cache and then bound to socket will -simply be bound to all the processors in the socket where they are -located. In this manner, users can exert detailed control over relative -MCW rank location and binding. - -Finally, `--report-bindings` can be used to report bindings. - -As an example, consider a node with two processor sockets, each -comprising four cores. We run `prun` with `-np 4 --report-bindings` and -the following additional options: - -``` -% prun ... --map-by core --bind-to core [...] ... binding child -[...,0] to cpus 0001 [...] ... binding child [...,1] to cpus -0002 [...] ... binding child [...,2] to cpus 0004 [...] ... -binding child [...,3] to cpus 0008 -``` - -``` -% prun ... --map-by socket --bind-to socket [...] ... binding -child [...,0] to socket 0 cpus 000f [...] ... binding child -[...,1] to socket 1 cpus 00f0 [...] ... binding child [...,2] -to socket 0 cpus 000f [...] ... binding child [...,3] to socket 1 -cpus 00f0 -``` - -``` -% prun ... --map-by core:PE=2 --bind-to core [...] ... binding -child [...,0] to cpus 0003 [...] ... binding child [...,1] to -cpus 000c [...] ... binding child [...,2] to cpus 0030 [...] -... binding child [...,3] to cpus 00c0 -``` - -``` -% prun ... --bind-to none -``` - -Here, `--report-bindings` shows the binding of each process as a mask. -In the first case, the processes bind to successive cores as indicated -by the masks 0001, 0002, 0004, and 0008. In the second case, processes -bind to all cores on successive sockets as indicated by the masks 000f -and 00f0. The processes cycle through the processor sockets in a -round-robin fashion as many times as are needed. In the third case, the -masks show us that 2 cores have been bound per process. In the fourth -case, binding is turned off and no bindings are reported. - -PSRVR's support for process binding depends on the underlying operating -system. Therefore, certain process binding options may not be available -on every system. - -Process binding can also be set with MCA parameters. Their usage is less -convenient than that of `prun` options. On the other hand, MCA -parameters can be set not only on the `prun` command line, but -alternatively in a system or user mca-params.conf file or as environment -variables, as described in the MCA section below. Some examples include: - -prun option MCA parameter key value - ---map-by core rmaps_base_mapping_policy core --map-by socket -rmaps_base_mapping_policy socket --rank-by core -rmaps_base_ranking_policy core --bind-to core -hwloc_base_binding_policy core --bind-to socket -hwloc_base_binding_policy socket --bind-to none -hwloc_base_binding_policy none - -## Rankfiles - -Rankfiles are text files that specify detailed information about how -individual processes should be mapped to nodes, and to which -processor(s) they should be bound. Each line of a rankfile specifies the -location of one process. The general form of each line in the rankfile -is: - -rank = slot= - -For example: - -$ cat myrankfile rank 0=aa slot=1:0-2 rank 1=bb slot=0:0,1 rank 2=cc -slot=1-2 $ prun -H aa,bb,cc,dd -rf myrankfile ./a.out - -Means that - -Rank 0 runs on node aa, bound to logical socket 1, cores 0-2. Rank 1 -runs on node bb, bound to logical socket 0, cores 0 and 1. Rank 2 runs -on node cc, bound to logical cores 1 and 2. - -Rankfiles can alternatively be used to specify *physical* processor -locations. In this case, the syntax is somewhat different. Sockets are -no longer recognized, and the slot number given must be the number of -the physical PU as most OS's do not assign a unique physical identifier -to each core in the node. Thus, a proper physical rankfile looks -something like the following: - -$ cat myphysicalrankfile rank 0=aa slot=1 rank 1=bb slot=8 rank 2=cc -slot=6 - -This means that - -Rank 0 will run on node aa, bound to the core that contains physical PU -1 Rank 1 will run on node bb, bound to the core that contains physical -PU 8 Rank 2 will run on node cc, bound to the core that contains -physical PU 6 - -Rankfiles are treated as *logical* by default, and the MCA parameter -rmaps_rank_file_physical must be set to 1 to indicate that the -rankfile is to be considered as *physical*. - -The hostnames listed above are "absolute," meaning that actual -resolveable hostnames are specified. However, hostnames can also be -specified as "relative," meaning that they are specified in relation -to an externally-specified list of hostnames (e.g., by prun's --host -argument, a hostfile, or a job scheduler). - -The "relative" specification is of the form "+n", where X is an -integer specifying the Xth hostname in the set of all available -hostnames, indexed from 0. For example: - -$ cat myrankfile rank 0=+n0 slot=1:0-2 rank 1=+n1 slot=0:0,1 rank 2=+n2 -slot=1-2 $ prun -H aa,bb,cc,dd -rf myrankfile ./a.out - -All socket/core slot locations are be specified as *logical* indexes. -You can use tools such as HWLOC's "lstopo" to find the logical -indexes of socket and cores. +For information about mapping / ranking / binding of processes see the `man 1 prte-map` manual page. ## Application Context or Executable Program? To distinguish the two different forms, `prun` looks on the command line for `--app` option. If it is specified, then the file named on the -command line is assumed to be an application context. If it is not +command line is assumed to be an application context file. If it is not specified, then the file is assumed to be an executable program. ## Locating Files -If no relative or absolute path is specified for a file, prun will first +If no relative or absolute path is specified for a file, `prun` will first look for files by searching the directories specified by the `--path` option. If there is no `--path` option set or if the file is not found -at the `--path` location, then prun will search the user's PATH +at the `--path` location, then `prun` will search the user's PATH environment variable as defined on the source node(s). If a relative directory is specified, it must be relative to the initial working directory determined by the specific starter used. For example -when using the rsh or ssh starters, the initial directory is $HOME by +when using the `rsh` or `ssh` starters, the initial directory is `$HOME` by default. Other starters may set the initial directory to the current working directory from the invocation of `prun`. ## Current Working Directory -The `-wdir` prun option (and its synonym, `-wd`) allows the user to +The `--wdir` option to `prun` (and its synonym, `--wd`) allows the user to change to an arbitrary directory before the program is invoked. It can also be used in application context files to specify working directories on specific nodes and/or for specific applications. -If the `-wdir` option appears both in a context file and on the command +If the `--wdir` option appears both in a context file and on the command line, the context file directory will override the command line value. -If the `-wdir` option is specified, prun will attempt to change to the +If the `--wdir` option is specified, `prun` will attempt to change to the specified directory on all of the remote nodes. If this fails, `prun` will abort. -If the `-wdir` option is **not** specified, prun will send the directory +If the `--wdir` option is **not** specified, `prun` will send the directory name where `prun` was invoked to each of the remote nodes. The remote nodes will try to change to that directory. If they are unable (e.g., if -the directory does not exist on that node), then prun will use the +the directory does not exist on that node), then `prun` will use the default directory determined by the starter. All directory changing occurs before the user's program is invoked. ## Standard I/O -PSRVR directs UNIX standard input to /dev/null on all processes except +The PRRTE DVM directs UNIX standard input to `/dev/null` on all processes except the rank 0 process. The rank 0 process inherits standard input from `prun`. **Note:** The node that invoked `prun` need not be the same as -the node where the rank 0 process resides. PSRVR handles the redirection +the node where the rank 0 process resides. The PRRTE DVM handles the redirection of `prun`'s standard input to the rank 0 process. -PSRVR directs UNIX standard output and error from remote nodes to the +The PRRTE DVM directs UNIX standard output and error from remote nodes to the node that invoked `prun` and prints it on the standard output/error of `prun`. Local processes inherit the standard output/error of `prun` and transfer to it directly. @@ -1079,29 +852,29 @@ Thus it is possible to redirect standard I/O for applications by using the typical shell redirection procedure on `prun`. ``` -$ prun -np 2 my_app < my_input > my_output +$ prun --np 2 my_app < my_input > my_output ``` Note that in this example *only* the rank 0 process will receive the stream from `my_input` on stdin. The stdin on all the other nodes will -be tied to /dev/null. However, the stdout from all nodes will be +be tied to `/dev/null`. However, the stdout from all nodes will be collected into the `my_output` file. ## Signal Propagation -When prun receives a SIGTERM and SIGINT, it will attempt to kill the +When `prun` receives a SIGTERM and SIGINT, it will attempt to kill the entire job by sending all processes in the job a SIGTERM, waiting a small number of seconds, then sending all processes in the job a SIGKILL. -SIGUSR1 and SIGUSR2 signals received by prun are propagated to all +SIGUSR1 and SIGUSR2 signals received by `prun` are propagated to all processes in the job. -A SIGTSTOP signal to prun will cause a SIGSTOP signal to be sent to all -of the programs started by prun and likewise a SIGCONT signal to prun +A SIGTSTOP signal to `prun` will cause a SIGSTOP signal to be sent to all +of the programs started by `prun` and likewise a SIGCONT signal to `prun` will cause a SIGCONT sent. -Other signals are not currently propagated by prun. +Other signals are not propagated by default by `prun`. ## Process Termination / Signal Handling @@ -1112,27 +885,27 @@ application. ## Process Environment -Processes in the application inherit their environment from the PSRVR +Processes in the application inherit their environment from the PRRTE daemon upon the node on which they are running. The environment is typically inherited from the user's shell. On remote nodes, the exact environment is determined by the boot MCA module used. The `rsh` launch -module, for example, uses either `rsh`/`ssh` to launch the PSRVR daemon +module, for example, uses either `rsh`/`ssh` to launch the PRRTE daemon on remote nodes, and typically executes one or more of the user's shell-setup files before launching the daemon. When running dynamically linked applications which require the `LD_LIBRARY_PATH` environment variable to be set, care must be taken to ensure that it is correctly -set when booting PSRVR. +set when booting the PRRTE DVM. See the "Remote Execution" section for more details. ## Remote Execution -PSRVR requires that the `PATH` environment variable be set to find +The PRRTE DVM requires that the `PATH` environment variable be set to find executables on remote nodes (this is typically only necessary in `rsh`- or `ssh`-based environments -- batch/scheduled environments typically copy the current environment to the execution of remote jobs, so if the current environment has `PATH` and/or `LD_LIBRARY_PATH` set properly, -the remote nodes will also have it set properly). If PSRVR was compiled +the remote nodes will also have it set properly). If PRRTE was compiled with shared library support, it may also be necessary to have the `LD_LIBRARY_PATH` environment variable set on remote nodes as well (especially to find the shared libraries required to run user @@ -1143,34 +916,34 @@ files to set `PATH` and/or `LD_LIBRARY_PATH`. The `--prefix` option is provided for some simple configurations where this is not possible. The `--prefix` option takes a single argument: the base directory on -the remote node where PSRVR is installed. PSRVR will use this directory +the remote node where PRRTE is installed. PRRTE will use this directory to set the remote `PATH` and `LD_LIBRARY_PATH` before executing any user applications. This allows running jobs without having pre-configured the `PATH` and `LD_LIBRARY_PATH` on the remote nodes. -PSRVR adds the basename of the current node's "bindir" (the directory -where PSRVR's executables are installed) to the prefix and uses that to -set the `PATH` on the remote node. Similarly, PSRVR adds the basename of -the current node's "libdir" (the directory where PSRVR's libraries +PRRTE adds the basename of the current node's "bindir" (the directory +where PRRTE's executables are installed) to the prefix and uses that to +set the `PATH` on the remote node. Similarly, PRRTE adds the basename of +the current node's "libdir" (the directory where PRRTE's libraries are installed) to the prefix and uses that to set the `LD_LIBRARY_PATH` on the remote node. For example: Local bindir: -: /local/node/directory/bin +: `/local/node/directory/bin` Local libdir: -: /local/node/directory/lib64 +: `/local/node/directory/lib64` If the following command line is used: ``` -$ prun --prefix /remote/node/directory +$ prun --prefix /remote/node/directory ./a.out ``` PSRVR will add "/remote/node/directory/bin" to the `PATH` and -"/remote/node/directory/lib64" to the D_LIBRARY_PATH on the remote +"/remote/node/directory/lib64" to the `LD_LIBRARY_PATH` on the remote node before attempting to execute anything. The `--prefix` option is not sufficient if the installation paths on @@ -1190,12 +963,14 @@ $ /usr/local/bin/prun ... is equivalent to ``` -$ prun --prefix /usr/local +$ prun --prefix /usr/local ... ``` ## Exported Environment Variables -All environment variables that are named in the form PMIX_\* will +(JJH Does this work?) + +All environment variables that are named in the form `PMIX_\*` will automatically be exported to new processes on the local and remote nodes. Environmental parameters can also be set/forwarded to the new processes using the MCA parameter `mca_base_env_list`. While the @@ -1207,78 +982,83 @@ them; not to define them. ## Setting MCA Parameters -The `-pmca` switch allows the passing of parameters to various MCA -(Modular Component Architecture) modules. MCA modules have direct impact -on programs because they allow tunable parameters to be set at run time -(such as which BTL communication device driver to use, what parameters -to pass to that BTL, etc.). +The `--mca` / `--pmixmca` / `--prtemca` switches (referenced here as +"`--mca` switches" for brevity) allow the passing of parameters +to various MCA (Modular Component Architecture) modules. MCA modules have +direct impact on programs because they allow tunable parameters to be set at +run time. -The `-pmca` switch takes two arguments: `` and ``. The +The `--mca` switches take two arguments: `` and ``. The `` argument generally specifies which MCA module will receive the -value. For example, the `` "btl" is used to select which BTL to -be used for transporting messages. The `` argument is the value +value. For example, the `` "rmaps" is used to select which RMAPS to +be used for mapping processes to nodes. The `` argument is the value that is passed. For example: -prun -pmca btl tcp,self -np 1 foo - -: Tells PSRVR to use the "tcp" and "self" BTLs, and to run a - single copy of "foo" on an allocated node. +`prun --prtemca rmaps seq --np 1 ./a.out` -prun -pmca btl self -np 1 foo +: Tells PRRTE to use the "seq" RMAPS component, and to run a + single copy of "a.out" on an allocated node. -: Tells PSRVR to use the "self" BTL, and to run a single copy of - "foo" on an allocated node. - -The `-pmca` switch can be used multiple times to specify different +The `--mca` switches can be used multiple times to specify different `` and/or `` arguments. If the same `` is specified more than once, the ``s are concatenated with a comma (",") separating them. -Note that the `-pmca` switch is simply a shortcut for setting +Note that the `--mca` switches are simply a shortcut for setting environment variables. The same effect may be accomplished by setting corresponding environment variables before running `prun`. The form of -the environment variables that PSRVR sets is: +the environment variables depends on the type of the `--mca` switch. + +`--mca` + +: `???` + +`--pmixmca` + +: `PMIX_MCA_=` + +`--prtemca` + +: `PRTE_MCA_=`` -``` -PMIX_MCA_= -``` -Thus, the `-pmca` switch overrides any previously set environment -variables. The `-pmca` settings similarly override MCA parameters set in -the $PRTE_PREFIX/etc/psrvr-mca-params.conf or -$HOME/.psrvr/mca-params.conf file. +Thus, the `--mca` switches override any previously set environment +variables. The `--mca` settings similarly override MCA parameters set in +the `$PRTE_PREFIX/etc/prte-mca-params.conf` or +`$HOME/.prte/mca-params.conf` file. -Unknown `` arguments are still set as environment variable -- +Unknown `` arguments are still set as environment variables -- they are not checked (by `prun`) for correctness. Illegal or incorrect `` arguments may or may not be reported -- it depends on the specific MCA module. To find the available component types under the MCA architecture, or to -find the available parameters for a specific component, use the `pinfo` -command. See the *pinfo(1)* man page for detailed information on the +find the available parameters for a specific component, use the `prte_info` +command. See the *prte_info(1)* man page for detailed information on the command. -## Setting MCA parameters and environment variables from file. +## Setting MCA parameters and environment variables from a file. -The `-tune` command line option and its synonym `-pmca -mca_base_envar_file_prefix` allows a user to set mca parameters and +The `--tune` command line option and its synonym `--prtemca +mca_base_envar_file_prefix` allows a user to set MCA parameters and environment variables with the syntax described below. This option requires a single file or list of files separated by "," to follow. -A valid line in the file may contain zero or many "-x", "-pmca", or -"--pmca" arguments. The following patterns are supported: -pmca var val --pmca var "val" -x var=val -x var. If any argument is duplicated in -the file, the last value read will be used. +A valid line in the file may contain zero or many "-x", "--prtemca", or +"--pmixmca" arguments. The following patterns are supported: +`--pmixmca var val`, `-pmca var "val"`, `-x var=val`, `-x var`. If any argument +is duplicated in the file, the last value read will be used. +(??? I don't think this is true any more) MCA parameters and environment specified on the command line have higher precedence than variables specified in the file. ## Running as root -The PSRVR team strongly advises against executing `prun` as the root +The PRRTE community strongly advises against executing `prun` as the root user. Applications should be run as regular (non-root) users. -Reflecting this advice, prun will refuse to run as root by default. To +Reflecting this advice, `prun` will refuse to run as root by default. To override this default, you can add the `--allow-run-as-root` option to the `prun` command line. @@ -1288,31 +1068,31 @@ There is no standard definition for what `prun` should return as an exit status. After considerable discussion, we settled on the following method for assigning the `prun` exit status (note: in the following description, the "primary" job is the initial application started by -prun - all jobs that are spawned by that job are designated +`prun` - all jobs that are spawned by that job are designated "secondary" jobs): - if all processes in the primary job normally terminate with exit - status 0, we return 0 + status 0, `prun` will return 0 - if one or more processes in the primary job normally terminate with - non-zero exit status, we return the exit status of the process with - the lowest rank to have a non-zero status + non-zero exit status, `prun` will return the exit status of the process + with the lowest rank to have a non-zero status - if all processes in the primary job normally terminate with exit status 0, and one or more processes in a secondary job normally - terminate with non-zero exit status, we (a) return the exit status + terminate with non-zero exit status, `prun` will (a) return the exit status of the process with the lowest rank in the lowest jobid to have a non-zero status, and (b) output a message summarizing the exit status of the primary and all secondary jobs. -- if the cmd line option --report-child-jobs-separately is set, we +- if the cmd line option `--report-child-jobs-separately` is set, `prun` will return -only- the exit status of the primary job. Any non-zero exit status in secondary jobs will be reported solely in a summary print statement. -By default, PSRVR records and notes that processes exited with non-zero +By default, PRRTE records and notes that processes exited with non-zero termination status. This is generally not considered an "abnormal -termination" - i.e., PSRVR will not abort a job if one or more +termination" - i.e., PRRTE will not abort a job if one or more processes return a non-zero status. Instead, the default behavior simply reports the number of processes terminating with non-zero status upon completion of the job. @@ -1321,14 +1101,14 @@ However, in some cases it can be desirable to have the job abort when any process terminates with non-zero status. For example, a non-PMIx job might detect a bad result from a calculation and want to abort, but doesn't want to generate a core file. Or a PMIx job might continue past -a call to PMIx_Finalize, but indicate that all processes should abort +a call to `PMIx_Finalize`, but indicate that all processes should abort due to some post-PMIx result. It is not anticipated that this situation will occur frequently. -However, in the interest of serving the broader community, PSRVR now has +However, in the interest of serving the broader community, PRRTE now has a means for allowing users to direct that jobs be aborted upon any process exiting with non-zero status. Setting the MCA parameter -"prte_abort_on_non_zero_status" to 1 will cause PSRVR to abort +"prte_abort_on_non_zero_status" to 1 will cause PRRTE to abort all processes once any process exits with non-zero status. Terminations caused in this manner will be reported on the console as an @@ -1338,12 +1118,12 @@ along with its exit status. # RETURN VALUE `prun` returns 0 if all processes started by `prun` exit after calling -PMIx_Finalize. A non-zero value is returned if an internal error -occurred in prun, or one or more processes exited before calling -PMIx_Finalize. If an internal error occurred in prun, the corresponding +`PMIx_Finalize`. A non-zero value is returned if an internal error +occurred in `prun`, or one or more processes exited before calling +`PMIx_Finalize`. If an internal error occurred in `prun`, the corresponding error code is returned. In the event that one or more processes exit -before calling PMIx_Finalize, the return value of the rank of the -process that `prun` first notices died before calling PMIx_Finalize +before calling `PMIx_Finalize`, the return value of the rank of the +process that `prun` first notices died before calling `PMIx_Finalize` will be returned. Note that, in general, this will be the first process that died but is not guaranteed to be so. diff --git a/src/tools/prun/prun.c b/src/tools/prun/prun.c index 54027b142f..145b745419 100644 --- a/src/tools/prun/prun.c +++ b/src/tools/prun/prun.c @@ -355,7 +355,7 @@ static prte_cmd_line_init_t cmd_line_init[] = { /* Mapping options */ { '\0', "map-by", 1, PRTE_CMD_LINE_TYPE_STRING, "Mapping Policy for job [slot | hwthread | core (default:np<=2) | l1cache | " - "l2cache | l3cache | socket (default:np>2) | node | seq | dist | ppr]," + "l2cache | l3cache | package (default:np>2) | node | seq | dist | ppr]," " with supported colon-delimited modifiers: PE=y (for multiple cpus/proc), " "SPAN, OVERSUBSCRIBE, NOOVERSUBSCRIBE, NOLOCAL, HWTCPUS, CORECPUS, " "DEVICE(for dist policy), INHERIT, NOINHERIT, PE-LIST=a,b (comma-delimited " @@ -366,15 +366,15 @@ static prte_cmd_line_init_t cmd_line_init[] = { /* Ranking options */ { '\0', "rank-by", 1, PRTE_CMD_LINE_TYPE_STRING, "Ranking Policy for job [slot (default:np<=2) | hwthread | core | l1cache " - "| l2cache | l3cache | socket (default:np>2) | node], with modifier :SPAN or :FILL", + "| l2cache | l3cache | package (default:np>2) | node], with modifier :SPAN or :FILL", PRTE_CMD_LINE_OTYPE_RANKING }, /* Binding options */ { '\0', "bind-to", 1, PRTE_CMD_LINE_TYPE_STRING, "Binding policy for job. Allowed values: none, hwthread, core, l1cache, l2cache, " - "l3cache, socket, (\"none\" is the default when oversubscribed, \"core\" is " - "the default when np<=2, and \"socket\" is the default when np>2). Allowed colon-delimited qualifiers: " + "l3cache, package, (\"none\" is the default when oversubscribed, \"core\" is " + "the default when np<=2, and \"package\" is the default when np>2). Allowed colon-delimited qualifiers: " "overload-allowed, if-supported", PRTE_CMD_LINE_OTYPE_BINDING },