ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
dgerv2d_.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 #if (INTFACE == C_CALL)
4 void Cdgerv2d(int ConTxt, int m, int n, double *A, int lda, int rsrc, int csrc)
5 #else
6 F_VOID_FUNC dgerv2d_(int *ConTxt, int *m, int *n, double *A, int *lda,
7  int *rsrc, int *csrc)
8 #endif
9 /*
10  * -- V1.1 BLACS routine --
11  * University of Tennessee, May 1, 1996
12  * Written by Clint Whaley.
13  *
14  * Purpose
15  * =======
16  * Globally-blocking point to point general double precision receive.
17  *
18  * Arguments
19  * =========
20  *
21  * ConTxt (input) Ptr to int
22  * Index into MyConTxts00 (my contexts array).
23  *
24  * M (input) Ptr to int
25  * The number of rows of the matrix A. M >= 0.
26  *
27  * N (input) Ptr to int
28  * The number of columns of the matrix A. N >= 0.
29  *
30  * A (output) Ptr to double precision two dimensional array
31  * The m by n matrix A. Fortran77 (column-major) storage
32  * assumed.
33  *
34  * LDA (input) Ptr to int
35  * The leading dimension of the array A. LDA >= M.
36  *
37  *
38  * RSRC (input) Ptr to int
39  * The process row of the source of the matrix.
40  *
41  * CSRC (input) Ptr to int
42  * The process column of the source of the matrix.
43  *
44  *
45  * ------------------------------------------------------------------------
46  */
47 {
48 /*
49  * Prototypes and variable declarations
50  */
51  void BI_ArgCheck(int, int, char *, char, char, char, int, int, int, int,
52  int *, int *);
53  MPI_Datatype BI_GetMpiGeType(BLACSCONTEXT *, int, int, int,
54  MPI_Datatype, int *);
55  void BI_Unpack(BLACSCONTEXT *, BVOID *, BLACBUFF *, MPI_Datatype);
56  void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
57  void BI_UpdateBuffs(BLACBUFF *);
58  BLACBUFF *BI_GetBuff(int);
59  int BI_BuffIsFree(BLACBUFF *, int);
60  int tlda;
61  int ierr;
62  MPI_Datatype MatTyp;
63  BLACSCONTEXT *ctxt;
65 
66  MGetConTxt(Mpval(ConTxt), ctxt);
67 #if (BlacsDebugLvl > 0)
68  BI_ArgCheck(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m),
69  Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc));
70 #endif
71  if (Mpval(lda) < Mpval(m)) tlda = Mpval(m);
72  else tlda = Mpval(lda);
73  ctxt->scp = &ctxt->pscp;
74 
75  MatTyp = BI_GetMpiGeType(ctxt, Mpval(m), Mpval(n), tlda,
76  MPI_DOUBLE, &BI_AuxBuff.N);
77  BI_AuxBuff.Buff = (char *) A;
78  BI_AuxBuff.dtype = MatTyp;
79  BI_Srecv(ctxt, Mkpnum(ctxt, Mpval(rsrc), Mpval(csrc)), PT2PTID, &BI_AuxBuff);
80  ierr=BI_MPI_TYPE_FREE(&MatTyp);
81  if (BI_ActiveQ) BI_UpdateBuffs(NULL);
82 }
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
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
Mpval
#define Mpval(para)
Definition: Bdef.h:261
bLaCsCoNtExT
Definition: Bdef.h:23
Mkpnum
#define Mkpnum(ctxt, prow, pcol)
Definition: Bdef.h:173
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
Cdgerv2d
void Cdgerv2d()
BI_GetMpiGeType
MPI_Datatype BI_GetMpiGeType(BLACSCONTEXT *ctxt, int m, int n, int lda, MPI_Datatype Dtype, int *N)
Definition: BI_GetMpiGeType.c:2
PT2PTID
#define PT2PTID
Definition: Bdef.h:77
BI_AuxBuff
BLACBUFF BI_AuxBuff
Definition: BI_GlobalVars.c:10
dgerv2d_
F_VOID_FUNC dgerv2d_(int *ConTxt, int *m, int *n, double *A, int *lda, int *rsrc, int *csrc)
Definition: dgerv2d_.c:6
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
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