ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
zgerv2d_.c
Go to the documentation of this file.
00001 #include "Bdef.h"
00002 
00003 #if (INTFACE == C_CALL)
00004 void Czgerv2d(int ConTxt, int m, int n, double *A, int lda, int rsrc, int csrc)
00005 #else
00006 F_VOID_FUNC zgerv2d_(int *ConTxt, int *m, int *n, double *A, int *lda,
00007                      int *rsrc, int *csrc)
00008 #endif
00009 /*
00010  *  -- V1.1 BLACS routine --
00011  *  University of Tennessee, May 1, 1996
00012  *  Written by Clint Whaley.
00013  *
00014  *  Purpose
00015  *  =======
00016  *  Globally-blocking point to point general double complex receive.
00017  *
00018  *  Arguments
00019  *  =========
00020  *
00021  *  ConTxt  (input) Ptr to int
00022  *          Index into MyConTxts00 (my contexts array).
00023  *
00024  *  M       (input) Ptr to int
00025  *          The number of rows of the matrix A.  M >= 0.
00026  *
00027  *  N       (input) Ptr to int
00028  *          The number of columns of the matrix A.  N >= 0.
00029  *
00030  *  A       (output) Ptr to double complex two dimensional array
00031  *          The m by n matrix A.  Fortran77 (column-major) storage
00032  *          assumed.
00033  *
00034  *  LDA     (input) Ptr to int
00035  *          The leading dimension of the array A.  LDA >= M.
00036  *
00037  *
00038  *  RSRC    (input) Ptr to int
00039  *          The process row of the source of the matrix.
00040  *
00041  *  CSRC    (input) Ptr to int
00042  *          The process column of the source of the matrix.
00043  *
00044  *
00045  * ------------------------------------------------------------------------
00046  */
00047 {
00048 /*
00049  *  Prototypes and variable declarations
00050  */
00051    void BI_ArgCheck(int, int, char *, char, char, char, int, int, int, int,
00052                     int *, int *);
00053    MPI_Datatype BI_GetMpiGeType(BLACSCONTEXT *, int, int, int,
00054                                    MPI_Datatype, int *);
00055    void BI_Unpack(BLACSCONTEXT *, BVOID *, BLACBUFF *, MPI_Datatype);
00056    void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
00057    void BI_UpdateBuffs(BLACBUFF *);
00058    BLACBUFF *BI_GetBuff(int);
00059    int BI_BuffIsFree(BLACBUFF *, int);
00060    int tlda;
00061    int ierr;
00062    MPI_Datatype MatTyp;
00063    BLACSCONTEXT *ctxt;
00064    extern BLACBUFF BI_AuxBuff, *BI_ActiveQ;
00065 
00066    MGetConTxt(Mpval(ConTxt), ctxt);
00067 #if (BlacsDebugLvl > 0)
00068    BI_ArgCheck(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m),
00069                Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc));
00070 #endif
00071    if (Mpval(lda) < Mpval(m)) tlda = Mpval(m);
00072    else tlda = Mpval(lda);
00073    ctxt->scp = &ctxt->pscp;
00074 
00075    MatTyp = BI_GetMpiGeType(ctxt, Mpval(m), Mpval(n), tlda,
00076                             MPI_DOUBLE_COMPLEX, &BI_AuxBuff.N);
00077    BI_AuxBuff.Buff = (char *) A;
00078    BI_AuxBuff.dtype = MatTyp;
00079    BI_Srecv(ctxt, Mkpnum(ctxt, Mpval(rsrc), Mpval(csrc)), PT2PTID, &BI_AuxBuff);
00080    ierr=BI_MPI_TYPE_FREE(&MatTyp);
00081    if (BI_ActiveQ) BI_UpdateBuffs(NULL);
00082 }