Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill trailing whitespaces in teshsuite/smpi/{isp,mpich3-test}.
[simgrid.git] / teshsuite / smpi / mpich3-test / f77 / datatype / gaddressf.f
1 C -*- Mode: Fortran; -*-
2 C
3 C
4 C  (C) 2003 by Argonne National Laboratory.
5 C      See COPYRIGHT in top-level directory.
6 C
7       program main
8       implicit none
9       include 'mpif.h'
10       integer max_asizev
11       parameter (max_asizev=2)
12       include 'typeaints.h'
13       integer iarray(200), gap, intsize
14       integer ierr, errs
15
16       errs = 0
17
18       call MPI_Init(ierr)
19
20       call MPI_Get_address( iarray(1), aintv(1), ierr )
21       call MPI_Get_address( iarray(200), aintv(2), ierr )
22       gap = aintv(2) - aintv(1)
23
24       call MPI_Type_size( MPI_INTEGER, intsize, ierr )
25
26       if (gap .ne. 199 * intsize) then
27          errs = errs + 1
28          print *, ' Using get_address, computed a gap of ', gap
29          print *, ' Expected a gap of ', 199 * intsize
30       endif
31       if (errs .gt. 0) then
32           print *, ' Found ', errs, ' errors'
33       else
34           print *, ' No Errors'
35       endif
36
37       call MPI_Finalize( ierr )
38       end