Open MPI logo

prte-rank(1) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents

Name

PRTE: Mapping, Ranking, and Binding

Synopsis

PRTE employs a three-phase procedure for assigning process locations and ranks:

1.
B]mappingR]: Assigns a default location to each process
2.
B]rankingR]: Assigns a unique rank value to each process
3.
B]bindingR]: Constrains each process to run on specific processors

This document describes these three phases with examples. Unless otherwise noted, this behavior is shared by C]prunR], C]prterunR], and C]prteR].

Quick Summary

The two binaries that most influence process layout are C]prteR] and C]prunR]. The C]prteR] process discovers the allocation, starts the daemons, and defines the default mapping/ranking/binding for all jobs. The C]prunR] process defines the specific mapping/ranking/binding for a specific job. Most of the command line controls are targeted to C]prunR] since each job has its own unique requirements.

C]prterunR] is just a wrapper around C]prteR] for a single job PRTE DVM. It is doing the job of both C]prteR] and C]prunR], and, as such, accepts the sum all of their command line arguments. Any example that uses C]prunR] can substitute the use of C]prterunR] except where otherwise noted.

The C]prteR] process attempts to automatically discover the nodes in the allocation by querying supported resource managers. If a support resource manager is not present then C]prteR] 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 C]prteR] process will start the daemon processes (C]prtedR]) on the remote nodes using the corresponding resource manager process starter. If no such starter is available then C]rshR] or C]sshR] is used.

PRTE automatically maps processes in a round-robin fashion by CPU slot in one of two ways in the absence of any further directives:

B]CB]Map by core:B]R]
when the number of total processes in the job is <= 2
B]CB]Map by package:B]R]
when the number of total processes in the job is > 2

PRTE automatically binds processes. Three binding patterns are used in the absence of any further directives:

B]CB]Bind to core:B]R]
when the number of total processes in the job is <= 2
B]CB]Bind to package:B]R]
when the number of total processes in the job is > 2
B]CB]Bind to none:B]R]
when oversubscribed

If your application uses threads, then you probably want to ensure that you are either not bound at all (by specifying C]--bind-to noneR]), or bound to multiple cores using an appropriate binding level or specific number of processing elements per application process.

PRTE automatically ranks processes starting from 0. Two ranking patterns are used in the absence of any further directives:

B]CB]Rank by slot:B]R]
when the number of total processes in the job is <= 2
B]CB]Rank by package:B]R]
when the number of total processes in the job is > 2

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.

Specifying Host Nodes

Use one of the following options to specify which hosts (nodes) within the PRTE DVM environment to run on.

B]CB]--host <host1,host2,...,hostN>B]R] or B]CB]--host <host1:X,host2:Y,...,hostN:Z>B]R]
List of hosts on which to invoke processes. After each hostname a colon (C]:R]) followed by a positive integer can be used to specify the number of slots on that host (C]:XR], C]:YR], and C]:ZR]). The default is C]1R].
B]CB]--hostfile <hostfile>B]R]
Provide a hostfile to use.
B]CB]--machinefile <machinefile>B]R]
Synonym for C]-hostfileR].
B]CB]--default-hostfile <hostfile>B]R]
Provide a default 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 C]NR] processes for each socket does not imply that the processes will be bound to the socket.

B]CB]-c, -n, --n, --np <#>B]R]
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 C]-npR] nor its synonyms are provided on the command line), C]prunR] will automatically execute a copy of the program on each process slot (see below for description of a [lq]process slot[rq]). 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:

B]CB]--map-by <object>B]R]
Map to the specified object. See defaults in Quick Summary. Supported options include C]slotR], C]hwthreadR], C]coreR], C]l1cacheR], C]l2cacheR], C]l3cacheR], C]packageR], C]nodeR], C]seqR], C]distR], C]pprR], and C]rankfileR].

Any object can include qualifier by adding a colon (C]:R]) and any combination of one or more of the following to the C]--map-byR] option:

