Statistics
| Branch: | Revision:

root / synthbench / euroben-ports / base / Fortran-MPI / mod2a / .svn / text-base / bsaddr.f.svn-base @ 0:839f52ef7657

History | View | Annotate | Download (969 Bytes)

1 0:839f52ef7657 louridas
      Subroutine bsaddr
2 0:839f52ef7657 louridas
! ----------------------------------------------------------------------
3 0:839f52ef7657 louridas
! --- Routine 'bsaddr' calculates the offsets that occur when local
4 0:839f52ef7657 louridas
!     data must be copied into a global one that combines all local
5 0:839f52ef7657 louridas
!     data. As the sizes of the local arrays need not be the same,
6 0:839f52ef7657 louridas
!     offsets cannot be generated with local knowledge only.
7 0:839f52ef7657 louridas
!
8 0:839f52ef7657 louridas
! --- Input:  - Integer nodes              (via Module dist_module)
9 0:839f52ef7657 louridas
!             - Integer sizes(0:maxnod-1)  (via Module dist_module)
10 0:839f52ef7657 louridas
! --- Output: - Integer offset(0:maxnod-1) (via Module dist_module)
11 0:839f52ef7657 louridas
! ----------------------------------------------------------------------
12 0:839f52ef7657 louridas
      Use        dist_module
13 0:839f52ef7657 louridas
14 0:839f52ef7657 louridas
      Integer :: i
15 0:839f52ef7657 louridas
! ----------------------------------------------------------------------
16 0:839f52ef7657 louridas
      offset(0) = 0
17 0:839f52ef7657 louridas
      Do i = 1, nodes - 1
18 0:839f52ef7657 louridas
         offset(i) = offset(i-1) + sizes(i-1)
19 0:839f52ef7657 louridas
      End Do
20 0:839f52ef7657 louridas
! ----------------------------------------------------------------------
21 0:839f52ef7657 louridas
      End Subroutine bsaddr