ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
strrv2d_.c
Go to the documentation of this file.
00001 #include "Bdef.h"
00002 
00003 #if (INTFACE == C_CALL)
00004 void Cstrrv2d(int ConTxt, char *uplo, char *diag, int m, int n, float *A,
00005               int lda, int rsrc, int csrc)
00006 #else
00007 F_VOID_FUNC strrv2d_(int *ConTxt, F_CHAR uplo, F_CHAR diag, int *m, int *n,
00008                      float *A, int *lda, int *rsrc, int *csrc)
00009 #endif
00010 /*
00011  *  -- V1.1 BLACS routine --
00012  *  University of Tennessee, May 1, 1996
00013  *  Written by Clint Whaley.
00014  *
00015  *  Purpose
00016  *  =======
00017  *  Globally-blocking point to point trapezoidal real receive.
00018  *
00019  *  Arguments
00020  *  =========
00021  *
00022  *  ConTxt  (input) Ptr to int
00023  *          Index into MyConTxts00 (my contexts array).
00024  *
00025  *  UPLO    (input) Ptr to char
00026  *          Specifies the part of the matrix to be sent.
00027  *          = 'U':      Upper trapezoidal part
00028  *          ELSE :      Lower trapezoidal part
00029  *
00030  *  DIAG    (input) Ptr to char
00031  *          Specifies whether the matrix is unit diagonal or not.
00032  *          = 'U':      Matrix is unit diagonal, diagonal not communicated.
00033  *          ELSE :      Matrix is not unit diagonal, diagonal is communicated.
00034  *
00035  *  M       (input) Ptr to int
00036  *          The number of rows of the matrix A.  M >= 0.
00037  *
00038  *  N       (input) Ptr to int
00039  *          The number of columns of the matrix A.  N >= 0.
00040  *
00041  *  A       (output) Ptr to real two dimensional array
00042  *          The m by n matrix A.  Fortran77 (column-major) storage
00043  *          assumed.
00044  *          If UPLO = 'U', only the upper trapezoid is accessed;
00045  *          if UPLO = 'L', only the lower trapezoid is accessed.
00046  *
00047  *  LDA     (input) Ptr to int
00048  *          The leading dimension of the array A.  LDA >= M.
00049  *
00050  *
00051  *  RSRC    (input) Ptr to int
00052  *          The process row of the source of the matrix.
00053  *
00054  *  CSRC    (input) Ptr to int
00055  *          The process column of the source of the matrix.
00056  *
00057  *
00058  * ------------------------------------------------------------------------
00059  */
00060 {
00061 /*
00062  *  Prototypes and variable declarations
00063  */
00064    void BI_ArgCheck(int, int, char *, char, char, char, int, int, int, int,
00065                     int *, int *);
00066    MPI_Datatype BI_GetMpiTrType(BLACSCONTEXT *, char, char, int, int, int,
00067                                    MPI_Datatype, int *);
00068    void BI_Unpack(BLACSCONTEXT *, BVOID *, BLACBUFF *, MPI_Datatype);
00069    void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
00070    void BI_UpdateBuffs(BLACBUFF *);
00071    BLACBUFF *BI_GetBuff(int);
00072    int BI_BuffIsFree(BLACBUFF *, int);
00073    int tuplo, tdiag, tlda;
00074    int ierr, length;
00075    BLACBUFF *bp;
00076    MPI_Datatype MatTyp;
00077    BLACSCONTEXT *ctxt;
00078    extern BLACBUFF BI_AuxBuff, *BI_ActiveQ;
00079 
00080    MGetConTxt(Mpval(ConTxt), ctxt);
00081    tdiag = F2C_CharTrans(diag);
00082    tuplo = F2C_CharTrans(uplo);
00083    tdiag = Mlowcase(tdiag);
00084    tuplo = Mlowcase(tuplo);
00085 
00086 #if (BlacsDebugLvl > 0)
00087    BI_ArgCheck(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m),
00088                Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc));
00089 #endif
00090    if (Mpval(lda) < Mpval(m)) tlda = Mpval(m);
00091    else tlda = Mpval(lda);
00092    ctxt->scp = &ctxt->pscp;
00093 
00094    MatTyp = BI_GetMpiTrType(ctxt, tuplo, tdiag, Mpval(m), Mpval(n), tlda,
00095                             MPI_FLOAT, &BI_AuxBuff.N);
00096    BI_AuxBuff.Buff = (char *) A;
00097    BI_AuxBuff.dtype = MatTyp;
00098    BI_Srecv(ctxt, Mkpnum(ctxt, Mpval(rsrc), Mpval(csrc)), PT2PTID, &BI_AuxBuff);
00099    ierr=BI_MPI_TYPE_FREE(&MatTyp);
00100    if (BI_ActiveQ) BI_UpdateBuffs(NULL);
00101 }