[bu]
C]PE=nR] bind C]nR] processing elements to each process
[bu]
C]SPANR] load balance the processes across the allocation
[bu]
C]OVERSUBSCRIBER] allow more processes on a node than processing elements
[bu]
C]NOOVERSUBSCRIBER] means C]!OVERSUBSCRIBER]
[bu]
C]NOLOCALR] do not launch processes on the same node as C]prunR]
[bu]
C]HWTCPUSR] use hardware threads as CPU slots
[bu]
C]CORECPUSR] use cores as CPU slots (default)
[bu]
C]DEVICE=devR] device specifier for the C]distR] policy
[bu]
C]INHERITR]
[bu]
C]NOINHERITR] means C]!INHERITR]
[bu]
C]PE-LIST=a,bR] comma-delimited ranges of cpus to use for this job processed as an unordered pool of CPUs
[bu]
C]FILE=%sR] (path to file containing sequential or rankfile entries).

C]pprR] policy example: C]--map-by ppr:N:<object>R] will launch C]NR] times the number of objects of the specified type on each node.

To order processes[cq] ranks:

B]CB]--rank-by <object>B]R]
Rank in round-robin fashion according to the specified object. See defaults in Quick Summary. Supported options include C]slotR], C]hwthreadR], C]coreR], C]l1cacheR], C]l2cacheR], C]l3cacheR], C]packageR], and C]nodeR].

Any object can include qualifiers by adding a colon (C]:R]) and any combination of one or more of the following to the C]--rank-byR] option:

[bu]
C]SPANR]
[bu]
C]FILLR]

To bind processes to sets of objects:

B]CB]--bind-to <object>B]R]
Bind processes to the specified object. See defaults in Quick Summary. Supported options include C]noneR], C]hwthreadR], C]coreR], C]l1cacheR], C]l2cacheR], C]l3cacheR], and C]packageR].

Any object can include qualifiers by adding a colon (C]:R]) and any combination of one or more of the following to the C]--bind-toR] option:

[bu]
C]overload-allowedR] allows for binding more than one process in relation to a CPU
[bu]
C]if-supportedR] if that object is supported on this system

Diagnostics

B]CB]--map-by :DISPLAYB]R]
Display a table showing the mapped location of each process prior to launch.
B]CB]--map-by :DISPLAYALLOCB]R]
Display the detected allocation of resources (e.g., nodes, slots)
B]CB]--bind-to :REPORTB]R]
Report bindings for launched processes to C]stderrR].

Description

PRTE employs a three-phase procedure for assigning process locations and ranks:

1.
B]mappingR]: Assigns a default location to each process
2.
B]rankingR]: Assigns a unique rank value to each process
3.
B]bindingR]: Constrains each process to run on specific processors

The first phase of B]mappingR] 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.

I]Note:R] 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 B]rankingR] of the process within the job[cq]s namespace. PRTE separates this from the mapping procedure to allow more flexibility in the relative placement of processes.

The third phase of B]bindingR] actually binds each process to a given set of processors. This can improve performance if the operating system is placing processes sub-optimally. 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.

PRTE[cq]s support for process binding depends on the underlying operating system. Therefore, certain process binding options may not be available on every system.

Specifying Host Nodes

Host nodes can be identified on the command line with the C]--hostR] option or in a hostfile.

For example, assuming no other resource manager or scheduler is involved,

B]CB]prte --host aa,aa,bb ./a.outB]R]
launches two processes on node C]aaR] and one on C]bbR].
B]CB]prun --host aa ./a.outB]R]
launches one process on node C]aaR].
B]CB]prun --host aa:5 ./a.outB]R]
launches five processes on node C]aaR].

Or, consider the hostfile


