SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_locinfo()

subroutine pb_locinfo ( integer  i,
integer  inb,
integer  nb,
integer  myroc,
integer  srcproc,
integer  nprocs,
integer  ilocblk,
integer  ilocoff,
integer  mydist 
)

Definition at line 3908 of file pblastst.f.

3910*
3911* -- PBLAS test routine (version 2.0) --
3912* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
3913* and University of California, Berkeley.
3914* April 1, 1998
3915*
3916* .. Scalar Arguments ..
3917 INTEGER I, ILOCBLK, ILOCOFF, INB, MYDIST, MYROC, NB,
3918 $ NPROCS, SRCPROC
3919* ..
3920*
3921* Purpose
3922* =======
3923*
3924* PB_LOCINFO computes local information about the beginning of a sub-
3925* matrix starting at the global index I.
3926*
3927* Arguments
3928* =========
3929*
3930* I (global input) INTEGER
3931* On entry, I specifies the global starting index in the ma-
3932* trix. I must be at least one.
3933*
3934* INB (global input) INTEGER
3935* On entry, INB specifies the size of the first block of rows
3936* or columns of the matrix. INB must be at least one.
3937*
3938* NB (global input) INTEGER
3939* On entry, NB specifies the size of the blocks of rows or co-
3940* lumns of the matrix is partitioned into. NB must be at least
3941* one.
3942*
3943* MYROC (local input) INTEGER
3944* On entry, MYROC is the coordinate of the process whose local
3945* information is determined. MYROC is at least zero and
3946* strictly less than NPROCS.
3947*
3948* SRCPROC (global input) INTEGER
3949* On entry, SRCPROC specifies the coordinate of the process
3950* that possesses the first row or column of the matrix. When
3951* SRCPROC = -1, the data is not distributed but replicated,
3952* otherwise SRCPROC must be at least zero and strictly less
3953* than NPROCS.
3954*
3955* NPROCS (global input) INTEGER
3956* On entry, NPROCS specifies the total number of process rows
3957* or columns over which the submatrix is distributed. NPROCS
3958* must be at least one.
3959*
3960* ILOCBLK (local output) INTEGER
3961* On exit, ILOCBLK specifies the local row or column block
3962* coordinate corresponding to the row or column I of the ma-
3963* trix. ILOCBLK must be at least zero.
3964*
3965* ILOCOFF (local output) INTEGER
3966* On exit, ILOCOFF specifies the local row offset in the block
3967* of local coordinate ILOCBLK corresponding to the row or co-
3968* lumn I of the matrix. ILOCOFF must at least zero.
3969*
3970* MYDIST (local output) INTEGER
3971* On exit, MYDIST specifies the relative process coordinate of
3972* the process specified by MYROC to the process owning the row
3973* or column I. MYDIST is at least zero and strictly less than
3974* NPROCS.
3975*
3976* -- Written on April 1, 1998 by
3977* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
3978*
3979* =====================================================================
3980*
3981* .. Local Scalars ..
3982 INTEGER ITMP, NBLOCKS, PROC
3983* ..
3984* .. Executable Statements ..
3985*
3986 ilocoff = 0
3987*
3988 IF( srcproc.LT.0 ) THEN
3989*
3990 mydist = 0
3991*
3992 IF( i.LE.inb ) THEN
3993*
3994 ilocblk = 0
3995 ilocoff = i - 1
3996*
3997 ELSE
3998*
3999 itmp = i - inb
4000 nblocks = ( itmp - 1 ) / nb + 1
4001 ilocblk = nblocks
4002 ilocoff = itmp - 1 - ( nblocks - 1 ) * nb
4003*
4004 END IF
4005*
4006 ELSE
4007*
4008 proc = srcproc
4009 mydist = myroc - proc
4010 IF( mydist.LT.0 )
4011 $ mydist = mydist + nprocs
4012*
4013 IF( i.LE.inb ) THEN
4014*
4015 ilocblk = 0
4016 IF( myroc.EQ.proc )
4017 $ ilocoff = i - 1
4018*
4019 ELSE
4020*
4021 itmp = i - inb
4022 nblocks = ( itmp - 1 ) / nb + 1
4023 proc = proc + nblocks
4024 proc = proc - ( proc / nprocs ) * nprocs
4025 ilocblk = nblocks / nprocs
4026*
4027 IF( ( ilocblk*nprocs ).LT.( mydist-nblocks ) )
4028 $ ilocblk = ilocblk + 1
4029*
4030 IF( myroc.EQ.proc )
4031 $ ilocoff = itmp - 1 - ( nblocks - 1 ) * nb
4032*
4033 END IF
4034*
4035 END IF
4036*
4037 RETURN
4038*
4039* End of PB_LOCINFO
4040*
Here is the caller graph for this function: