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

◆ pb_binfo()

subroutine pb_binfo ( integer  offd,
integer  m,
integer  n,
integer  imb1,
integer  inb1,
integer  mb,
integer  nb,
integer  mrrow,
integer  mrcol,
integer  lcmt00,
integer  mblks,
integer  nblks,
integer  imbloc,
integer  inbloc,
integer  lmbloc,
integer  lnbloc,
integer  ilow,
integer  low,
integer  iupp,
integer  upp 
)

Definition at line 4169 of file pblastim.f.

4172*
4173* -- PBLAS test routine (version 2.0) --
4174* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
4175* and University of California, Berkeley.
4176* April 1, 1998
4177*
4178* .. Scalar Arguments ..
4179 INTEGER ILOW, IMB1, IMBLOC, INB1, INBLOC, IUPP, LCMT00,
4180 $ LMBLOC, LNBLOC, LOW, M, MB, MBLKS, MRCOL,
4181 $ MRROW, N, NB, NBLKS, OFFD, UPP
4182* ..
4183*
4184* Purpose
4185* =======
4186*
4187* PB_BINFO initializes the local information of an m by n local array
4188* owned by the process of relative coordinates ( MRROW, MRCOL ). Note
4189* that if m or n is less or equal than zero, there is no data, in which
4190* case this process does not need the local information computed by
4191* this routine to proceed.
4192*
4193* Arguments
4194* =========
4195*
4196* OFFD (global input) INTEGER
4197* On entry, OFFD specifies the off-diagonal of the underlying
4198* matrix of interest as follows:
4199* OFFD = 0 specifies the main diagonal,
4200* OFFD > 0 specifies lower subdiagonals, and
4201* OFFD < 0 specifies upper superdiagonals.
4202*
4203* M (local input) INTEGER
4204* On entry, M specifies the local number of rows of the under-
4205* lying matrix owned by the process of relative coordinates
4206* ( MRROW, MRCOL ). M must be at least zero.
4207*
4208* N (local input) INTEGER
4209* On entry, N specifies the local number of columns of the un-
4210* derlying matrix owned by the process of relative coordinates
4211* ( MRROW, MRCOL ). N must be at least zero.
4212*
4213* IMB1 (global input) INTEGER
4214* On input, IMB1 specifies the global true size of the first
4215* block of rows of the underlying global submatrix. IMB1 must
4216* be at least MIN( 1, M ).
4217*
4218* INB1 (global input) INTEGER
4219* On input, INB1 specifies the global true size of the first
4220* block of columns of the underlying global submatrix. INB1
4221* must be at least MIN( 1, N ).
4222*
4223* MB (global input) INTEGER
4224* On entry, MB specifies the blocking factor used to partition
4225* the rows of the matrix. MB must be at least one.
4226*
4227* NB (global input) INTEGER
4228* On entry, NB specifies the blocking factor used to partition
4229* the the columns of the matrix. NB must be at least one.
4230*
4231* MRROW (local input) INTEGER
4232* On entry, MRROW specifies the relative row coordinate of the
4233* process that possesses these M rows. MRROW must be least zero
4234* and strictly less than NPROW.
4235*
4236* MRCOL (local input) INTEGER
4237* On entry, MRCOL specifies the relative column coordinate of
4238* the process that possesses these N columns. MRCOL must be
4239* least zero and strictly less than NPCOL.
4240*
4241* LCMT00 (local output) INTEGER
4242* On exit, LCMT00 is the LCM value of the left upper block of
4243* this m by n local block owned by the process of relative co-
4244* ordinates ( MRROW, MRCOL ).
4245*
4246* MBLKS (local output) INTEGER
4247* On exit, MBLKS specifies the local number of blocks of rows
4248* corresponding to M. MBLKS must be at least zero.
4249*
4250* NBLKS (local output) INTEGER
4251* On exit, NBLKS specifies the local number of blocks of co-
4252* lumns corresponding to N. NBLKS must be at least zero.
4253*
4254* IMBLOC (local output) INTEGER
4255* On exit, IMBLOC specifies the number of rows (size) of the
4256* uppest blocks of this m by n local array owned by the process
4257* of relative coordinates ( MRROW, MRCOL ). IMBLOC is at least
4258* MIN( 1, M ).
4259*
4260* INBLOC (local output) INTEGER
4261* On exit, INBLOC specifies the number of columns (size) of
4262* the leftmost blocks of this m by n local array owned by the
4263* process of relative coordinates ( MRROW, MRCOL ). INBLOC is
4264* at least MIN( 1, N ).
4265*
4266* LMBLOC (local output) INTEGER
4267* On exit, LMBLOC specifies the number of rows (size) of the
4268* lowest blocks of this m by n local array owned by the process
4269* of relative coordinates ( MRROW, MRCOL ). LMBLOC is at least
4270* MIN( 1, M ).
4271*
4272* LNBLOC (local output) INTEGER
4273* On exit, LNBLOC specifies the number of columns (size) of the
4274* rightmost blocks of this m by n local array owned by the
4275* process of relative coordinates ( MRROW, MRCOL ). LNBLOC is
4276* at least MIN( 1, N ).
4277*
4278* ILOW (local output) INTEGER
4279* On exit, ILOW is the lower bound characterizing the first co-
4280* lumn block owning offdiagonals of this m by n array. ILOW
4281* must be less or equal than zero.
4282*
4283* LOW (global output) INTEGER
4284* On exit, LOW is the lower bound characterizing the column
4285* blocks with te exception of the first one (see ILOW) owning
4286* offdiagonals of this m by n array. LOW must be less or equal
4287* than zero.
4288*
4289* IUPP (local output) INTEGER
4290* On exit, IUPP is the upper bound characterizing the first row
4291* block owning offdiagonals of this m by n array. IUPP must be
4292* greater or equal than zero.
4293*
4294* UPP (global output) INTEGER
4295* On exit, UPP is the upper bound characterizing the row
4296* blocks with te exception of the first one (see IUPP) owning
4297* offdiagonals of this m by n array. UPP must be greater or
4298* equal than zero.
4299*
4300* -- Written on April 1, 1998 by
4301* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
4302*
4303* =====================================================================
4304*
4305* .. Local Scalars ..
4306 INTEGER TMP1
4307* ..
4308* .. Intrinsic Functions ..
4309 INTRINSIC max, min
4310* ..
4311* .. Executable Statements ..
4312*
4313* Initialize LOW, ILOW, UPP, IUPP, LMBLOC, LNBLOC, IMBLOC, INBLOC,
4314* MBLKS, NBLKS and LCMT00.
4315*
4316 low = 1 - nb
4317 upp = mb - 1
4318*
4319 lcmt00 = offd
4320*
4321 IF( m.LE.0 .OR. n.LE.0 ) THEN
4322*
4323 IF( mrrow.GT.0 ) THEN
4324 iupp = mb - 1
4325 ELSE
4326 iupp = max( 0, imb1 - 1 )
4327 END IF
4328 imbloc = 0
4329 mblks = 0
4330 lmbloc = 0
4331*
4332 IF( mrcol.GT.0 ) THEN
4333 ilow = 1 - nb
4334 ELSE
4335 ilow = min( 0, 1 - inb1 )
4336 END IF
4337 inbloc = 0
4338 nblks = 0
4339 lnbloc = 0
4340*
4341 lcmt00 = lcmt00 + ( low - ilow + mrcol * nb ) -
4342 $ ( iupp - upp + mrrow * mb )
4343*
4344 RETURN
4345*
4346 END IF
4347*
4348 IF( mrrow.GT.0 ) THEN
4349*
4350 imbloc = min( m, mb )
4351 iupp = mb - 1
4352 lcmt00 = lcmt00 - ( imb1 - mb + mrrow * mb )
4353 mblks = ( m - 1 ) / mb + 1
4354 lmbloc = m - ( m / mb ) * mb
4355 IF( lmbloc.EQ.0 )
4356 $ lmbloc = mb
4357*
4358 IF( mrcol.GT.0 ) THEN
4359*
4360 inbloc = min( n, nb )
4361 ilow = 1 - nb
4362 lcmt00 = lcmt00 + inb1 - nb + mrcol * nb
4363 nblks = ( n - 1 ) / nb + 1
4364 lnbloc = n - ( n / nb ) * nb
4365 IF( lnbloc.EQ.0 )
4366 $ lnbloc = nb
4367*
4368 ELSE
4369*
4370 inbloc = inb1
4371 ilow = 1 - inb1
4372 tmp1 = n - inb1
4373 IF( tmp1.GT.0 ) THEN
4374*
4375* more than one block
4376*
4377 nblks = ( tmp1 - 1 ) / nb + 2
4378 lnbloc = tmp1 - ( tmp1 / nb ) * nb
4379 IF( lnbloc.EQ.0 )
4380 $ lnbloc = nb
4381*
4382 ELSE
4383*
4384 nblks = 1
4385 lnbloc = inb1
4386*
4387 END IF
4388*
4389 END IF
4390*
4391 ELSE
4392*
4393 imbloc = imb1
4394 iupp = imb1 - 1
4395 tmp1 = m - imb1
4396 IF( tmp1.GT.0 ) THEN
4397*
4398* more than one block
4399*
4400 mblks = ( tmp1 - 1 ) / mb + 2
4401 lmbloc = tmp1 - ( tmp1 / mb ) * mb
4402 IF( lmbloc.EQ.0 )
4403 $ lmbloc = mb
4404*
4405 ELSE
4406*
4407 mblks = 1
4408 lmbloc = imb1
4409*
4410 END IF
4411*
4412 IF( mrcol.GT.0 ) THEN
4413*
4414 inbloc = min( n, nb )
4415 ilow = 1 - nb
4416 lcmt00 = lcmt00 + inb1 - nb + mrcol * nb
4417 nblks = ( n - 1 ) / nb + 1
4418 lnbloc = n - ( n / nb ) * nb
4419 IF( lnbloc.EQ.0 )
4420 $ lnbloc = nb
4421*
4422 ELSE
4423*
4424 inbloc = inb1
4425 ilow = 1 - inb1
4426 tmp1 = n - inb1
4427 IF( tmp1.GT.0 ) THEN
4428*
4429* more than one block
4430*
4431 nblks = ( tmp1 - 1 ) / nb + 2
4432 lnbloc = tmp1 - ( tmp1 / nb ) * nb
4433 IF( lnbloc.EQ.0 )
4434 $ lnbloc = nb
4435*
4436 ELSE
4437*
4438 nblks = 1
4439 lnbloc = inb1
4440*
4441 END IF
4442*
4443 END IF
4444*
4445 END IF
4446*
4447 RETURN
4448*
4449* End of PB_BINFO
4450*
#define max(A, B)
Definition pcgemr.c:180
#define min(A, B)
Definition pcgemr.c:181