Newsgroups: comp.parallel.mpi
From: Boris Papin <Boris.Papin@ec-nantes.fr>
Subject: What didn't I understand about MPI_RECV?
Organization: Universite d'Angers, France.
Date: Fri, 03 Oct 1997 14:17:31 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3434F06B.167E@ec-nantes.fr>

Here is a small program that causes me trouble: if i>4093 the process
no1 (who calls MPI_RECV) hangs. Since the code is very short and simple
it shouldn't be too hard to see my mistake(s).
I'm running it on a SGI Origin2000.
Thanks in advance.

------------------------------------------------------------------------
      PROGRAM probleme
C
      INCLUDE '/usr/include/mpif.h'
      PARAMETER ( INITTAG  = 2)
      INTEGER status(MPI_STATUS_SIZE)
C
      call MPI_INIT(info)
      call MPI_COMM_RANK(MPI_COMM_WORLD, me      , info)
      call MPI_COMM_SIZE(MPI_COMM_WORLD, numtasks, info)
c
      do i=1,4093
c
         if (me.eq.0) then
            a=DFLOAT(i)*DFLOAT(i)
            call MPI_ISEND(a,1,MPI_DOUBLE_PRECISION,1,INITTAG,
     >                        MPI_COMM_WORLD,ireq,info)
c           call MPI_REQUEST_FREE(ireq,info)
            write(*,*) i,a,ireq
         endif
c
c
         if (me.eq.1) then
            call MPI_RECV(b,1,MPI_DOUBLE_PRECISION,
     >                       0,INITTAG,MPI_COMM_WORLD,
     >                       status,info)
            IF (info.NE.0) THEN
               write(*,*) 'Pb Recv:',info,status(MPI_ERROR)
            ENDIF
            write(*,*) '                        >>>>>',b
         endif
         call MPI_BARRIER(MPI_COMM_WORLD,info)
      enddo
c
      call MPI_FINALIZE(info)
      end
------------------------------------------------------------------------


-- 
Boris Papin
Ecole Centrale de Nantes,
Laboratoire de Mecanique des Fluides, UMR 6598 CNRS
1, rue de la Noe, 44072 Nantes cedex 03. France.	
tel: 33-02-40-37-16-81
mailto:Boris.Papin@ec-nantes.fr

