ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
dtrrv2d_.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 #if (INTFACE == C_CALL)
4 void Cdtrrv2d(int ConTxt, char *uplo, char *diag, int m, int n, double *A,
5  int lda, int rsrc, int csrc)
6 #else
7 F_VOID_FUNC dtrrv2d_(int *ConTxt, F_CHAR uplo, F_CHAR diag, int *m, int *n,
8  double *A, int *lda, int *rsrc, int *csrc)
9 #endif
10 /*
11  * -- V1.1 BLACS routine --
12  * University of Tennessee, May 1, 1996
13  * Written by Clint Whaley.
14  *
15  * Purpose
16  * =======
17  * Globally-blocking point to point trapezoidal double precision receive.
18  *
19  * Arguments
20  * =========
21  *
22  * ConTxt (input) Ptr to int
23  * Index into MyConTxts00 (my contexts array).
24  *
25  * UPLO (input) Ptr to char
26  * Specifies the part of the matrix to be sent.
27  * = 'U': Upper trapezoidal part
28  * ELSE : Lower trapezoidal part
29  *
30  * DIAG (input) Ptr to char
31  * Specifies whether the matrix is unit diagonal or not.
32  * = 'U': Matrix is unit diagonal, diagonal not communicated.
33  * ELSE : Matrix is not unit diagonal, diagonal is communicated.
34  *
35  * M (input) Ptr to int
36  * The number of rows of the matrix A. M >= 0.
37  *
38  * N (input) Ptr to int
39  * The number of columns of the matrix A. N >= 0.
40  *
41  * A (output) Ptr to double precision two dimensional array
42  * The m by n matrix A. Fortran77 (column-major) storage
43  * assumed.
44  * If UPLO = 'U', only the upper trapezoid is accessed;
45  * if UPLO = 'L', only the lower trapezoid is accessed.
46  *
47  * LDA (input) Ptr to int
48  * The leading dimension of the array A. LDA >= M.
49  *
50  *
51  * RSRC (input) Ptr to int
52  * The process row of the source of the matrix.
53  *
54  * CSRC (input) Ptr to int
55  * The process column of the source of the matrix.
56  *
57  *
58  * ------------------------------------------------------------------------
59  */
60 {
61 /*
62  * Prototypes and variable declarations
63  */
64  void BI_ArgCheck(int, int, char *, char, char, char, int, int, int, int,
65  int *, int *);
66  MPI_Datatype BI_GetMpiTrType(BLACSCONTEXT *, char, char, int, int, int,
67  MPI_Datatype, int *);
68  void BI_Unpack(BLACSCONTEXT *, BVOID *, BLACBUFF *, MPI_Datatype);
69  void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
70  void BI_UpdateBuffs(BLACBUFF *);
71  BLACBUFF *BI_GetBuff(int);
72  int BI_BuffIsFree(BLACBUFF *, int);
73  int tuplo, tdiag, tlda;
74  int ierr, length;
75  BLACBUFF *bp;
76  MPI_Datatype MatTyp;
77  BLACSCONTEXT *ctxt;
79 
80  MGetConTxt(Mpval(ConTxt), ctxt);
81  tdiag = F2C_CharTrans(diag);
82  tuplo = F2C_CharTrans(uplo);
83  tdiag = Mlowcase(tdiag);
84  tuplo = Mlowcase(tuplo);
85 
86 #if (BlacsDebugLvl > 0)
87  BI_ArgCheck(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m),
88  Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc));
89 #endif
90  if (Mpval(lda) < Mpval(m)) tlda = Mpval(m);
91  else tlda = Mpval(lda);
92  ctxt->scp = &ctxt->pscp;
93 
94  MatTyp = BI_GetMpiTrType(ctxt, tuplo, tdiag, Mpval(m), Mpval(n), tlda,
95  MPI_DOUBLE, &BI_AuxBuff.N);
96  BI_AuxBuff.Buff = (char *) A;
97  BI_AuxBuff.dtype = MatTyp;
98  BI_Srecv(ctxt, Mkpnum(ctxt, Mpval(rsrc), Mpval(csrc)), PT2PTID, &BI_AuxBuff);
99  ierr=BI_MPI_TYPE_FREE(&MatTyp);
100  if (BI_ActiveQ) BI_UpdateBuffs(NULL);
101 }
BI_GetBuff
BLACBUFF * BI_GetBuff(int length)
Definition: BI_GetBuff.c:36
bLaCbUfF::Buff
char * Buff
Definition: Bdef.h:56
BI_Unpack
void BI_Unpack(BLACSCONTEXT *ctxt, BVOID *A, BLACBUFF *bp, MPI_Datatype Dtype)
Definition: BI_Unpack.c:3
BI_GetMpiTrType
MPI_Datatype BI_GetMpiTrType(BLACSCONTEXT *ctxt, char uplo, char diag, int m, int n, int lda, MPI_Datatype Dtype, int *N)
Definition: BI_GetMpiTrType.c:4
F_CHAR
char * F_CHAR
Definition: pblas.h:109
MGetConTxt
#define MGetConTxt(Context, ctxtptr)
Definition: Bdef.h:200
bLaCsCoNtExT::pscp
BLACSSCOPE pscp
Definition: Bdef.h:25
BVOID
#define BVOID
Definition: Bdef.h:136
bLaCbUfF
Definition: Bdef.h:54
BI_ActiveQ
BLACBUFF * BI_ActiveQ
Definition: BI_GlobalVars.c:9
bLaCbUfF::N
int N
Definition: Bdef.h:61
F2C_CharTrans
#define F2C_CharTrans(c)
Definition: Bdef.h:246
Mpval
#define Mpval(para)
Definition: Bdef.h:261
Mlowcase
#define Mlowcase(C)
Definition: Bdef.h:145
bLaCsCoNtExT
Definition: Bdef.h:23
Mkpnum
#define Mkpnum(ctxt, prow, pcol)
Definition: Bdef.h:173
dtrrv2d_
F_VOID_FUNC dtrrv2d_(int *ConTxt, F_CHAR uplo, F_CHAR diag, int *m, int *n, double *A, int *lda, int *rsrc, int *csrc)
Definition: dtrrv2d_.c:7
Mpaddress
#define Mpaddress(para)
Definition: Bdef.h:262
RT_RV
#define RT_RV
Definition: Bdef.h:106
F_VOID_FUNC
#define F_VOID_FUNC
Definition: Bdef.h:232
bLaCsCoNtExT::scp
BLACSSCOPE * scp
Definition: Bdef.h:26
Bdef.h
PT2PTID
#define PT2PTID
Definition: Bdef.h:77
BI_AuxBuff
BLACBUFF BI_AuxBuff
Definition: BI_GlobalVars.c:10
bLaCbUfF::dtype
MPI_Datatype dtype
Definition: Bdef.h:60
BI_Srecv
void BI_Srecv(BLACSCONTEXT *ctxt, int src, int msgid, BLACBUFF *bp)
Definition: BI_Srecv.c:3
BI_ArgCheck
void BI_ArgCheck(int ConTxt, int RoutType, char *routine, char scope, char uplo, char diag, int m, int n, int lda, int nprocs, int *prows, int *pcols)
Definition: BI_ArgCheck.c:4
Cdtrrv2d
void Cdtrrv2d()
BI_MPI_TYPE_FREE
#define BI_MPI_TYPE_FREE(t)
Definition: Bdef.h:305
BI_UpdateBuffs
void BI_UpdateBuffs(BLACBUFF *Newbp)
Definition: BI_UpdateBuffs.c:3
BI_BuffIsFree
int BI_BuffIsFree(BLACBUFF *bp, int Wait)
Definition: BI_BuffIsFree.c:3