On 12/18/07 7:35 AM, "Elena Zhebel" <ezhebel_at_[hidden]> wrote:
> Thanks a lot! Now it works!
> The solution is to use mpirun -n 1 -hostfile my.hosts *.exe and pass MPI_Info
> Key to the Spawn function!
> One more question: is it necessary to start my "master" program with
> mpirun -n 1 -hostfile my_hostfile -host my_master_host my_master.exe ?
No, it isn't necessary - assuming that my_master_host is the first host
listed in your hostfile! If you are only executing one my_master.exe (i.e.,
you gave -n 1 to mpirun), then we will automatically map that process onto
the first host in your hostfile.
If you want my_master.exe to go on someone other than the first host in the
file, then you have to give us the -host option.
> Are there other possibilities for easy start?
> I would say just to run ./my_master.exe , but then the master process doesn't
> know about the available in the network hosts.
You can set the hostfile parameter in your environment instead of on the
command line. Just set OMPI_MCA_rds_hostfile_path = my.hosts.
You can then just run ./my_master.exe on the host where you want the master
to reside - everything should work the same.
Just as an FYI: the name of that environmental variable is going to change
in the 1.3 release, but everything will still work the same.
Hope that helps
> Thanks and regards,
> -----Original Message-----
> From: Ralph H Castain [mailto:rhc_at_[hidden]]
> Sent: Monday, December 17, 2007 5:49 PM
> To: Open MPI Users <users_at_[hidden]>; Elena Zhebel
> Cc: Ralph H Castain
> Subject: Re: [OMPI users] MPI::Intracomm::Spawn and cluster configuration
> On 12/17/07 8:19 AM, "Elena Zhebel" <ezhebel_at_[hidden]> wrote:
>> Hello Ralph,
>> Thank you for your answer.
>> I'm using OpenMPI 1.2.3. , compiler glibc232, Linux Suse 10.0.
>> My "master" executable runs only on the one local host, then it spawns
>> "slaves" (with MPI::Intracomm::Spawn).
>> My question was: how to determine the hosts where these "slaves" will be
>> You said: "You have to specify all of the hosts that can be used by
>> your job
>> in the original hostfile". How can I specify the host file? I can not
>> find it
>> in the documentation.
> Hmmm...sorry about the lack of documentation. I always assumed that the MPI
> folks in the project would document such things since it has little to do
> with the underlying run-time, but I guess that fell through the cracks.
> There are two parts to your question:
> 1. how to specify the hosts to be used for the entire job. I believe that is
> somewhat covered here:
> That FAQ tells you what a hostfile should look like, though you may already
> know that. Basically, we require that you list -all- of the nodes that both
> your master and slave programs will use.
> 2. how to specify which nodes are available for the master, and which for
> the slave.
> You would specify the host for your master on the mpirun command line with
> something like:
> mpirun -n 1 -hostfile my_hostfile -host my_master_host my_master.exe
> This directs Open MPI to map that specified executable on the specified host
> - note that my_master_host must have been in my_hostfile.
> Inside your master, you would create an MPI_Info key "host" that has a value
> consisting of a string "host1,host2,host3" identifying the hosts you want
> your slave to execute upon. Those hosts must have been included in
> my_hostfile. Include that key in the MPI_Info array passed to your Spawn.
> We don't currently support providing a hostfile for the slaves (as opposed
> to the host-at-a-time string above). This may become available in a future
> release - TBD.
> Hope that helps
>> Thanks and regards,
>> -----Original Message-----
>> From: users-bounces_at_[hidden] [mailto:users-bounces_at_[hidden]] On
>> Behalf Of Ralph H Castain
>> Sent: Monday, December 17, 2007 3:31 PM
>> To: Open MPI Users <users_at_[hidden]>
>> Cc: Ralph H Castain
>> Subject: Re: [OMPI users] MPI::Intracomm::Spawn and cluster
>> On 12/12/07 5:46 AM, "Elena Zhebel" <ezhebel_at_[hidden]> wrote:
>>> I'm working on a MPI application where I'm using OpenMPI instead of
>>> In my "master" program I call the function MPI::Intracomm::Spawn which
>>> "slave" processes. It is not clear for me how to spawn the "slave"
>>> over the network. Currently "master" creates "slaves" on the same
>>> If I use 'mpirun --hostfile openmpi.hosts' then processes are spawn
>>> network as expected. But now I need to spawn processes over the
>>> my own executable using MPI::Intracomm::Spawn, how can I achieve it?
>> I'm not sure from your description exactly what you are trying to do,
>> nor in
>> what environment this is all operating within or what version of Open
>> you are using. Setting aside the environment and version issue, I'm
>> that you are running your executable over some specified set of hosts,
>> want to provide a different hostfile that specifies the hosts to be
>> used for
>> the "slave" processes. Correct?
>> If that is correct, then I'm afraid you can't do that in any version
>> of Open
>> MPI today. You have to specify all of the hosts that can be used by
>> your job
>> in the original hostfile. You can then specify a subset of those hosts
>> to be
>> used by your original "master" program, and then specify a different
>> to be used by the "slaves" when calling Spawn.
>> But the system requires that you tell it -all- of the hosts that are
>> to be used at the beginning of the job.
>> At the moment, there is no plan to remove that requirement, though
>> there has
>> been occasional discussion about doing so at some point in the future.
>> promises that it will happen, though - managed environments, in
>> currently object to the idea of changing the allocation on-the-fly. We
>> though, make a provision for purely hostfile-based environments (i.e.,
>> unmanaged) at some time in the future.
>>> Thanks in advance for any help.
>>> users mailing list
>> users mailing list
>> users mailing list