ORTE_HOSTS(7)
π ORTE_HOSTS π
ok so this is the manual page for ORTE_HOSTS (section 7 of the Open MPI docs), and it's literally all about how OpenRTE handles hostfiles and host lists β like, who gets to run where. bestie, if you've ever been like "why is my job on that node", this is the page. π¦
β¨ NAME β¨
ORTE_HOSTS β OpenRTE Hostfile and HOST Behavior: the whole rundown of OpenRTE's support for user-supplied hostfiles and comma-delimited lists of hosts. no cap.
πΈ DESCRIPTION πΈ
OpenRTE lets you be the main character and decide which hosts get used, and it supports several levels of user-specified host lists that follow an established precedence order. here's the tea:
- you can give a default hostfile β a list of nodes available to all
app_contextsgiven on the command line. only one default hostfile can be provided for any job. periodt. - you can also give a hostfile that lists the nodes to be used for a specific
app_context. - or you can just hand over a comma-delimited list of nodes for that
app_contextvia the-hostcommand line option.
now, the precedence order these get applied in depends a lil bit on your local environment. so when there's no resource manager (RM) around, here's how host and hostfile directives vibe together to define the set of hosts a job runs on:
- default hostfile
unset, hostunset, hostfileunsetβ the job is co-located withmpirunπ«Ά - default hostfile
unset, hostset, hostfileunsetβ host defines the resource list for the job - default hostfile
unset, hostunset, hostfilesetβ hostfile defines the resource list for the job - default hostfile
unset, hostset, hostfilesetβ hostfile defines the resource list for the job, then host filters the list to define the final set of nodes available to each application within the job - default hostfile
set, hostunset, hostfileunsetβ the default hostfile defines the resource list for the job - default hostfile
set, hostset, hostfileunsetβ the default hostfile defines the resource list for the job, then host filters the list to define the final set of nodes available to each application within the job - default hostfile
set, hostset, hostfilesetβ the default hostfile defines the resource list for the job, then hostfile filters the list, and then host filters the list to define the final set of nodes available to each application within the job
and yes, that last one is three layers of filtering. it's giving onion. π§
now β this changes somewhat in the presence of an RM, because that entity specifies the initial allocation of nodes. in that case, the default hostfile, hostfile and host directives are all used to filter the RM's specification, so you can utilize different portions of the allocation for different jobs. it's done according to the same precedence order as in the table above, except the RM provides the initial pool of nodes. π
π RELATIVE INDEXING π
once an initial allocation has been specified β whether by an RM, default hostfile, or hostfile β any subsequent hostfile and -host specifications can be made using relative indexing. this is the slay part: it lets you stipulate which hosts are to be used for a given app_context without specifying the particular host name, and instead using its relative position in the allocation.
lowkey the best way to get it is to look at a few examples. so imagine an RM has allocated a set of nodes to the user named "foo1, foo2, foo3, foo4". the user wants the first app_context to have exclusive use of the first two nodes, and a second app_context to use the last two nodes. sure, the user could printout the allocation to find the names of the nodes allocated to them and then use -host to specify this layout β but that's cumbersome and would require hand-manipulation for every single invocation. π
a simpler method is to utilize OpenRTE's relative indexing capability to specify the desired layout. in this case, a command line of:
mpirun -pernode -host +n1,+n2 ./app1 : -host +n3,+n4 ./app2
would provide the desired pattern. the "+" syntax indicates that the information is being provided as a relative index to the existing allocation. two methods of relative indexing are supported:
+n<#>β a relative index into the allocation referencing the<#>node. OpenRTE will substitute the<#>node in the allocation.+e[:<#>]β a request for<#>empty nodes, i.e. OpenRTE is to substitute this reference with<#>nodes that have not yet been used by any otherapp_context. if the":<#>"is not provided, OpenRTE will substitute the reference with all empty nodes. note that OpenRTE does track the empty nodes that have been assigned in this manner, so multiple uses of this option will result in assignment of unique nodes up to the limit of the available empty nodes. requests for more empty nodes than are available will generate an error. π
relative indexing can be combined with absolute naming of hosts in any arbitrary manner, and can be used in hostfiles as well as with the -host command line option. in addition, any slot specification provided in hostfiles will be respected β so you can specify that only a certain number of slots from a relative indexed host are to be used for a given app_context. obsessed. β¨
another example may help illustrate this point. consider the case where a user has a default hostfile containing:
dummy1 slots=4
dummy2 slots=4
dummy3 slots=4
dummy4 slots=4
dummy5 slots=4
this may, for example, be a hostfile that describes a set of commonly-used resources that the user wishes to execute applications against. for this particular application, the user plans to map byslot, and wants:
- the first two ranks to be on the second node of any allocation,
- the next ranks to land on an empty node,
- one rank specifically on
dummy4, - the next rank to be on the second node of the allocation again,
- and finally any remaining ranks to be on whatever empty nodes are left.
to accomplish this, the user provides a hostfile of:
+n2 slots=2
+e:1
dummy4 slots=1
+n2
+e
the user can now use this information in combination with OpenRTE's sequential mapper to obtain their specific layout:
mpirun --default-hostfile dummyhosts -hostfile mylayout -mca rmaps seq ./my_app
which will result in:
rank0being mapped todummy3rank1todummy1as the first empty noderank2todummy4rank3todummy3rank4todummy2andrank5todummy5as the last remaining unused nodes
heads up bestie: the sequential mapper ignores the number of slots arguments, because it only maps one rank at a time to each node in the list. π«
if the default round-robin mapper had been used instead, then the mapping would have resulted in:
ranks 0and1being mapped todummy3since two slots were specifiedranks 2-5ondummy1as the first empty node, which has four slotsrank6ondummy4since the hostfile specifies only a single slot from that node is to be usedranks 7and8ondummy3since only two slots remain availableranks 9-12ondummy2since it is the next available empty node and has four slotsranks 13-16ondummy5since it is the last remaining unused node and has four slots
so yeah β relative indexing can allow for complex mappings to be ported across allocations, including those obtained from automated resource managers, with zero need for manual manipulation of scripts and/or command lines. that's the whole point and it ate. π₯
π SEE ALSO π
and that's the page!! you made it to the end, icon π this was Open MPI version 4.1.6, dated Sep 30, 2023 β go forth and map your ranks, bestie ππ¦πΈ
π¦ where this page comes from
- alpine 3.24: openmpi-doc 4.1.6-r1 Β· custom
- ubuntu noble: openmpi-doc 4.1.6-7ubuntu2
- Copyright (c) 2008 Los Alamos National Security, LLC All rights reserved
- Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms