Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] MPI_ERR_BUFFER with MPI_SENDRECEV
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2014-02-24 16:50:45


Sorry for the delay in replying.

I don't see an immediate reason why this would happen, but you might want to double/triple check the count parameters that you are sending. Are you 100% sure that they are correct?

It might also be worth checking that you're sending in the right buffer pointer -- perhaps the compiler is doing something wrong with your array slicing...? OMPI should only be reporting MPI_ERR_BUFFER if the buffer sent in is NULL and the count is > 0.

On Feb 19, 2014, at 11:42 AM, Samuel Richard <samuel.richard_at_[hidden]> wrote:

> Hello
>
> In a code written in Fortran, I have a problem with this part :
>
>
> if (num_node == 0) then
>
> ...
>
> else
>
> down_node = num_node-1
> ! send to down recive from down
>
> CALL MPI_SENDRECV(tab1(3 :4,:,:), size( tab1(3 :4, : ,:)), &
> & MPI_REAL8, down_node, 101, tab1(1:2, : ,:), size(tab1(1:2, : ,:)), &
> & MPI_REAL8, down_node, 11, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_SENDRECV(tab2(3 :4, : ,:), size( tab2(3 : 4, : ,:)), &
> & MPI_REAL8, down_node, 201, tab2(1:2, : ,:), size(tab2(1:2, : ,:)), &
> & MPI_REAL8, down_node, 21, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> endif
>
> if (num_node+1 == max_node) then
>
> ...
>
> else
>
> up_node = num_node+1
> ! send to up recived from up
>
> CALL MPI_SENDRECV(tab1(n - 3:n - 2, : ,:), size( tab1(n - 3:n - 2, : ,:) ), &
> & MPI_REAL8, up_node, 11, tab1(n - 1:n, : ,:), size(tab1(n - 1:n, : ,:)), &
> & MPI_REAL8, up_node, 101, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_SENDRECV(tab2(n - 3:n - 2, : ,:), size( tab2(n - 3:n - 2, : ,:) ), &
> & MPI_REAL8, up_node, 21, tab2(n - 1:n, : ,:), size(tab2(n - 1:n, : ,:)), &
> & MPI_REAL8, up_node, 201, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> endif
>
>
> I obtain the following error :
>
>
> [comp104:17175] *** An error occurred in MPI_Sendrecv
> [comp104:17175] *** on communicator MPI_COMM_WORLD
> [comp104:17175] *** MPI_ERR_BUFFER: invalid buffer pointer
> [comp104:17175] *** MPI_ERRORS_ARE_FATAL (goodbye)
>
>
>
> and if I change MPI_SENDRECEV by MPI_SEND + MPI_RECEV only for tab1, it works correctly.
>
>
>
> if (num_node == 0) then
>
> ...
>
> else
>
> down_node = num_node-1
> ! send to down recive from down
>
>
> CALL MPI_SEND(tab1(3 :4,:,:), size( tab1(3 :4, : ,:)), &
> & MPI_REAL8, down_node, 101 MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_RECV(tab1(1:2, : ,:), size(tab1(1:2, : ,:)), &
> & MPI_REAL8, down_node, 11, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_SENDRECV(tab2(3 :4, : ,:), size( tab2(3 : 4, : ,:)), &
> & MPI_REAL8, down_node, 201, tab2(1:2, : ,:), size(tab2(1:2, : ,:)), &
> & MPI_REAL8, down_node, 21, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> endif
>
> if (num_node+1 == max_node) then
>
> ...
>
> else
>
> up_node = num_node+1
> ! send to up recived from up
>
> CALL MPI_RECV(tab1(n - 3:n - 2, : ,:), size( tab1(n - 3:n - 2, : ,:) ), &
> & MPI_REAL8, up_node, 11, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_SEND(tab1(n - 1:n, : ,:), size(tab1(n - 1:n, : ,:)), &
> & MPI_REAL8, up_node, 101, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> CALL MPI_SENDRECV(tab2(n - 3:n - 2, : ,:), size( tab2(n - 3:n - 2, : ,:) ), &
> & MPI_REAL8, up_node, 21, tab2(n - 1:n, : ,:), size(tab2(n - 1:n, : ,:)), &
> & MPI_REAL8, up_node, 201, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
>
> endif
>
> I don't understand why MPI_SENDRECEV works why tab2 but not with tab1, they have the same size.
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/