Statistics
| Branch: | Revision:

root / synthbench / euroben-dm / mod2i / icheck.f @ 0:839f52ef7657

History | View | Annotate | Download (1.1 kB)

1
      Subroutine icheck( data, num, ok )
2
! ---------------------------------------------------------------------
3
! --- 'icheck' checks sort runs on Integer arrays.
4
! ---------------------------------------------------------------------
5
      Use        dist_module
6
      Implicit   None
7
      Include    'mpif.h'
8

    
9
      Integer :: num, data(num)
10
      Logical :: ok
11

    
12
      Integer :: i, ier, status(MPI_Status_Size)
13
      Integer :: itag
14
      Integer :: exval
15
! ---------------------------------------------------------------------
16
      Do i = 2, num
17
         ok = ok .AND. ( data(i-1) <= data(i) )
18
      End Do
19
      itag = 11111
20
      If ( nodes == 1 ) Return
21
      If ( me > 0 )         Call MPI_Send( data(1), 1, MPI_Integer,
22
     &                      me - 1, itag, MPI_Comm_World, ier )
23
      If ( me < nodes - 1 ) Call MPI_Recv( exval, 1, MPI_Integer,
24
     &                      me + 1, itag, MPI_Comm_World,
25
     &                      status, ier )
26
      If ( me < nodes - 1 ) ok = ok .AND. ( data(num) <= exval )
27
! ---------------------------------------------------------------------
28
      End Subroutine icheck