cale.t.b
cale.t.b

Reputation: 5

mpi rank not valid in do loop

Im updating a program in fortran to run with MPI and have run into an issue with the rank not showing up properly. In the beginning of this subroutine I call MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) and it returns the proper rank until this point:

  DO IY=2,NY+1
  DO IX=2,NX+1
   D(IX,IY)=(h_roms(IX,IY)+zeta(IX,IY))*maskr(IX,IY)
   call mpi_barrier(mpi_comm_world,ierr)      
   write(out,12) rank,ix,iy
12 format('disappearing?',i3,'ix:',i3,'iy',i3)           
  ENDDO       
  ENDDO

NY and NX are 124,84 respectively and the rank prints properly until iy becomes 125, and ix is 3. after that it only prints out as *** . IT still prints out everything twice (running on 2 processors) but the rank isn't valid, or giving any errors. Ive tried calling MPI_COMM_RANK after the do loop and still nothing. Any ideas would be much appreciated.

Upvotes: 0

Views: 201

Answers (1)

High Performance Mark
High Performance Mark

Reputation: 78364

Fortran generally prints a sequence of asterisks, your ***, if a numeric output field is too small to contain the number you are trying to write into it. Try changing some of the i3s in the format statement to i6 or even i0; this last form tells the compiler to print an integer in a field wide enough for all its digits but no wider.

Upvotes: 2

Related Questions