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 4503 of file pblastim.f.

4505*
4506* -- PBLAS test routine (version 2.0) --
4507* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
4508* and University of California, Berkeley.
4509* April 1, 1998
4510*
4511* .. Scalar Arguments ..
4512 INTEGER I, ILOCBLK, ILOCOFF, INB, MYDIST, MYROC, NB,
4513 $ NPROCS, SRCPROC
4514* ..
4515*
4516* Purpose
4517* =======
4518*
4519* PB_LOCINFO computes local information about the beginning of a sub-
4520* matrix starting at the global index I.
4521*
4522* Arguments
4523* =========
4524*
4525* I (global input) INTEGER
4526* On entry, I specifies the global starting index in the ma-
4527* trix. I must be at least one.
4528*
4529* INB (global input) INTEGER
4530* On entry, INB specifies the size of the first block of rows
4531* or columns of the matrix. INB must be at least one.
4532*
4533* NB (global input) INTEGER
4534* On entry, NB specifies the size of the blocks of rows or co-
4535* lumns of the matrix is partitioned into. NB must be at least
4536* one.
4537*
4538* MYROC (local input) INTEGER
4539* On entry, MYROC is the coordinate of the process whose local
4540* information is determined. MYROC is at least zero and
4541* strictly less than NPROCS.
4542*
4543* SRCPROC (global input) INTEGER
4544* On entry, SRCPROC specifies the coordinate of the process
4545* that possesses the first row or column of the matrix. When
4546* SRCPROC = -1, the data is not distributed but replicated,
4547* otherwise SRCPROC must be at least zero and strictly less
4548* than NPROCS.
4549*
4550* NPROCS (global input) INTEGER
4551* On entry, NPROCS specifies the total number of process rows
4552* or columns over which the submatrix is distributed. NPROCS
4553* must be at least one.
4554*
4555* ILOCBLK (local output) INTEGER
4556* On exit, ILOCBLK specifies the local row or column block
4557* coordinate corresponding to the row or column I of the ma-
4558* trix. ILOCBLK must be at least zero.
4559*
4560* ILOCOFF (local output) INTEGER
4561* On exit, ILOCOFF specifies the local row offset in the block
4562* of local coordinate ILOCBLK corresponding to the row or co-
4563* lumn I of the matrix. ILOCOFF must at least zero.
4564*
4565* MYDIST (local output) INTEGER
4566* On exit, MYDIST specifies the relative process coordinate of
4567* the process specified by MYROC to the process owning the row
4568* or column I. MYDIST is at least zero and strictly less than
4569* NPROCS.
4570*
4571* -- Written on April 1, 1998 by
4572* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
4573*
4574* =====================================================================
4575*
4576* .. Local Scalars ..
4577 INTEGER ITMP, NBLOCKS, PROC
4578* ..
4579* .. Executable Statements ..
4580*
4581 ilocoff = 0
4582*
4583 IF( srcproc.LT.0 ) THEN
4584*
4585 mydist = 0
4586*
4587 IF( i.LE.inb ) THEN
4588*
4589 ilocblk = 0
4590 ilocoff = i - 1
4591*
4592 ELSE
4593*
4594 itmp = i - inb
4595 nblocks = ( itmp - 1 ) / nb + 1
4596 ilocblk = nblocks
4597 ilocoff = itmp - 1 - ( nblocks - 1 ) * nb
4598*
4599 END IF
4600*
4601 ELSE
4602*
4603 proc = srcproc
4604 mydist = myroc - proc
4605 IF( mydist.LT.0 )
4606 $ mydist = mydist + nprocs
4607*
4608 IF( i.LE.inb ) THEN
4609*
4610 ilocblk = 0
4611 IF( myroc.EQ.proc )
4612 $ ilocoff = i - 1
4613*
4614 ELSE
4615*
4616 itmp = i - inb
4617 nblocks = ( itmp - 1 ) / nb + 1
4618 proc = proc + nblocks
4619 proc = proc - ( proc / nprocs ) * nprocs
4620 ilocblk = nblocks / nprocs
4621*
4622 IF( ( ilocblk*nprocs ).LT.( mydist-nblocks ) )
4623 $ ilocblk = ilocblk + 1
4624*
4625 IF( myroc.EQ.proc )
4626 $ ilocoff = itmp - 1 - ( nblocks - 1 ) * nb
4627*
4628 END IF
4629*
4630 END IF
4631*
4632 RETURN
4633*
4634* End of PB_LOCINFO
4635*