I want to run a program with mpirun on different sets of machines (All linux machines with Open Mpi 1.5).
Right now I have machines where I can log on with username A
, and another set of machines where I use the username B
. All machines are accessible via ssh, but I can't figure out how to achieve this.
My hosts file would be like this :
localhost #username local
machine_set_A_1 #username A
machine_set_A_2 #username A
...
machine_set_B_1 #username B
machine_set_B_2 #username B
...
Is it possible to achieve this. Thank you.
Normally you'd just install mpi on each of the machines you want to run mpi jobs on. Then in your mipexec call you'd specify the machinefile that identifies the hosts/machines that have mpi. The mpi smpd/daemon will start the jobs for you on each host.
Example:
Machine file looks like:
Which means two hosts with 16 cores each.
refer to:
mpich2 documentation
The only way I can think of to do this is to create a wrapper for your process launcher to do ssh user1@hostname for some, and user2@hostname for others. You can set the process launcher ssh agent via
and then you'd have to inject the appropriate username arguments into the call to ssh from your wrapper.
You'll also of course have to have ssh keys setup so that your login to the other username accounts will be passwordless.
Trying to find solution for my own problem I have just found something like that (on http://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager). It might be helpful for you, but this is for MPICH.
An example
EDIT
For OpenMPI please refer to: http://www.open-mpi.org/faq/?category=rsh#rhosts-file
The OpenSSH client supports per-host configurations, something similar to this:
The
Host
directive restricts all the following declarations (up to the nextHost
directive) to apply only to connections made to hostnames, that match any of the patterns given after the directive.The SSH client configuration file is usually found in
/etc/ssh/ssh_config
(system-wide configuration) and in~/.ssh/config
(user-specific configuration; directives there override those from the system configuration).The man page for
ssh_config(5)
has more information on the available keywords and more information about what patterns are supported (using something likeHost *.groupA.uni.edu
, if applicable, could save some typing).