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