Blame test/mpi/f90/timer/wtimef90.f90

Packit 0848f5
!  
Packit 0848f5
!  (C) 2004 by Argonne National Laboratory.
Packit 0848f5
!      See COPYRIGHT in top-level directory.
Packit 0848f5
!
Packit 0848f5
        program main
Packit 0848f5
! This is a simple test to check that both the MPI and PMPI versions of the
Packit 0848f5
! timers are available, and that they return double precision values.
Packit 0848f5
! If this code links, there are no problems.
Packit 0848f5
!
Packit 0848f5
          use mpi
Packit 0848f5
          implicit none
Packit 0848f5
          integer err
Packit 0848f5
          double precision time1
Packit 0848f5
Packit 0848f5
          call mpi_init(err)
Packit 0848f5
Packit 0848f5
          time1 = mpi_wtime()
Packit 0848f5
          time1 = time1 + mpi_wtick()
Packit 0848f5
          time1 = time1 + pmpi_wtime()
Packit 0848f5
          time1 = time1 + pmpi_wtick()
Packit 0848f5
! Add a test on time1 to ensure that the compiler does not remove the calls
Packit 0848f5
! (The compiler should call them anyway because they aren't pure, but
Packit 0848f5
! including these operations ensures that a buggy compiler doesn't 
Packit 0848f5
! pass this test by mistake).
Packit 0848f5
          if (time1 .lt. 0.0d0) then
Packit 0848f5
             print *, ' Negative time result'
Packit 0848f5
          else
Packit 0848f5
                print *, ' No Errors'
Packit 0848f5
          endif
Packit 0848f5
          
Packit 0848f5
          call mpi_finalize(err)
Packit 0848f5
        end