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

◆ pb_setlocran()

subroutine pb_setlocran ( integer  seed,
integer  ilocblk,
integer  jlocblk,
integer  ilocoff,
integer  jlocoff,
integer  myrdist,
integer  mycdist,
integer  nprow,
integer  npcol,
integer, dimension( * )  jmp,
integer, dimension( 4, * )  imuladd,
integer, dimension( * )  iran 
)

Definition at line 4894 of file pblastim.f.

4897*
4898* -- PBLAS test routine (version 2.0) --
4899* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
4900* and University of California, Berkeley.
4901* April 1, 1998
4902*
4903* .. Scalar Arguments ..
4904 INTEGER ILOCBLK, ILOCOFF, JLOCBLK, JLOCOFF, MYCDIST,
4905 $ MYRDIST, NPCOL, NPROW, SEED
4906* ..
4907* .. Array Arguments ..
4908 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
4909* ..
4910*
4911* Purpose
4912* =======
4913*
4914* PB_SETLOCRAN locally initializes the random number generator.
4915*
4916* Arguments
4917* =========
4918*
4919* SEED (global input) INTEGER
4920* On entry, SEED specifies a positive integer used to initiali-
4921* ze the first number in the random sequence used by the matrix
4922* generator. SEED must be at least zero.
4923*
4924* ILOCBLK (local input) INTEGER
4925* On entry, ILOCBLK specifies the local row block coordinate
4926* corresponding to the first row of the submatrix of interest.
4927* ILOCBLK must be at least zero.
4928*
4929* ILOCOFF (local input) INTEGER
4930* On entry, ILOCOFF specifies the local row offset in the block
4931* of local coordinate ILOCBLK corresponding to the first row of
4932* the submatrix of interest. ILOCOFF must at least zero.
4933*
4934* JLOCBLK (local input) INTEGER
4935* On entry, JLOCBLK specifies the local column block coordinate
4936* corresponding to the first column of the submatrix of inte-
4937* rest. JLOCBLK must be at least zero.
4938*
4939* JLOCOFF (local input) INTEGER
4940* On entry, JLOCOFF specifies the local column offset in the
4941* block of local coordinate JLOCBLK corresponding to the first
4942* column of the submatrix of interest. JLOCOFF must be at least
4943* zero.
4944*
4945* MYRDIST (local input) INTEGER
4946* On entry, MYRDIST specifies the relative row process coordi-
4947* nate to the process owning the first row of the submatrix of
4948* interest. MYRDIST must be at least zero and stricly less than
4949* NPROW (see the subroutine PB_LOCINFO).
4950*
4951* MYCDIST (local input) INTEGER
4952* On entry, MYCDIST specifies the relative column process coor-
4953* dinate to the process owning the first column of the subma-
4954* trix of interest. MYCDIST must be at least zero and stricly
4955* less than NPCOL (see the subroutine PB_LOCINFO).
4956*
4957* NPROW (global input) INTEGER
4958* On entry, NPROW specifies the total number of process rows
4959* over which the matrix is distributed. NPROW must be at least
4960* one.
4961*
4962* NPCOL (global input) INTEGER
4963* On entry, NPCOL specifies the total number of process co-
4964* lumns over which the matrix is distributed. NPCOL must be at
4965* least one.
4966*
4967* JMP (local input) INTEGER array
4968* On entry, JMP is an array of dimension JMP_LEN containing the
4969* different jump values used by the matrix generator.
4970*
4971* IMULADD (local input) INTEGER array
4972* On entry, IMULADD is an array of dimension (4, JMP_LEN). The
4973* jth column of this array contains the encoded initial cons-
4974* tants a_j and c_j to jump from X( n ) to X( n + JMP( j ) )
4975* (= a_j * X( n ) + c_j) in the random sequence. IMULADD(1:2,j)
4976* contains respectively the 16-lower and 16-higher bits of the
4977* constant a_j, and IMULADD(3:4,j) contains the 16-lower and
4978* 16-higher bits of the constant c_j.
4979*
4980* IRAN (local output) INTEGER array
4981* On entry, IRAN is an array of dimension 2. On exit, IRAN con-
4982* tains respectively the 16-lower and 32-higher bits of the en-
4983* coding of the entry of the random sequence corresponding lo-
4984* cally to the first local array entry to generate.
4985*
4986* -- Written on April 1, 1998 by
4987* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
4988*
4989* =====================================================================
4990*
4991* .. Parameters ..
4992 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
4993 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
4994 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
4995 parameter( jmp_1 = 1, jmp_row = 2, jmp_col = 3,
4996 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
4997 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
4998 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
4999 $ jmp_len = 11 )
5000* ..
5001* .. Local Arrays ..
5002 INTEGER IMULADDTMP( 4 ), ITMP( 2 )
5003* ..
5004* .. External Subroutines ..
5005 EXTERNAL pb_jump, pb_setran
5006* ..
5007* .. Executable Statements ..
5008*
5009* Compute and set the value of IRAN corresponding to A( IA, JA )
5010*
5011 itmp( 1 ) = seed
5012 itmp( 2 ) = 0
5013*
5014 CALL pb_jump( jmp( jmp_1 ), imuladd( 1, jmp_1 ), itmp, iran,
5015 $ imuladdtmp )
5016*
5017* Jump ILOCBLK blocks of rows + ILOCOFF rows
5018*
5019 CALL pb_jump( ilocoff, imuladd( 1, jmp_row ), iran, itmp,
5020 $ imuladdtmp )
5021 IF( myrdist.GT.0 ) THEN
5022 CALL pb_jump( jmp( jmp_imbv ), imuladd( 1, jmp_row ), itmp,
5023 $ iran, imuladdtmp )
5024 CALL pb_jump( myrdist - 1, imuladd( 1, jmp_mb ), iran,
5025 $ itmp, imuladdtmp )
5026 CALL pb_jump( ilocblk, imuladd( 1, jmp_npmb ), itmp,
5027 $ iran, imuladdtmp )
5028 ELSE
5029 IF( ilocblk.GT.0 ) THEN
5030 CALL pb_jump( jmp( jmp_imbv ), imuladd( 1, jmp_row ), itmp,
5031 $ iran, imuladdtmp )
5032 CALL pb_jump( nprow - 1, imuladd( 1, jmp_mb ), iran,
5033 $ itmp, imuladdtmp )
5034 CALL pb_jump( ilocblk - 1, imuladd( 1, jmp_npmb ), itmp,
5035 $ iran, imuladdtmp )
5036 ELSE
5037 CALL pb_jump( 0, imuladd( 1, jmp_1 ), itmp,
5038 $ iran, imuladdtmp )
5039 END IF
5040 END IF
5041*
5042* Jump JLOCBLK blocks of columns + JLOCOFF columns
5043*
5044 CALL pb_jump( jlocoff, imuladd( 1, jmp_col ), iran, itmp,
5045 $ imuladdtmp )
5046 IF( mycdist.GT.0 ) THEN
5047 CALL pb_jump( jmp( jmp_inbv ), imuladd( 1, jmp_col ), itmp,
5048 $ iran, imuladdtmp )
5049 CALL pb_jump( mycdist - 1, imuladd( 1, jmp_nb ), iran,
5050 $ itmp, imuladdtmp )
5051 CALL pb_jump( jlocblk, imuladd( 1, jmp_nqnb ), itmp,
5052 $ iran, imuladdtmp )
5053 ELSE
5054 IF( jlocblk.GT.0 ) THEN
5055 CALL pb_jump( jmp( jmp_inbv ), imuladd( 1, jmp_col ), itmp,
5056 $ iran, imuladdtmp )
5057 CALL pb_jump( npcol - 1, imuladd( 1, jmp_nb ), iran,
5058 $ itmp, imuladdtmp )
5059 CALL pb_jump( jlocblk - 1, imuladd( 1, jmp_nqnb ), itmp,
5060 $ iran, imuladdtmp )
5061 ELSE
5062 CALL pb_jump( 0, imuladd( 1, jmp_1 ), itmp,
5063 $ iran, imuladdtmp )
5064 END IF
5065 END IF
5066*
5067 CALL pb_setran( iran, imuladd( 1, jmp_1 ) )
5068*
5069 RETURN
5070*
5071* End of PB_SETLOCRAN
5072*
subroutine pb_setran(iran, iac)
Definition pblastst.f:4759
subroutine pb_jump(k, muladd, irann, iranm, ima)
Definition pblastst.f:4648