C]$ cat myhostfileaa slots=2bb slots=2cc slots=2R]Here, we list both the host names (C]aaR], C]bbR], and
C]ccR]) but also how many [lq]slots[rq] 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, the PRTE DVM will attempt to discover the number of cores (or hwthreads, if the C]:HWTCPUSR] qualifier to the C]--map-byR] option is set) and set the number of slots to that value.

Examples using the hostfile above with and without the C]--hostR] option

B]CB]prun --hostfile myhostfile ./a.outB]R]
will launch two processes on each of the three nodes.
B]CB]prun --hostfile myhostfile --host aa ./a.outB]R]
will launch two processes, both on node C]aaR].
B]CB]prun --hostfile myhostfile --host dd ./a.outB]R]
will find no hosts to run on and abort with an error. That is, the specified host C]ddR] is not in the specified hostfile.

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. The behavior of C]--hostR] in that environment will behave the same as if a hostfile was provided (since it is provided by the resource manager).

Specifying Number of Processes

As we have just seen, the number of processes to run can be set using 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. Consider the hostfile below for the examples that follow.


C]$ cat myhostfileaabbR]For example,
B]CB]prun --hostfile myhostfile --map-by ppr:2:package ./a.outB]R]
launches processes 0-3 on node C]aaR] and process 4-7 on node C]bbR], where C]aaR] and C]bbR] are both dual-package nodes. The C]--map-by ppr:2:packageR] option also turns on the C]--bind-to packageR] option, which is discussed in a later section.
B]CB]prun --hostfile myhostfile --map-by ppr:2:node ./a.outB]R]
launches processes 0-1 on node C]aaR] and processes 2-3 on node C]bbR].
B]CB]prun --hostfile myhostfile --map-by ppr:1:node ./a.outB]R]
launches one process per host node.

Another alternative is to specify the number of processes with the C]--npR] option. Consider now the hostfile


C]$ cat myhostfileaa slots=4bb slots=4cc slots=4R]Now,
B]CB]prun --hostfile myhostfile --np 6 ./a.outB]R]
will launch processes 0-3 on node C]aaR] and processes 4-5 on node C]bbR]. The remaining slots in the hostfile will not be used since the C]-npR] 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 C]prunR]/C]prterunR] options that describe mapping policies.


C]$ cat myhostfileaa slots=4bb slots=4cc slots=4R]Consider the hostfile above, with C]--np 6R]:


C] node aa node bb node ccprun 0 1 2 3 4 5prun --map-by node 0 1 2 3 4 5prun --map-by node:NOLOCAL 0 1 2 3 4 5R]The C]--map-by nodeR] option will load balance the processes
across the available nodes, numbering each process in a round-robin fashion.

The C]:NOLOCALR] qualifier to C]--map-byR] prevents any processes from being mapped onto the local host (in this case node C]aaR]). While C]prunR] typically consumes few system resources, the C]:NOLOCALR] qualifier can be helpful for launching very large jobs where C]prunR] may actually need to use noticeable amounts of memory and/or processing time.

Just as C]--npR] can specify fewer processes than there are slots, it can also oversubscribe the slots. For example, with the same hostfile:

B]CB]prun --hostfile myhostfile --np 14 ./a.outB]R]
will produce an error since the default C]:NOOVERSUBSCRIBER] qualifier to C]--map-byR] prevents oversubscription.

To oversubscribe the nodes you can use the C]:OVERSUBSCRIBER] qualifier to C]--map-byR]:

B]CB]prun --hostfile myhostfile --np 14 --map-by :OVERSUBSCRIBE ./a.outB]R]
will launch processes 0-5 on node C]aaR], 6-9 on C]bbR], and 10-13 on C]ccR].

Limits to oversubscription can also be specified in the hostfile itself with the C]max_slotsR] field:


C]% cat myhostfileaa slots=4 max_slots=4bb max_slots=8cc slots=4R]The C]max_slotsR] field specifies such a limit.
When it does, the C]slotsR] value defaults to the limit. Now:
B]CB]prun --hostfile myhostfile --np 14 --map-by :OVERSUBSCRIBE ./a.outB]R]
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 C]:NOOVERSUBSCRIBER] qualifier to C]--map-byR] option can be helpful since the PRTE DVM currently does not get [lq]max_slots[rq] values from the resource manager.

