4 void BI_ArgCheck(
int ConTxt,
int RoutType,
char *routine,
char scope,
5 char uplo,
char diag,
int m,
int n,
int lda,
int nprocs,
6 int *prows,
int *pcols)
8 #if (BlacsDebugLvl > 0)
10 int i=1, prow, pcol, Ng, nprow, npcol, myrow, mycol;
14 Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol);
16 if ( (scope !=
'r') && (scope !=
'c') && (scope !=
'a') )
17 BI_BlacsErr(ConTxt, -1, routine,
"Unknown scope, scope=%c", scope);
18 if ( (uplo !=
'u') && (uplo !=
'l') )
22 "UPLO=%c, will be assumed to mean LOWER", uplo);
25 if ( (diag !=
'u') && (diag !=
'n') )
28 "DIAG=%c, will be assumed to mean NON-UNIT", diag);
33 BI_BlacsErr(ConTxt, -1, routine,
"Illegal number of rows, M=%d", m);
35 BI_BlacsErr(ConTxt, -1, routine,
"Illegal number of columns, N=%d", n);
38 "Illegal LDA, LDA=%d, M=%d; LDA assumed to be %d",
42 if ( (RoutType ==
RT_RV) || (RoutType ==
RT_BR) ) srcdest =
"SRC";
43 else srcdest =
"DEST";
45 if (RoutType ==
RT_SD)
47 if ( (nprocs > Ng) || (nprocs < 0) )
49 "Trying to send to %d procs, but only %d in grid",
53 for (i=0; i < nprocs; i++)
58 if ( (prow < 0) || (prow >= nprow) )
60 if ( !((RoutType ==
RT_COMB) && (prow == -1)) )
62 "R%s out of range; R%s=%d, NPROW=%d",
63 srcdest, srcdest, prow, nprow);
65 if ( (pcol < 0) || (pcol >= npcol) )
67 if ( !((RoutType ==
RT_COMB) && (prow == -1)) )
69 "C%s out of range; C%s=%d, NPCOL=%d",
70 srcdest, srcdest, pcol, npcol);
72 if (RoutType ==
RT_SD)
74 if ( (prow == myrow) && (pcol == mycol) )
75 BI_BlacsWarn(ConTxt, -1, routine,
"Node sending message to itself");
77 else if (RoutType ==
RT_RV)
79 if ( (prow == myrow) && (pcol == mycol) )
81 "Node recving message from itself");
83 else if (RoutType ==
RT_BR)
85 if ( (prow == myrow) && (pcol == mycol) )
87 "Node tries to recv its own broadcast");
93 "Row broadcast: MYROW=%d, but RSRC=%d",
96 else if (scope ==
'c')
101 "Column broadcast: MYCOL=%d, but CSRC=%d",