Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Beginner Problem with OpenMPI (MPI_Waitall)
From: Rainer Keller (keller_at_[hidden])
Date: 2008-06-27 10:42:27


Dear Joao,
the problem is that, You do not use the &reqs[i] correctly in the MPI_Send --
reqs[0] will not be initialized; but wait for in MPI_Waitall...

Change:
  rc = MPI_Isend(&a , 1 , MPI_INT , i , 0 , MPI_COMM_WORLD , &reqs[i]);
to
  rc = MPI_Isend(&a , 1 , MPI_INT , i , 0 , MPI_COMM_WORLD , &reqs[i-1]);

and it will work.

These kind of buglets can be very neatly found using the memchecker component
using valgrind, which is implemented in the upcoming OpenMPI-1.3.

Please check the FAQ on:
  http://www.open-mpi.org/faq/?category=debugging
on how to use and what errors to find...

I attached the program with a bit of cleanups (e.g. why do You need
MPI_ANY_SOURCE in the recv on the workers...).

With best regards,
Rainer

On Freitag, 27. Juni 2008, Joao Marcelo wrote:
> Hi,
>
> I'm starting to code with MPI and decided to use openmpi. I'm using
> Ubuntu Linux with GCC version 4.2.3 and OpenMPI 1.2.5 (distribution
> package). The output of "ompi_info -- all" is attached. I'm also
> sending a copy of the source code I'm trying to run.
>
> What I'm trying to do is selecting process with rank 0 as the main
> process, which you send data to all others processes with non-blocking
> MPI_Isend. After all functions calls are performed, it will wait with
> MPI_Waitall() and the print a ending message. The compile command is :
>
> $ mpicc.openmpi -fopenmp mpi.c -o mpi
>
> And I'm running with :
>
> $ mpirun.openmpi -np 2 ./mpi
>
> The problem is that after the output below, the processes halt,
> without the ending message.
>
> jmhal_at_galileo:~/$ mpirun.openmpi -np 2 ./mpi
> Main process: 0.
> 1 - received value, rc value: 100 0
>
> If I start more processes, for example 3, this what I get:
>
> jmhal_at_galileo:~/$ mpirun.openmpi -np 3 ./mpi
> Main process: 0.
> End.
> 1 - received value, rc value: 100 0
> 2 - received value, rc value: 100 0
> [galileo:15807] *** Process received signal ***
> [galileo:15807] Signal: Segmentation fault (11)
> [galileo:15807] Signal code: Address not mapped (1)
> [galileo:15807] Failing at address: 0xd
> [galileo:15807] [ 0] [0xb7f2a440]
> [galileo:15807] [ 1] /usr/lib/openmpi/lib/openmpi/mca_pml_ob1.so
> [0xb7b49da8] [galileo:15807] [ 2]
> /usr/lib/libmpi.so.0(mca_pml_base_close+0x90) [0xb7efd830] [galileo:15807]
> [ 3] /usr/lib/libmpi.so.0(ompi_mpi_finalize+0x1d6) [0xb7ec48d6]
> [galileo:15807] [ 4] /usr/lib/libmpi.so.0(PMPI_Finalize+0x56) [0xb7ee27d6]
> [galileo:15807] [ 5] ./mpi(main+0x1bc) [0x8048a60]
> [galileo:15807] [ 6]
> /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7c47450]
> [galileo:15807] [ 7] ./mpi [0x8048841]
> [galileo:15807] *** End of error message ***
> mpirun.openmpi noticed that job rank 0 with PID 15807 on node galileo
> exited on signal 11 (Segmentation fault).
> 2 additional processes aborted (not shown)
>
>
> Which is ok since all messages were print, but what about the error
> message?

-- 
----------------------------------------------------------------
Dipl.-Inf. Rainer Keller   http://www.hlrs.de/people/keller
 HLRS                          Tel: ++49 (0)711-685 6 5858
 Nobelstrasse 19                  Fax: ++49 (0)711-685 6 5832
 70550 Stuttgart                    email: keller_at_[hidden]     
 Germany                             AIM/Skype:rusraink