LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2003-07-17 06:38:24


On Thu, 17 Jul 2003, Maiko Wessel wrote:

> I have some problems with MPI_COMM_CREATE. I want to get an new process
> group with all ranks of the original group excepts the last one to make
> a collective i/o call with the new communicator.
>
> I start my program with:
> mpiexec -n 2 test : - n 1 test2
>
> During the execution of the program, it hangs at the call of
> MPI_COMM_CREATE and when i press ctrl+c i get the following call trace:

Some notes:

- The behavior of hitting ctrl-C and getting errors is expected.

- Be wary of naming programs "test"; there is a standard unix utility
  typically pretty close to the front of your PATH named "test", and
  unless you're really careful, it can get run instead of your MPI
  program (that doesn't sound like it's happening here -- I just
  mention it in case you run into this problem eventually)

- I see that you are running a heterogeneous program. Remember that
  the 2 "test" processes and the 1 "test2" process all form a single
  MPI_COMM_WORLD. Also remember that MPI_COMM_CREATE is a collective
  call; so *everyone* in MPI_COMM_WORLD must call MPI_COMM_CREATE with
  the same arguments. I suspect that your test2 program is not doing
  the exact same sequence of collective calls, and therefore this
  generates deadlock.

- As a personal preference, I tend to use MPI_COMM_SPLIT more than
  MPI_COMM_CREATE because you don't have to create an intermediate
  group. You can supply MPI_UNDEFINED for the color of processes that
  you do not want to be in the output communicator(s). For example:

-----
  int color = 0;
  if (rank == size - 1)
    color = MPI_UNDEFINED;
  MPI_Comm_split(MPI_COMM_WORLD, color, rank, &comm);
-----

Hope this helps.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/