ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
pslasizegsep.f
Go to the documentation of this file.
00001 *
00002 *
00003       SUBROUTINE PSLASIZEGSEP( DESCA, IPREPAD, IPOSTPAD, SIZEMQRLEFT,
00004      $                         SIZEMQRRIGHT, SIZEQRF, SIZETMS, SIZEQTQ,
00005      $                         SIZECHK, SIZESYEVX, ISIZESYEVX,
00006      $                         SIZESUBTST, ISIZESUBTST, SIZETST,
00007      $                         ISIZETST )
00008 *
00009 *  -- ScaLAPACK routine (version 1.7) --
00010 *     University of Tennessee, Knoxville, Oak Ridge National Laboratory,
00011 *     and University of California, Berkeley.
00012 *     May 1, 1997
00013 *
00014 *     .. Scalar Arguments ..
00015       INTEGER            IPOSTPAD, IPREPAD, ISIZESUBTST, ISIZESYEVX,
00016      $                   ISIZETST, SIZECHK, SIZEMQRLEFT, SIZEMQRRIGHT,
00017      $                   SIZEQRF, SIZEQTQ, SIZESUBTST, SIZESYEVX,
00018      $                   SIZETMS, SIZETST
00019 *     ..
00020 *     .. Array Arguments ..
00021       INTEGER            DESCA( * )
00022 *     ..
00023 *
00024 *  Purpose
00025 *  =======
00026 *
00027 *  PSLASIZEGSEP computes the amount of memory needed by
00028 *    various GSEP test routines, as well as SYGVX itself
00029 *
00030 *  Arguments
00031 *  =========
00032 *
00033 *  DESCA        (global input) INTEGER array dimension ( DLEN_ )
00034 *               Array descriptor as passed to PSSYGVX
00035 *
00036 *  SIZEMQRLEFT  LWORK for the 1st PSORMQR call in PSLAGSY
00037 *
00038 *  SIZEMQRRIGHT LWORK for the 2nd PSORMQR call in PSLAGSY
00039 *
00040 *  SIZEQRF      LWORK for PSGEQRF in PSLAGSY
00041 *
00042 *  SIZETMS      LWORK for PSLATMS
00043 *
00044 *  SIZEQTQ      LWORK for PSSEPQTQ (nexer complex)
00045 *
00046 *  SIZECHK      LWORK for PSGSEPCHK
00047 *
00048 *  SIZESYEVX    LWORK for PSSYGVX
00049 *
00050 *  ISIZESYEVX   LIWORK for PSSYGVX
00051 *
00052 *  SIZESUBTST   LWORK for PSSUBTST
00053 *
00054 *  ISIZESUBTST  LIWORK for PSSUBTST
00055 *
00056 *  SIZETST      LWORK for PSTST
00057 *
00058 *  ISIZETST     LIWORK for PSTST
00059 *
00060 *     .. Parameters ..
00061       INTEGER            BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
00062      $                   MB_, NB_, RSRC_, CSRC_, LLD_
00063       PARAMETER          ( BLOCK_CYCLIC_2D = 1, DLEN_ = 9, DTYPE_ = 1,
00064      $                   CTXT_ = 2, M_ = 3, N_ = 4, MB_ = 5, NB_ = 6,
00065      $                   RSRC_ = 7, CSRC_ = 8, LLD_ = 9 )
00066 *     ..
00067 *     .. Local Scalars ..
00068       INTEGER            CSRC_A, IACOL, IAROW, ICOFFA, IROFFA, LCM,
00069      $                   LCMQ, LDA, MQ0, MYCOL, MYROW, N, NB, NEIG, NN,
00070      $                   NNP, NP, NP0, NPCOL, NPROW, NQ, RSRC_A
00071 *     ..
00072 *     .. External Functions ..
00073       INTEGER            ICEIL, ILCM, INDXG2P, NUMROC
00074       EXTERNAL           ICEIL, ILCM, INDXG2P, NUMROC
00075 *     ..
00076 **     .. Executable Statements ..
00077 *       This is just to keep ftnchek happy
00078 *     .. External Subroutines ..
00079       EXTERNAL           BLACS_GRIDINFO
00080 *     ..
00081 *     .. Intrinsic Functions ..
00082       INTRINSIC          MAX
00083 *     ..
00084 *     .. Executable Statements ..
00085       IF( BLOCK_CYCLIC_2D*CSRC_*CTXT_*DLEN_*DTYPE_*LLD_*MB_*M_*NB_*N_*
00086      $    RSRC_.LT.0 )RETURN
00087 *
00088       N = DESCA( M_ )
00089       NB = DESCA( MB_ )
00090       RSRC_A = DESCA( RSRC_ )
00091       CSRC_A = DESCA( CSRC_ )
00092 *
00093       LDA = DESCA( LLD_ )
00094       CALL BLACS_GRIDINFO( DESCA( CTXT_ ), NPROW, NPCOL, MYROW, MYCOL )
00095 *
00096       LCM = ILCM( NPROW, NPCOL )
00097       LCMQ = LCM / NPCOL
00098       IROFFA = 0
00099       ICOFFA = 0
00100       IAROW = INDXG2P( 1, NB, MYROW, RSRC_A, NPROW )
00101       IACOL = INDXG2P( 1, NB, MYCOL, CSRC_A, NPCOL )
00102       NP = NUMROC( N+IROFFA, NB, MYROW, IAROW, NPROW )
00103       NQ = NUMROC( N+ICOFFA, NB, MYCOL, IACOL, NPCOL )
00104       SIZEMQRLEFT = MAX( ( NB*( NB-1 ) ) / 2, ( NP+NQ )*NB ) + NB*NB
00105       SIZEMQRRIGHT = MAX( ( NB*( NB-1 ) ) / 2,
00106      $               ( NQ+MAX( NP+NUMROC( NUMROC( N+ICOFFA, NB, 0, 0,
00107      $               NPCOL ), NB, 0, 0, LCMQ ), NP ) )*NB ) + NB*NB
00108       SIZEQRF = NB*NP + NB*NQ + NB*NB
00109       SIZETMS = ( LDA+1 )*MAX( 1, NQ ) +
00110      $          MAX( SIZEMQRLEFT, SIZEMQRRIGHT, SIZEQRF )
00111 *
00112       NP0 = NUMROC( N, DESCA( MB_ ), 0, 0, NPROW )
00113       MQ0 = NUMROC( N, DESCA( NB_ ), 0, 0, NPCOL )
00114       SIZEQTQ = 0
00115       SIZECHK = NUMROC( N, DESCA( NB_ ), MYCOL, 0, NPCOL )
00116 *
00117       NEIG = N
00118       NN = MAX( N, NB, 2 )
00119       NP0 = NUMROC( NN, NB, 0, 0, NPROW )
00120       MQ0 = NUMROC( MAX( NEIG, NB, 2 ), NB, 0, 0, NPCOL )
00121       SIZESYEVX = 5*N + MAX( 5*NN, NP0*MQ0+2*NB*NB ) +
00122      $            ICEIL( NEIG, NPROW*NPCOL )*NN
00123       NNP = MAX( N, NPROW*NPCOL+1, 4 )
00124       ISIZESYEVX = 6*NNP
00125 *
00126       SIZESUBTST = MAX( SIZETMS, SIZEQTQ, SIZECHK, SIZESYEVX ) +
00127      $             IPREPAD + IPOSTPAD
00128       ISIZESUBTST = ISIZESYEVX + IPREPAD + IPOSTPAD
00129 *
00130 *
00131 *     Allow room for A, COPYA and Z and DIAG, WIN, WNEW, GAP, WORK
00132 *
00133       SIZETST = 5*( LDA*NP+IPREPAD+IPOSTPAD ) +
00134      $          4*( N+IPREPAD+IPOSTPAD ) + SIZESUBTST
00135 *
00136 *     Allow room for IFAIL, ICLUSTR, and IWORK (all in PSSYGVX)
00137 *
00138       ISIZETST = N + 2*NPROW*NPCOL + 2*( IPREPAD+IPOSTPAD ) +
00139      $           ISIZESUBTST
00140 *
00141       RETURN
00142       END