Thanks Rainer and Matt, your suggestions solved my problem.

On Fri, Jun 27, 2008 at 11:44 AM, Matt Hughes
<matt.c.hughes+o...@gmail.com> wrote:
> 2008/6/27 Joao Marcelo <jmarcelo.alen...@gmail.com>:
>> 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.
>
> One problem I see is that you are incorrectly indexing the reqs array:
>
>        for ( i = 1; i < numtasks; ++i){
>                rc = MPI_Isend(&a , 1 , MPI_INT , i , 0 , MPI_COMM_WORLD , 
> &reqs[i]);
>        }
>
>        MPI_Waitall(numtasks - 1 , reqs , stats);
>
> If size = 3, you allocate enough space for two items in reqs but you
> index starting at one, so you access memory past the end of the array.
>  Additional, MPI_Waitall will be looking at uninitialized memory in
> the first element of reqs.  This is not immediately causing the crash,
> but it may be messing with MPI enough that Finalize crashes.  Try:
>
>        for ( i = 0; i < numtasks-1; ++i)
>
> Fixing that *might* fix your crash.
>
> mch
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>



-- 
__________________________________
João Marcelo Uchôa de Alencar
Computer Science BSc.
jmarcelo.alencar(at)gmail.com
Linux User 398939
__________________________________

Reply via email to