Of course, C]--npR] can also be used with the C]--hostR] option. For example,

B]CB]prun --host aa,bb --np 8 ./a.outB]R]
will produce an error since the default C]:NOOVERSUBSCRIBER] qualifier to C]--map-byR] prevents oversubscription.
B]CB]prun --host aa,bb --np 8 --map-by :OVERSUBSCRIBE ./a.outB]R]
launches 8 processes. Since only two hosts are specified, after the first two processes are mapped, one to C]aaR] and one to C]bbR], the remaining processes oversubscribe the specified hosts evenly.
B]CB]prun --host aa:2,bb:6 --np 8 ./a.outB]R]
launches 8 processes. Processes 0-1 on node C]aaR] since it has 2 slots and processes 2-7 on node C]bbR] since it has 6 slots.

And here is a MIMD example:

B]CB]prun --host aa --np 1 hostname : --host bb,cc --np 2 uptimeB]R]
will launch process 0 running C]hostnameR] on node C]aaR] and processes 1 and 2 each running C]uptimeR] on nodes C]bbR] and C]ccR], 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 [lq]sequential mapper,[rq] which reads the hostfile line by line, assigning processes to nodes in whatever order the hostfile specifies. Use the C]--prtemca rmaps seqR] option.

For example, using the hostfile below:


C]% cat myhostfileaa slots=4bb slots=4cc slots=4R]The command below will launch three processes, one on each of nodes
C]aaR], C]bbR], and C]ccR], respectively. The slot counts don[cq]t matter; one process is launched per line on whatever node is listed on the line.

C]% prun --hostfile myhostfile --prtemca rmaps seq ./a.outR]The I]rankingR] phase is best illustrated by considering the
following hostfile and test cases we used the C]--map-by ppr:2:packageR] option:

C]% cat myhostfileaabbR]

C]
                         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
R]

Ranking by core and by slot provide the identical result - a simple progression of ranks across each node. Ranking by package 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 C]:SPANR] qualifier to the ranking directive causes the ranking algorithm to treat the entire allocation as a single entity - thus, the process ranks are assigned across all sockets before circling back around to the beginning.

The I]bindingR] 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 package, then a C]--bind-to l3cacheR] directive will cause the process to be bound to the processors that share a single L3 cache within that package.

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 package level, and then bound to core. Each package will have multiple cores, so if multiple processes are mapped to a given package, the binding algorithm will assign each process located to a package to a unique core in a round-robin manner.

Alternatively, processes mapped by l2cache and then bound to package will simply be bound to all the processors in the package where they are located. In this manner, users can exert detailed control over relative process location and binding.

Process mapping/ranking/binding can also be set with MCA parameters. Their usage is less convenient than that of the command line options. On the other hand, MCA parameters can be set not only on the C]prunR] command line, but alternatively in a system or user C]mca-params.confR] file or as environment variables, as described in the MCA section below. Some examples include:


C]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 package hwloc_base_binding_policy package--bind-to none hwloc_base_binding_policy noneR]Difference between overloading and oversubscription

This section explores the difference between these two options. Users are often confused by the difference between these two scenarios.

As such this section provides a number of scenarios to help illustrate
the differences.
[bu]
C]--map-by :OVERSUBSCRIBER] allow more processes on a node than processing elements
[bu]
C]--bind-to <object>:overload-allowedR] allows for binding more than one process in relation to a CPU

The important thing to remember with I]oversubscribingR] is that it can be defined separately from the actual number of CPUs on a node. This allows the mapper to place more or fewer processes per node than CPUs. By default, PRTE uses cores to determine slots in the absence of such information provided in the hostfile or by the resource manager (except in the case of the C]--hostR] as described in the [lq]Specifying Host Nodes[rq] section).

