2004-02-27 00:26:48 +08:00
|
|
|
SUBROUTINE INFOG1L( GINDX, NB, NPROCS, MYROC, ISRCPROC, LINDX, &
|
|
|
|
& ROCSRC )
|
|
|
|
!
|
|
|
|
! -- ScaLAPACK tools routine (version 1.5) --
|
|
|
|
! University of Tennessee, Knoxville, Oak Ridge National Laboratory,
|
|
|
|
! and University of California, Berkeley.
|
|
|
|
! May 1, 1997
|
|
|
|
!
|
|
|
|
! .. Scalar Arguments ..
|
|
|
|
INTEGER GINDX, ISRCPROC, LINDX, MYROC, NB, NPROCS, &
|
|
|
|
& ROCSRC
|
|
|
|
! ..
|
|
|
|
!
|
|
|
|
! Purpose
|
|
|
|
! =======
|
|
|
|
!
|
|
|
|
! INFOG1L computes the starting local indexes LINDX corresponding to
|
|
|
|
! the distributed submatrix starting globally at the entry pointed by
|
|
|
|
! GINDX. This routine returns the coordinates of the process in the
|
|
|
|
! grid owning the submatrix entry of global index GINDX: ROCSRC.
|
|
|
|
! INFOG1L is a 1-dimensional version of INFOG2L.
|
|
|
|
!
|
|
|
|
! Arguments
|
|
|
|
! =========
|
|
|
|
!
|
|
|
|
! GINDX (global input) INTEGER
|
|
|
|
! The global starting index of the submatrix.
|
|
|
|
!
|
|
|
|
! NB (global input) INTEGER
|
|
|
|
! The block size.
|
|
|
|
!
|
|
|
|
! NPROCS (global input) INTEGER
|
|
|
|
! The total number of processes over which the distributed
|
|
|
|
! submatrix is distributed.
|
|
|
|
!
|
|
|
|
! MYROC (local input) INTEGER
|
|
|
|
! The coordinate of the process calling this routine.
|
|
|
|
!
|
|
|
|
! ISRCPROC (global input) INTEGER
|
|
|
|
! The coordinate of the process having the first entry of
|
|
|
|
! the distributed submatrix.
|
|
|
|
!
|
|
|
|
! LINDX (local output) INTEGER
|
|
|
|
! The local starting indexes of the distributed submatrix.
|
|
|
|
!
|
|
|
|
! ROCSRC (global output) INTEGER
|
|
|
|
! The coordinate of the process that possesses the first
|
|
|
|
! row and column of the submatrix.
|
|
|
|
!
|
|
|
|
! =====================================================================
|
|
|
|
!
|
|
|
|
! .. Local Scalars ..
|
2003-01-20 05:58:50 +08:00
|
|
|
INTEGER GCPY, IBLK
|
2004-02-27 00:26:48 +08:00
|
|
|
! ..
|
|
|
|
! .. Intrinsic Functions ..
|
2003-01-20 05:58:50 +08:00
|
|
|
INTRINSIC MOD
|
2004-02-27 00:26:48 +08:00
|
|
|
! ..
|
|
|
|
! .. Executable Statements ..
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
GCPY = GINDX-1
|
|
|
|
IBLK = GCPY / NB
|
|
|
|
ROCSRC = MOD( IBLK + ISRCPROC, NPROCS )
|
2004-02-27 00:26:48 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
LINDX = ( IBLK / NPROCS + 1 ) * NB + 1
|
2004-02-27 00:26:48 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
IF( MOD(MYROC+NPROCS-ISRCPROC,NPROCS).GE.MOD(IBLK, NPROCS) ) THEN
|
2004-02-27 00:26:48 +08:00
|
|
|
IF( MYROC.EQ.ROCSRC ) THEN
|
|
|
|
LINDX = LINDX + MOD( GCPY, NB )
|
|
|
|
END IF
|
2003-01-20 05:58:50 +08:00
|
|
|
LINDX = LINDX - NB
|
|
|
|
END IF
|
2004-02-27 00:26:48 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
RETURN
|
2004-02-27 00:26:48 +08:00
|
|
|
!
|
|
|
|
! End of INFOG1L
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END
|