MPI error PGI 10.5

I get this weird error message when compile a simple MPI test.

% mpif90 testsimple2.f
testsimple2.f
PGF90-S-0307-IF-THEN and ENDIF must have the construct name stoptimer (testsimple2.f: 33)
PGF90-S-0038-Symbol, count_rateendtimer, has not been explicitly declared (testsimple2.f)
PGF90-S-0038-Symbol, dtimeinitialize, has not been explicitly declared (testsimple2.f)
0 inform, 0 warnings, 3 severes, 0 fatal for sparkcode


      PROGRAM Test
      IMPLICIT NONE
      INCLUDE 'mpif.h'
      
      
      INTEGER :: mpierror, numprocs, myrank
      DOUBLE PRECISION :: mytime, maxtime, mintime, avgtime
      INTEGER :: count0, count1, count_max, count_rate, dtime
      LOGICAL :: flag
      INTEGER :: data
      CHARACTER (MPI_MAX_ERROR_STRING+1) :: err_msg
  
     ! start timer
      CALL SYSTEM_CLOCK(count0, count_rate, count_max)
      CALL MPI_Init(mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Init MPI"
         STOP
      END IF
      CALL MPI_Comm_Size(MPI_COMM_WORLD, numprocs, mpierror) 
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Detect Communicator size"
        STOP
      END IF
 
      CALL MPI_Comm_Rank(MPI_COMM_WORLD, myrank, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Detect process rank"
        STOP
      END IF
     
     ! stop timer
      CALL SYSTEM_CLOCK(count1, count_rate, count_max)
      dtime = (count1-count0)/count_rate
     ! end timer
  ! one process acts as pseudo-host and do the find compKs
      IF (myrank .EQ. 0) THEN
         PRINT *, "Time to initialize MPI is ", dtime
     !        initialize
         data = 1000
      ENDIF
      CALL MPI_Bcast(data, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
         PRINT *, "Error Broadcast message"
         STOP
      END IF
  
      CALL MPI_Barrier(MPI_COMM_WORLD, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
         PRINT *, "Error Barrier"
         STOP
      END IF
      
      IF (myrank .EQ. 0) THEN
         PRINT *, "End test"
      END IF
      STOP
      END PROGRAM Test

Hi Tuan,

Add “-Mfree” or rename your file to be “testsimple.f90”. Files with a “.f” suffix default to fixed format. Alternatively, you can change your comments to use Fixed form (i.e. put the comment character in the first column).

Hope this helps,
Mat

 % cat testsimple.f
      PROGRAM Test
      IMPLICIT NONE
      INCLUDE 'mpif.h'


      INTEGER :: mpierror, numprocs, myrank
      DOUBLE PRECISION :: mytime, maxtime, mintime, avgtime
      INTEGER :: count0, count1, count_max, count_rate, dtime
      LOGICAL :: flag
      INTEGER :: data
      CHARACTER (MPI_MAX_ERROR_STRING+1) :: err_msg

c     start timer
      CALL SYSTEM_CLOCK(count0, count_rate, count_max)
      CALL MPI_Init(mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Init MPI"
         STOP
      END IF
      CALL MPI_Comm_Size(MPI_COMM_WORLD, numprocs, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Detect Communicator size"
        STOP
      END IF

      CALL MPI_Comm_Rank(MPI_COMM_WORLD, myrank, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
        PRINT *, "Error Detect process rank"
        STOP
      END IF

c stop timer
      CALL SYSTEM_CLOCK(count1, count_rate, count_max)
      dtime = (count1-count0)/count_rate
C end timer
c one process acts as pseudo-host and do the find compKs
      IF (myrank .EQ. 0) THEN
         PRINT *, "Time to initialize MPI is ", dtime
c        initialize
         data = 1000
      ENDIF
      CALL MPI_Bcast(data, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
         PRINT *, "Error Broadcast message"
         STOP
      END IF

      CALL MPI_Barrier(MPI_COMM_WORLD, mpierror)
      IF( mpierror .NE. MPI_SUCCESS) THEN
         PRINT *, "Error Barrier"
         STOP
      END IF

      IF (myrank .EQ. 0) THEN
         PRINT *, "End test"
      END IF
      STOP
      END PROGRAM Test
% pgf90 -c testsimple.f -Mmpi
%

Oh, Thanks Mat.

Tuan