ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
BI_Arecv.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 void BI_Arecv(BLACSCONTEXT *ctxt, int src, int msgid, BLACBUFF *bp)
4 {
5  int i, info, errclass;
6 
7  info=MPI_Irecv(bp->Buff, bp->N, bp->dtype, src, msgid, ctxt->scp->comm,
8  &bp->Aops[bp->nAops]);
9  while(info != MPI_SUCCESS)
10  {
11  i=MPI_Error_class(info, &errclass);
12  if ( (errclass != MPI_ERR_UNKNOWN) && (errclass != MPI_ERR_OTHER) &&
13  (errclass != MPI_ERR_INTERN) )
14  {
15  Mmpierror(info, "MPI_Irecv", ctxt, __LINE__, __FILE__);
16  BI_BlacsErr(BI_ContxtNum(ctxt), __LINE__, __FILE__,
17  "MPI error %d on call to MPI_Irecv", info);
18  }
19 #if (BlacsDebugLvl > 0)
20  else BI_BlacsWarn(BI_ContxtNum(ctxt), __LINE__, __FILE__,
21 "MPI error %d assumed to mean out of non-blocking resources on call to MPI_Irecv",
22  info);
23 #endif
24  info=MPI_Irecv(bp->Buff, bp->N, bp->dtype, src, msgid, ctxt->scp->comm,
25  &bp->Aops[bp->nAops]);
26  }
27  bp->nAops++;
28 /*
29  * Signal if we need to use status to figure out true length of received message
30  * We only need do this if we are doing our own buffering
31  */
32 #ifndef MpiBuffGood
33  if (bp->dtype == MPI_PACKED) bp->N = -bp->nAops;
34 #endif
35 }
bLaCbUfF::Buff
char * Buff
Definition: Bdef.h:56
Mmpierror
#define Mmpierror(ierr, rout, ctxt, line, file)
Definition: Bdef.h:217
bLaCbUfF
Definition: Bdef.h:54
bLaCbUfF::N
int N
Definition: Bdef.h:61
bLaCbUfF::Aops
MPI_Request * Aops
Definition: Bdef.h:59
bLaCsCoNtExT
Definition: Bdef.h:23
bLaCbUfF::nAops
int nAops
Definition: Bdef.h:58
bLaCsCoNtExT::scp
BLACSSCOPE * scp
Definition: Bdef.h:26
Bdef.h
bLaCsScOpE::comm
MPI_Comm comm
Definition: Bdef.h:15
BI_Arecv
void BI_Arecv(BLACSCONTEXT *ctxt, int src, int msgid, BLACBUFF *bp)
Definition: BI_Arecv.c:3
bLaCbUfF::dtype
MPI_Datatype dtype
Definition: Bdef.h:60
BI_BlacsErr
void BI_BlacsErr(int ConTxt, int line, char *file, char *form,...)
Definition: BI_BlacsErr.c:3
BI_BlacsWarn
void BI_BlacsWarn(int ConTxt, int line, char *file, char *form,...)
Definition: BI_BlacsWarn.c:3
BI_ContxtNum
int BI_ContxtNum(BLACSCONTEXT *ctxt)
Definition: BI_ContxtNum.c:3