The important thing to remember with I]overloadingR] is that it is defined as binding more processes than CPUs. By default, PRTE uses cores as a means of counting the number of CPUs. However, the user can adjust this. For example when using the C]:HWTCPUSR] qualifier to the C]--map-byR] option PRTE will use hardware threads as a means of counting the number of CPUs.

For the following examples consider a node with: - Two processor packages, - Ten cores per package, and - Eight hardware threads per core.

Consider the node from above with the hostfile below:


C]$ cat myhostfilenode01 slots=32node02 slots=32R]The [lq]slots[rq] tells PRTE that it can place up to 32 processes
before I]oversubscribingR] the node.

If we run the following:


C]prun --np 34 --hostfile myhostfile --map-by core --bind-to core hostnameR]It will return an error at the binding time indicating an
I]overloadingR] scenario.

The mapping mechanism assigns 32 processes to C]node01R] matching the [lq]slots[rq] specification in the hostfile. The binding mechanism will bind the first 20 processes to unique cores leaving it with 12 processes that it cannot bind without overloading one of the cores (putting more than one process on the core).

Using the C]overload-allowedR] qualifier to the C]--bind-to coreR] option tells PRTE that it may assign more than one process to a core.

If we run the following:


C]prun --np 34 --hostfile myhostfile --map-by core --bind-to core:overload-allowed hostnameR]This will run correctly placing 32 processes on C]node01R], and 2
processes on C]node02R]. On C]node01R] two processes are bound to cores 0-11 accounting for the overloading of those cores.

Alternatively, we could use hardware threads to give binding a lower level CPU to bind to without overloading.

If we run the following:


C]prun --np 34 --hostfile myhostfile --map-by core:HWTCPUS --bind-to hwthread hostnameR]This will run correctly placing 32 processes on C]node01R], and 2
processes on C]node02R]. On C]node01R] two processes are mapped to cores 0-11 but bound to different hardware threads on those cores (the logical first and second hardware thread) thus no hardware threads are overloaded at binding time.

In both of the examples above the node is not oversubscribed at mapping time because the hostfile set the oversubscription limit to [lq]slots=32[rq] for each node. It is only after we exceed that limit that PRTE will throw an oversubscription error.

Consider next if we ran the following:


C]prun --np 66 --hostfile myhostfile --map-by core:HWTCPUS --bind-to hwthread hostnameR]This will return an error at mapping time indicating an oversubscription
scenario. The mapping mechanism will assign all of the available slots (64 across 2 nodes) and be left two processes to map. The only way to map those processes is to exceed the number of available slots putting the job into an oversubscription scenario.

You can force PRTE to oversubscribe the nodes by using the C]:OVERSUBSCRIBER] qualifier to the C]--map-byR] option as seen in the example below:


C]prun --np 66 --hostfile myhostfile --map-by core:HWTCPUS:OVERSUBSCRIBE --bind-to hwthread hostnameR]This will run correctly placing 34 processes on C]node01R] and 32
on C]node02R]. Each process is bound to a unique hardware thread.

Overloading vs Oversubscription: Package Example

Let[cq]s extend these examples by considering the package level. Consider the same node as before, but with the hostfile below:


C]$ cat myhostfilenode01 slots=22node02 slots=22R]The lowest level CPUs are ‘cores’ and we have 20 total (10 per package).

If we run:


C]prun --np 20 --hostfile myhostfile --map-by package --bind-to package:REPORT hostnameR]Then 10 processes are mapped to each package, and bound at the package
level. This is not overloading since we have 10 CPUs (cores) available in the package at the hardware level.

However, if we run:


C]prun --np 21 --hostfile myhostfile --map-by package --bind-to package:REPORT hostnameR]Then 11 processes are mapped to the first package and 10 to the second
package. At binding time we have an overloading scenario because there are only 10 CPUs (cores) available in the package at the hardware level. So the first package is overloaded.

