[MPICH] Fortran code problems

Anthony Chan chan at mcs.anl.gov
Fri Jul 20 13:56:48 CDT 2007



On Fri, 20 Jul 2007, Jeffrey B. Layton wrote:

> When I run the F90 code, I get the following:
>
> mpiexec -machinefile ./machinelist -np 4 ./testf
>  MYRANK: 1  BEFORE FINALIZE
>  MYRANK: 2  BEFORE FINALIZE
>  MYRANK: 3  BEFORE FINALIZE
>  MYRANK: 3  BEFORE FINALIZE
>
> Notice how rank3 is repeated. Here's the funny thing, the
> output files from the F90 code are correct. I can't seem to find
> out why MYRANK=3 is repeated. Any ideas?

I tried to compile/run your f90 program with mpich2-1.0.5p4 + intel-8.1
compiler.  When running it, I got

install_linux_105p4_gcc40/bin/mpiexec -n 4 testf
 MYRANK:           1  BEFORE FINALIZE
 MYRANK:           3  BEFORE FINALIZE
[cli_0]: aborting job:
Fatal error in MPI_Recv: Invalid rank, error stack:
MPI_Recv(186): MPI_Recv(buf=0x81158c0, count=100, MPI_INTEGER, src=4,
tag=99, MPI_COMM_WORLD, status=0xbfffe20c) failed
MPI_Recv(105): Invalid rank has value 4 but must be nonnegative and less
than 4
 MYRANK:           2  BEFORE FINALIZE
rank 0 in job 21  schwinn.mcs.anl.gov_55074   caused collective abort of
all ranks
  exit status of rank 0: return code 1

Noticed, src=4, which isn't possible literally in your code, could be
a compiler bug.  I modified your loop to become.

     DO I=1,NUMPROCS-1
         CALL MPI_RECV(BUF, BUFSIZE, MPI_INTEGER, I, 99, MPI_COMM_WORLD, &
                       ISTATUS, IERROR)
         ...
     ENDDO

Then everything is fine.

mpiexec -n 4 testf
 MYRANK:           0  BEFORE FINALIZE
 MYRANK:           1  BEFORE FINALIZE
 MYRANK:           2  BEFORE FINALIZE
 MYRANK:           3  BEFORE FINALIZE

Can you try that to see if g95 is happy ?




More information about the mpich-discuss mailing list