[mpich-discuss] Custom rank for processes

Zhou, Hui zhouh at anl.gov
Mon Jul 1 16:37:05 CDT 2024


Yes, you can use rankmap to simply list out the node assignment for each rank. "-rankmap (vector,1,1,0,0,0)" is a list of 5 node ids, one for each rank. So rank 0 gets node 1, rank 1 gets node 1, rank 2 gets node 0, and so on.

The -hosts options is convenient if you have somewhat uniform assignment. If you want arbitrary assignment, just use -rankmap option.

--
Hui
________________________________
From: Niyaz Murshed <Niyaz.Murshed at arm.com>
Sent: Monday, July 1, 2024 4:30 PM
To: Zhou, Hui <zhouh at anl.gov>; discuss at mpich.org <discuss at mpich.org>; Jenke, Joachim <jenke at itc.rwth-aachen.de>
Cc: nd <nd at arm.com>
Subject: Re: Custom rank for processes

Sorry to bother you again with silly questions. How do I read the below : -rankmap (vector,1,1,0,0,0) I have 5 processes. 1 1 => means node1 will get first 2 processes ? -hosts 192. 168. 2. 100: 2,192. 168. 2. 200: 3 : this will give 2 process in
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Sorry to bother you again with silly questions.



How do I read the below :

-rankmap (vector,1,1,0,0,0)



I have 5 processes. 1 1 => means node1 will get first 2 processes ?



-hosts 192.168.2.100:2,192.168.2.200:3 : this will give 2 process in 100 and 3 in 200 .. Still won’t be able to specify which ranks goes to which node. Rank0 will be on node 100 .. what If I want Rank0 on node 200?





From: Zhou, Hui <zhouh at anl.gov>
Date: Monday, July 1, 2024 at 4:09 PM
To: Niyaz Murshed <Niyaz.Murshed at arm.com>, discuss at mpich.org <discuss at mpich.org>, Jenke, Joachim <jenke at itc.rwth-aachen.de>
Cc: nd <nd at arm.com>
Subject: Re: Custom rank for processes

> root at ampere-altra-2-1:/# mpirun -n 5   -bind-to user:10,11,12,13 -hosts 192.168.2.200,192.168.2.100 /mpitutorial/tutorials/mpi-hello-world/code/mpi_hello_world

Hello world from processor ampere-altra-2-1, rank 1 out of 5 processors

Hello world from processor ampere-altra-2-1, rank 3 out of 5 processors

Hello world from processor dpr740, rank 0 out of 5 processors

Hello world from processor dpr740, rank 4 out of 5 processors

Hello world from processor dpr740, rank 2 out of 5 processors



> -bind-to user:10,11,12,13

> This would mean on host 192.168.2.100

> P0=>10 , P2=>11

> This would mean on host 192.168.2.200

> P0=>10 , P2=>11, P3=12

> Is this correct understanding ?  Is it also possible to say which rank process will be pinned to which core ?

Yes, that is correct. The ranks are assigned to hosts as shown in the hello world output.





> About the rankmap:, trying to understand if I can select where a particular rank would be from > list of hosts. Currently, the first host in the list always get rank0.

> Can I specify the below ranks?

> mpirun -n 5   -bind-to user:10,11,12,13 -hosts 192.168.2.200,192.168.2.100 /mpitutorial/tutorials/mpi-hello-world/code/mpi_hello_world

>

> Hello world from processor ampere-altra-2-1, rank 1 out of 5 processors => rank0

> Hello world from processor ampere-altra-2-1, rank 3 out of 5 processors. => rank1

> Hello world from processor dpr740, rank 0 out of 5 processors           =>rank2

> Hello world from processor dpr740, rank 4 out of 5 processors           =>rank3

> Hello world from processor dpr740, rank 2 out of 5 processors           =>rank4

Yes. You can use "-rankmap (vector,1,1,0,0,0)". Alternatively, you can use "-hosts 192.168.2.100:2,192.168.2.200:3", the colon syntax specifies how many processes you want to assign to each host.



--

Hui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20240701/9bce1f47/attachment.html>


More information about the discuss mailing list