Overloading vs Oversubscription: Hardware Threads Example

Similarly, if we consider hardware threads.

Consider the same node as before, but with the hostfile below:


C]$ cat myhostfilenode01 slots=165node02 slots=165R]The lowest level CPUs are ‘hwthreads’ (because we are going to use the
C]:HWTCPUSR] qualifier) and we have 160 total (80 per package).

If we re-run (from the package example) and add the C]:HWTCPUSR] qualifier:


C]prun --np 21 --hostfile myhostfile --map-by package:HWTCPUS --bind-to package:REPORT hostnameR]Without the C]:HWTCPUSR] qualifier this would be overloading (as
we saw previously). The mapper places 11 processes on the first package and 10 to the second package. The processes are still bound to the package level. However, with the C]:HWTCPUSR] qualifier, it is not overloading since we have 80 CPUs (hwthreads) available in the package at the hardware level.

Alternatively, if we run:


C]prun --np 161 --hostfile myhostfile --map-by package:HWTCPUS --bind-to package:REPORT hostnameR]Then 81 processes are mapped to the first package and 80 to the second
package. At binding time we have an overloading scenario because there are only 80 CPUs (hwthreads) available in the package at the hardware level. So the first package is overloaded.

Diagnostics

PRTE provides various diagnostic reports that aid the user in verifying and tuning the mapping/ranking/binding for a specific job.

The C]:REPORTR] qualifier to C]--bind-toR] command line option can be used to report process bindings.

As an example, consider a node with: - Two processor packages, - Four cores per package, and - Eight hardware threads per core.

In each of the examples below the binding is reported in a human readable format.


C]$ prun --np 4 --map-by core --bind-to core:REPORT ./a.out[node01:103137] MCW rank 0 bound to package[0][core:0][node01:103137] MCW rank 1 bound to package[0][core:1][node01:103137] MCW rank 2 bound to package[0][core:2][node01:103137] MCW rank 3 bound to package[0][core:3]R]The example above processes bind to successive cores on the first
package.

C]$ prun --np 4 --map-by package --bind-to package:REPORT ./a.out[node01:103115] MCW rank 0 bound to package[0][core:0-9][node01:103115] MCW rank 1 bound to package[1][core:10-19][node01:103115] MCW rank 2 bound to package[0][core:0-9][node01:103115] MCW rank 3 bound to package[1][core:10-19]R]The example above processes bind to all cores on successive packages.
The processes cycle though the packages in a round-robin fashion as many times as are needed.

C]$ prun --np 4 --map-by package:PE=2 --bind-to core:REPORT ./a.out[node01:103328] MCW rank 0 bound to package[0][core:0-1][node01:103328] MCW rank 1 bound to package[1][core:10-11][node01:103328] MCW rank 2 bound to package[0][core:2-3][node01:103328] MCW rank 3 bound to package[1][core:12-13]R]The example above shows us that 2 cores have been bound per process.
The C]:PE=2R] qualifier states that 2 processing elements underneath the package (which would be cores in this case) are mapped to each process. The processes cycle though the packages in a round-robin fashion as many times as are needed.

C]$ prun --np 4 --map-by core:PE=2:HWTCPUS --bind-to :REPORT hostname[node01:103506] MCW rank 0 bound to package[0][hwt:0-1][node01:103506] MCW rank 1 bound to package[0][hwt:8-9][node01:103506] MCW rank 2 bound to package[0][hwt:16-17][node01:103506] MCW rank 3 bound to package[0][hwt:24-25]R]The example above shows us that 2 hardware threads have been bound per
process. In this case C]prunR] is mapping by hardware threads since we used the C]:HWTCPUSR] qualifier. Without that qualifier this command would return an error since by default C]prunR] will not map to resources smaller than a core. The C]:PE=2R] qualifier states that 2 processing elements underneath the core (which would be hardware threads in this case) are mapped to each process. The processes cycle though the cores in a round-robin fashion as many times as are needed.

C]$ prun --np 4 --bind-to none:REPORT hostname[node01:107126] MCW rank 0 is not bound (or bound to all available processors)[node01:107126] MCW rank 1 is not bound (or bound to all available processors)[node01:107126] MCW rank 2 is not bound (or bound to all available processors)[node01:107126] MCW rank 3 is not bound (or bound to all available processors)R]The example above binding is turned off.

Rankfiles

Another way to specify arbitrary mappings is with a rankfile, which gives you detailed control over process binding as well.

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:


C]rank <N>=<hostname> slot=<slot list>R]For example:


C]$ cat myrankfilerank 0=c712f6n01 slot=10-12rank 1=c712f6n02 slot=0,1,4rank 2=c712f6n03 slot=1-2$ prun --host aa,bb,cc,dd --map-by rankfile:FILE=myrankfile ./a.outR]Means that


C]Rank 0 runs on node aa, bound to logical cores 10-12.Rank 1 runs on node bb, bound to logical cores 0, 1, and 4.Rank 2 runs on node cc, bound to logical cores 1 and 2.R]For example:


C]$ cat myrankfilerank 0=aa slot=1:0-2rank 1=bb slot=0:0,1,4rank 2=cc slot=1-2$ prun --host aa,bb,cc,dd --map-by rankfile:FILE=myrankfile ./a.outR]Means that


C]Rank 0 runs on node aa, bound to logical package 1, cores 10-12 (the 0th through 2nd cores on that package).Rank 1 runs on node bb, bound to logical package 0, cores 0, 1, and 4.Rank 2 runs on node cc, bound to logical cores 1 and 2.R]The hostnames listed above are [lq]absolute,[rq] meaning that actual
resolvable hostnames are specified. However, hostnames can also be specified as [lq]relative,[rq] meaning that they are specified in relation to an externally-specified list of hostnames (e.g., by C]prunR][cq]s C]--hostR] argument, a hostfile, or a job scheduler).

The [lq]relative[rq] specification is of the form [lq]C]+n<X>R][rq], where C]XR] is an integer specifying the Xth hostname in the set of all available hostnames, indexed from 0. For example:


C]$ cat myrankfilerank 0=+n0 slot=10-12rank 1=+n1 slot=0,1,4rank 2=+n2 slot=1-2$ prun --host aa,bb,cc,dd --map-by rankfile:FILE=myrankfile ./a.outR]All package/core slot locations are be specified as I]logicalR]
indexes. You can use tools such as HWLOC[cq]s [lq]lstopo[rq] to find the logical indexes of packages and cores.

Deprecated Options

These deprecated options will be removed in a future release.

B]CB]--bind-to-coreB]R]
B](Deprecated: Use CB]--bind-to coreB])R] Bind processes to cores
B]CB]-bind-to-socket, --bind-to-socketB]R]
B](Deprecated: Use CB]--bind-to packageB])R] Bind processes to processor sockets
B]CB]--bycoreB]R]
B](Deprecated: Use CB]--map-by coreB])R] Map processes by core
B]CB]-bynode, --bynodeB]R]
B](Deprecated: Use CB]--map-by nodeB])R] 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, [lq]by node[rq] manner.
B]CB]--byslotB]R]
B](Deprecated: Use CB]--map-by slotB])R] Map and rank processes round-robin by slot.
B]CB]--cpus-per-proc <#perproc>B]R]
B](Deprecated: Use CB]--map-by <obj>:PE=<#perproc>B])R] Bind each process to the specified number of cpus.
B]CB]--cpus-per-rank <#perrank>B]R]
B](Deprecated: Use CB]--map-by <obj>:PE=<#perrank>B])R] Alias for C]--cpus-per-procR].
B]CB]--display-allocationB]R]
B](Deprecated: Use CB]--map-by :DISPLAYALLOCB])R] Display the detected resource allocation.
B]CB]--display-devel-mapB]R]
B](Deprecated: Use CB]--map-by :DISPLAYDEVELB])R] Display a detailed process map (mostly intended for developers) just before launch.
B]CB]--display-mapB]R]
B](Deprecated: Use CB]--map-by :DISPLAYB])R] Display a table showing the mapped location of each process prior to launch.
B]CB]--display-topoB]R]
B](Deprecated: Use CB]--map-by :DISPLAYTOPOB])R] Display the topology as part of the process map (mostly intended for developers) just before launch.
B]CB]--do-not-launchB]R]
B](Deprecated: Use CB]--map-by :DONOTLAUNCHB])R] Perform all necessary operations to prepare to launch the application, but do not actually launch it (usually used to test mapping patterns).
B]CB]--do-not-resolveB]R]
B](Deprecated: Use CB]--map-by :DONOTRESOLVEB])R] Do not attempt to resolve interfaces - usually used to determine proposed process placement/binding prior to obtaining an allocation.
B]CB]-N <num>B]R]
B](Deprecated: Use CB]--map-by prr:<num>:nodeB])R] Launch C]numR] processes per node on all allocated nodes.
B]CB]--nolocalB]R]
B](Deprecated: Use CB]--map-by :NOLOCALB])R] Do not run any copies of the launched application on the same node as C]prunR] is running. This option will override listing the C]localhostR] with C]--hostR] or any other host-specifying mechanism.
B]CB]--nooversubscribeB]R]
B](Deprecated: Use CB]--map-by :NOOVERSUBSCRIBEB])R] Do not oversubscribe any nodes; error (without starting any processes) if the requested number of processes would cause oversubscription. This option implicitly sets [lq]max_slots[rq] equal to the [lq]slots[rq] value for each node. (Enabled by default).
B]CB]--npernode <#pernode>B]R]
B](Deprecated: Use CB]--map-by ppr:<#pernode>:nodeB])R] On each node, launch this many processes.
B]CB]--npersocket <#persocket>B]R]
B](Deprecated: Use CB]--map-by ppr:<#perpackage>:packageB])R] On each node, launch this many processes times the number of processor sockets on the node. The C]--npersocketR] option also turns on the C]--bind-to socketR] option. The term C]socketR] has been globally replaced with C]packageR].
B]CB]--oversubscribeB]R]
B](Deprecated: Use CB]--map-by :OVERSUBSCRIBEB])R] Nodes are allowed to be oversubscribed, even on a managed system, and overloading of processing elements.
B]CB]--pernodeB]R]
B](Deprecated: Use CB]--map-by ppr:1:nodeB])R] On each node, launch one process.
B]CB]--pprB]R]
B](Deprecated: Use CB]--map-by ppr:<list>B])R] Comma-separated list of number of processes on a given resource type [default: none].
B]CB]--rankfile <FILENAME>B]R]
B](Deprecated: Use CB]--map-by rankfile:FILE=<FILENAME>B])R] Use a rankfile for mapping/ranking/binding
B]CB]--report-bindingsB]R]
B](Deprecated: Use CB]--bind-to :REPORTB])R] Report any bindings for launched processes.
B]CB]--tag-outputB]R]
B](Deprecated: Use CB]--map-by :TAGOUTPUTB])R] Tag all output with [job,rank]
B]CB]--timestamp-outputB]R]
B](Deprecated: Use CB]--map-by :TIMESTAMPOUTPUTB])R] Timestamp all application process output
B]CB]--use-hwthread-cpusB]R]
B](Deprecated: Use CB]--map-by :HWTCPUSB])R] Use hardware threads as independent cpus.
B]CB]--xmlB]R]
B](Deprecated: Use CB]--map-by :XMLOUTPUTB])R] Provide all output in XML format


Table of Contents

« Return to documentation listing