SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ localindice() [2/2]

Int localindice ( Int  ig,
Int  jg,
Int  templateheight,
Int  templatewidth,
MDESC a 
)

Definition at line 267 of file pgemraux.c.

270{
271 Int vtemp, htemp, vsubtemp, hsubtemp, il, jl;
272 assert(ig >= 0 && ig < a->m && jg >= 0 && jg < a->n);
273 /* coordinates in global matrix with the tests in intersect, ig MUST BE in
274 * [0..m] and jg in [0..n] */
275 /* coordinates of the template that "owns" the element */
276 vtemp = ig / templateheight;
277 htemp = jg / templatewidth;
278 /* coordinates of the element in the subblock of the (vtemp, htemp)
279 * template */
280 vsubtemp = ig % a->nbrow;
281 hsubtemp = jg % a->nbcol;
282 /* coordinates of the element in the local block of the processor */
283 il = a->nbrow * vtemp + vsubtemp;
284 jl = a->nbcol * htemp + hsubtemp;
285 assert(il < a->lda);
286#ifndef NDEBUG
287 {
288 Int pr, pc, p, q, lp, lq;
289 Cblacs_gridinfo(a->ctxt, &p, &q, &pr, &pc);
290 p = templateheight / a->nbrow;
291 q = templatewidth / a->nbcol;
292 lp = ig % templateheight / a->nbrow;
293 lq = jg % templatewidth / a->nbcol;
294 assert(lp == SHIFT(pr, a->sprow, p));
295 assert(lq == SHIFT(pc, a->spcol, q));
296 }
297#endif
298 return (jl * a->lda + il);
299}
#define Int
Definition Bconfig.h:22
#define SHIFT(row, sprow, nbrow)
Definition pgemraux.c:41
void Cblacs_gridinfo()
Int spcol
Definition pcgemr.c:171
Int nbcol
Definition pcgemr.c:169
Int sprow
Definition pcgemr.c:170
Int nbrow
Definition pcgemr.c:168
Int ctxt
Definition pcgemr.c:165
Int lda
Definition pcgemr.c:172
Here is the call graph for this function: