mpiexec vs mpirun
Asked Answered
C

2

73

As per my little knowledge mpirun and mpiexec both are launcher. Can anybody tell the exact difference between mpiexec and mpirun?

Carbonation answered 13/8, 2014 at 13:49 Comment(1)
mpiexec for example seems to accept the notation host:num_processes in the host names file while mpirun seems not accept that (at least not for mvapich2)Ipoh
S
85

mpiexec is defined in the MPI standard (well, the recent versions at least) and I refer you to those (your favourite search engine will find them for you) for details.

mpirun is a command implemented by many MPI implementations. It has never, however, been standardised and there have always been, often subtle, differences between implementations. For details see the documentation of the implementation(s) of your choice.

And yes, they are both used to launch MPI programs, these days mpiexec is generally preferable because it is standardised.

Stole answered 13/8, 2014 at 14:40 Comment(1)
On the spot answer! Cheers :)!Maryannamaryanne
H
32

I know the question's been answered, but I think the answer isn't the best. I ran into a few issues on the cluster here with mpirun and looked to see if there was a difference between mpirun and mpiexec. This is what I found:

Description

Mpiexec is a replacement program for the script mpirun, which is part of the mpich package. It is used to initialize a parallel job from within a PBS batch or interactive environment. Mpiexec uses the task manager library of PBS to spawn copies of the executable on the nodes in a PBS allocation.

Reasons to use mpiexec rather than a script (mpirun) or an external daemon (mpd):

  • Starting tasks with the TM interface is much faster than invoking a separate rsh or ssh once for each process.
  • Resources used by the spawned processes are accounted correctly with mpiexec, and reported in the PBS logs, because all the processes of a parallel job remain under the control of PBS, unlike when using startup scripts such as mpirun.
  • Tasks that exceed their assigned limits of CPU time, wallclock time, memory usage, or disk space are killed cleanly by PBS. It is quite hard for processes to escape control of the resource manager when using mpiexec.
  • You can use mpiexec to enforce a security policy. If all jobs are required to startup using mpiexec and the PBS execution environment, it is not necessary to enable rsh or ssh access to the compute nodes in the cluster.

Ref: https://www.osc.edu/~djohnson/mpiexec/

Humfried answered 10/5, 2016 at 8:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.