ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pcgemr.c
Go to the documentation of this file.
1 #include "redist.h"
143 #define static2 static
144 #if defined(Add_) || defined(f77IsF2C)
145 #define fortran_mr2d pcgemr2do_
146 #define fortran_mr2dnew pcgemr2d_
147 #elif defined(UpCase)
148 #define fortran_mr2dnew PCGEMR2D
149 #define fortran_mr2d PCGEMR2DO
150 #define ccopy_ CCOPY
151 #define clacpy_ CLACPY
152 #else
153 #define fortran_mr2d pcgemr2do
154 #define fortran_mr2dnew pcgemr2d
155 #define ccopy_ ccopy
156 #define clacpy_ clacpy
157 #endif
158 #define Clacpy Ccgelacpy
159 void Clacpy();
160 typedef struct {
161  float r, i;
162 } complex;
163 typedef struct {
164  int desctype;
165  int ctxt;
166  int m;
167  int n;
168  int nbrow;
169  int nbcol;
170  int sprow;
171  int spcol;
172  int lda;
173 } MDESC;
174 #define BLOCK_CYCLIC_2D 1
175 typedef struct {
176  int lstart;
177  int len;
178 } IDESC;
179 #define SHIFT(row,sprow,nbrow) ((row)-(sprow)+ ((row) >= (sprow) ? 0 : (nbrow)))
180 #define max(A,B) ((A)>(B)?(A):(B))
181 #define min(A,B) ((A)>(B)?(B):(A))
182 #define DIVUP(a,b) ( ((a)-1) /(b)+1)
183 #define ROUNDUP(a,b) (DIVUP(a,b)*(b))
184 #ifdef MALLOCDEBUG
185 #define malloc mymalloc
186 #define free myfree
187 #define realloc myrealloc
188 #endif
189 /* Cblacs */
190 extern void Cblacs_pcoord();
191 extern int Cblacs_pnum();
192 extern void Csetpvmtids();
193 extern void Cblacs_get();
194 extern void Cblacs_pinfo();
195 extern void Cblacs_gridinfo();
196 extern void Cblacs_gridinit();
197 extern void Cblacs_exit();
198 extern void Cblacs_gridexit();
199 extern void Cblacs_setup();
200 extern void Cigebs2d();
201 extern void Cigebr2d();
202 extern void Cigesd2d();
203 extern void Cigerv2d();
204 extern void Cigsum2d();
205 extern void Cigamn2d();
206 extern void Cigamx2d();
207 extern void Ccgesd2d();
208 extern void Ccgerv2d();
209 /* lapack */
210 void clacpy_();
211 /* aux fonctions */
212 extern int localindice();
213 extern void *mr2d_malloc();
214 extern int ppcm();
215 extern int localsize();
216 extern int memoryblocksize();
217 extern int changeorigin();
218 extern void paramcheck();
219 /* tools and others function */
220 #define scanD0 cgescanD0
221 #define dispmat cgedispmat
222 #define setmemory cgesetmemory
223 #define freememory cgefreememory
224 #define scan_intervals cgescan_intervals
225 extern void scanD0();
226 extern void dispmat();
227 extern void setmemory();
228 extern void freememory();
229 extern int scan_intervals();
230 extern void Cpcgemr2do();
231 extern void Cpcgemr2d();
232 /* some defines for Cpcgemr2do */
233 #define SENDBUFF 0
234 #define RECVBUFF 1
235 #define SIZEBUFF 2
236 #if 0
237 #define DEBUG
238 #endif
239 #ifndef DEBUG
240 #define NDEBUG
241 #endif
242 #include <stdio.h>
243 #include <stdlib.h>
244 #include <assert.h>
245 #define DESCLEN 9
246 void
247 fortran_mr2d(m, n, A, ia, ja, desc_A,
248  B, ib, jb, desc_B)
249  int *ia, *ib, *ja, *jb, *m, *n;
250  int desc_A[DESCLEN], desc_B[DESCLEN];
251  complex *A, *B;
252 {
253  Cpcgemr2do(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
254  B, *ib, *jb, (MDESC *) desc_B);
255  return;
256 }
257 void
258 fortran_mr2dnew(m, n, A, ia, ja, desc_A,
259  B, ib, jb, desc_B, gcontext)
260  int *ia, *ib, *ja, *jb, *m, *n;
261  int desc_A[DESCLEN], desc_B[DESCLEN];
262  complex *A, *B;
263  int *gcontext;
264 {
265  Cpcgemr2d(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
266  B, *ib, *jb, (MDESC *) desc_B, *gcontext);
267  return;
268 }
269 static2 void init_chenille();
270 static2 int inter_len();
271 static2 int block2buff();
272 static2 void buff2block();
273 static2 void gridreshape();
274 void
276  ptrmyblock, ia, ja, ma,
277  ptrmynewblock, ib, jb, mb)
278  complex *ptrmyblock, *ptrmynewblock;
279 /* pointers to the memory location of the matrix and the redistributed matrix */
280  MDESC *ma;
281  MDESC *mb;
282  int ia, ja, ib, jb, m, n;
283 {
284  int dummy, nprocs;
285  int gcontext;
286  /* first we initialize a global grid which serve as a reference to
287  * communicate from grid a to grid b */
288  Cblacs_pinfo(&dummy, &nprocs);
289  Cblacs_get(0, 0, &gcontext);
290  Cblacs_gridinit(&gcontext, "R", 1, nprocs);
291  Cpcgemr2d(m, n, ptrmyblock, ia, ja, ma,
292  ptrmynewblock, ib, jb, mb, gcontext);
293  Cblacs_gridexit(gcontext);
294 }
295 #define NBPARAM 20 /* p0,q0,p1,q1, puis ma,na,mba,nba,rowa,cola puis
296  * idem B puis ia,ja puis ib,jb */
297 #define MAGIC_MAX 100000000
298 void
300  ptrmyblock, ia, ja, ma,
301  ptrmynewblock, ib, jb, mb, globcontext)
302  complex *ptrmyblock, *ptrmynewblock;
303 /* pointers to the memory location of the matrix and the redistributed matrix */
304  MDESC *ma;
305  MDESC *mb;
306  int ia, ja, ib, jb, m, n, globcontext;
307 {
308  complex *ptrsendbuff, *ptrrecvbuff, *ptrNULL = 0;
309  complex *recvptr;
310  MDESC newa, newb;
311  int *proc0, *proc1, *param;
312  int mypnum, myprow0, mypcol0, myprow1, mypcol1, nprocs;
313  int i, j;
314  int nprow, npcol, gcontext;
315  int recvsize, sendsize;
316  IDESC *h_inter; /* to store the horizontal intersections */
317  IDESC *v_inter; /* to store the vertical intersections */
318  int hinter_nb, vinter_nb; /* number of intrsections in both directions */
319  int dummy;
320  int p0, q0, p1, q1;
321  int *ra, *ca;
322  /* end of variables */
323  /* To simplify further calcul we change the matrix indexation from
324  * 1..m,1..n (fortran) to 0..m-1,0..n-1 */
325  if (m == 0 || n == 0)
326  return;
327  ia -= 1;
328  ja -= 1;
329  ib -= 1;
330  jb -= 1;
331  Cblacs_gridinfo(globcontext, &nprow, &npcol, &dummy, &mypnum);
332  gcontext = globcontext;
333  nprocs = nprow * npcol;
334  /* if the global context that is given to us has not the shape of a line
335  * (nprow != 1), create a new context. TODO: to be optimal, we should
336  * avoid this because it is an uncessary synchronisation */
337  if (nprow != 1) {
338  gridreshape(&gcontext);
339  Cblacs_gridinfo(gcontext, &dummy, &dummy, &dummy, &mypnum);
340  }
341  Cblacs_gridinfo(ma->ctxt, &p0, &q0, &myprow0, &mypcol0);
342  /* compatibility T3D, must check myprow and mypcol are within bounds */
343  if (myprow0 >= p0 || mypcol0 >= q0)
344  myprow0 = mypcol0 = -1;
345  assert((myprow0 < p0 && mypcol0 < q0) || (myprow0 == -1 && mypcol0 == -1));
346  Cblacs_gridinfo(mb->ctxt, &p1, &q1, &myprow1, &mypcol1);
347  if (myprow1 >= p1 || mypcol1 >= q1)
348  myprow1 = mypcol1 = -1;
349  assert((myprow1 < p1 && mypcol1 < q1) || (myprow1 == -1 && mypcol1 == -1));
350  /* exchange the missing parameters among the processors: shape of grids and
351  * location of the processors */
352  param = (int *) mr2d_malloc(3 * (nprocs * 2 + NBPARAM) * sizeof(int));
353  ra = param + nprocs * 2 + NBPARAM;
354  ca = param + (nprocs * 2 + NBPARAM) * 2;
355  for (i = 0; i < nprocs * 2 + NBPARAM; i++)
356  param[i] = MAGIC_MAX;
357  proc0 = param + NBPARAM;
358  proc1 = param + NBPARAM + nprocs;
359  /* we calulate proc0 and proc1 that will give the number of a proc in
360  * respectively a or b in the global context */
361  if (myprow0 >= 0) {
362  proc0[myprow0 * q0 + mypcol0] = mypnum;
363  param[0] = p0;
364  param[1] = q0;
365  param[4] = ma->m;
366  param[5] = ma->n;
367  param[6] = ma->nbrow;
368  param[7] = ma->nbcol;
369  param[8] = ma->sprow;
370  param[9] = ma->spcol;
371  param[10] = ia;
372  param[11] = ja;
373  }
374  if (myprow1 >= 0) {
375  proc1[myprow1 * q1 + mypcol1] = mypnum;
376  param[2] = p1;
377  param[3] = q1;
378  param[12] = mb->m;
379  param[13] = mb->n;
380  param[14] = mb->nbrow;
381  param[15] = mb->nbcol;
382  param[16] = mb->sprow;
383  param[17] = mb->spcol;
384  param[18] = ib;
385  param[19] = jb;
386  }
387  Cigamn2d(gcontext, "All", "H", 2 * nprocs + NBPARAM, 1, param, 2 * nprocs + NBPARAM,
388  ra, ca, 2 * nprocs + NBPARAM, -1, -1);
389  newa = *ma;
390  newb = *mb;
391  ma = &newa;
392  mb = &newb;
393  if (myprow0 == -1) {
394  p0 = param[0];
395  q0 = param[1];
396  ma->m = param[4];
397  ma->n = param[5];
398  ma->nbrow = param[6];
399  ma->nbcol = param[7];
400  ma->sprow = param[8];
401  ma->spcol = param[9];
402  ia = param[10];
403  ja = param[11];
404  }
405  if (myprow1 == -1) {
406  p1 = param[2];
407  q1 = param[3];
408  mb->m = param[12];
409  mb->n = param[13];
410  mb->nbrow = param[14];
411  mb->nbcol = param[15];
412  mb->sprow = param[16];
413  mb->spcol = param[17];
414  ib = param[18];
415  jb = param[19];
416  }
417  for (i = 0; i < NBPARAM; i++) {
418  if (param[i] == MAGIC_MAX) {
419  fprintf(stderr, "xxGEMR2D:something wrong in the parameters\n");
420  exit(1);
421  }
422  }
423 #ifndef NDEBUG
424  for (i = 0; i < p0 * q0; i++)
425  assert(proc0[i] >= 0 && proc0[i] < nprocs);
426  for (i = 0; i < p1 * q1; i++)
427  assert(proc1[i] >= 0 && proc1[i] < nprocs);
428 #endif
429  /* check the validity of the parameters */
430  paramcheck(ma, ia, ja, m, n, p0, q0, gcontext);
431  paramcheck(mb, ib, jb, m, n, p1, q1, gcontext);
432  /* we change the problem so that ia < a->nbrow ... andia + m = a->m ... */
433  {
434  int decal;
435  ia = changeorigin(myprow0, ma->sprow, p0,
436  ma->nbrow, ia, &decal, &ma->sprow);
437  ptrmyblock += decal;
438  ja = changeorigin(mypcol0, ma->spcol, q0,
439  ma->nbcol, ja, &decal, &ma->spcol);
440  ptrmyblock += decal * ma->lda;
441  ma->m = ia + m;
442  ma->n = ja + n;
443  ib = changeorigin(myprow1, mb->sprow, p1,
444  mb->nbrow, ib, &decal, &mb->sprow);
445  ptrmynewblock += decal;
446  jb = changeorigin(mypcol1, mb->spcol, q1,
447  mb->nbcol, jb, &decal, &mb->spcol);
448  ptrmynewblock += decal * mb->lda;
449  mb->m = ib + m;
450  mb->n = jb + n;
451  if (p0 == 1)
452  ma->nbrow = ma->m;
453  if (q0 == 1)
454  ma->nbcol = ma->n;
455  if (p1 == 1)
456  mb->nbrow = mb->m;
457  if (q1 == 1)
458  mb->nbcol = mb->n;
459 #ifndef NDEBUG
460  paramcheck(ma, ia, ja, m, n, p0, q0, gcontext);
461  paramcheck(mb, ib, jb, m, n, p1, q1, gcontext);
462 #endif
463  }
464  /* We compute the size of the memory buffer ( we choose the worst case,
465  * when the buffer sizes == the memory block sizes). */
466  if (myprow0 >= 0 && mypcol0 >= 0) {
467  /* Initialize pointer variables */
468  setmemory(&ptrsendbuff, memoryblocksize(ma));
469  }; /* if (mypnum < p0 * q0) */
470  if (myprow1 >= 0 && mypcol1 >= 0) {
471  /* Initialize pointer variables */
472  setmemory(&ptrrecvbuff, memoryblocksize(mb));
473  }; /* if (mypnum < p1 * q1) */
474  /* allocing room for the tabs, alloc for the worst case,local_n or local_m
475  * intervals, in fact the worst case should be less, perhaps half that,I
476  * should think of that one day. */
477  h_inter = (IDESC *) mr2d_malloc(DIVUP(ma->n, q0 * ma->nbcol) *
478  ma->nbcol * sizeof(IDESC));
479  v_inter = (IDESC *) mr2d_malloc(DIVUP(ma->m, p0 * ma->nbrow)
480  * ma->nbrow * sizeof(IDESC));
481  /* We go for the scanning of indices. For each processor including mypnum,
482  * we fill the sendbuff buffer (scanD0(SENDBUFF)) and when it is done send
483  * it. Then for each processor, we compute the size of message to be
484  * receive scanD0(SIZEBUFF)), post a receive and then allocate the elements
485  * of recvbuff the right place (scanD)(RECVBUFF)) */
486  recvptr = ptrrecvbuff;
487  {
488  int tot, myrang, step, sens;
489  int *sender, *recver;
490  int mesending, merecving;
491  tot = max(p0 * q0, p1 * q1);
492  init_chenille(mypnum, nprocs, p0 * q0, proc0, p1 * q1, proc1,
493  &sender, &recver, &myrang);
494  if (myrang == -1)
495  goto after_comm;
496  mesending = myprow0 >= 0;
497  assert(sender[myrang] >= 0 || !mesending);
498  assert(!mesending || proc0[sender[myrang]] == mypnum);
499  merecving = myprow1 >= 0;
500  assert(recver[myrang] >= 0 || !merecving);
501  assert(!merecving || proc1[recver[myrang]] == mypnum);
502  step = tot - 1 - myrang;
503  do {
504  for (sens = 0; sens < 2; sens++) {
505  /* be careful here, when we communicating with ourselves, we must
506  * send first (myrang > step == 0) */
507  if (mesending && recver[step] >= 0 &&
508  (sens == 0)) {
509  i = recver[step] / q1;
510  j = recver[step] % q1;
511  vinter_nb = scan_intervals('r', ia, ib, m, ma, mb, p0, p1, myprow0, i,
512  v_inter);
513  hinter_nb = scan_intervals('c', ja, jb, n, ma, mb, q0, q1, mypcol0, j,
514  h_inter);
515  sendsize = block2buff(v_inter, vinter_nb, h_inter, hinter_nb,
516  ptrmyblock, ma, ptrsendbuff);
517  } /* if (mesending...) { */
518  if (mesending && recver[step] >= 0 &&
519  (sens == myrang > step)) {
520  i = recver[step] / q1;
521  j = recver[step] % q1;
522  if (sendsize > 0
523  && (step != myrang || !merecving)
524  ) {
525  Ccgesd2d(gcontext, sendsize, 1, ptrsendbuff, sendsize,
526  0, proc1[i * q1 + j]);
527  } /* sendsize > 0 */
528  } /* if (mesending ... */
529  if (merecving && sender[step] >= 0 &&
530  (sens == myrang <= step)) {
531  i = sender[step] / q0;
532  j = sender[step] % q0;
533  vinter_nb = scan_intervals('r', ib, ia, m, mb, ma, p1, p0, myprow1, i,
534  v_inter);
535  hinter_nb = scan_intervals('c', jb, ja, n, mb, ma, q1, q0, mypcol1, j,
536  h_inter);
537  recvsize = inter_len(hinter_nb, h_inter, vinter_nb, v_inter);
538  if (recvsize > 0) {
539  if (step == myrang && mesending) {
540  Clacpy(recvsize, 1,
541  ptrsendbuff, recvsize,
542  ptrrecvbuff, recvsize);
543  } else {
544  Ccgerv2d(gcontext, recvsize, 1, ptrrecvbuff, recvsize,
545  0, proc0[i * q0 + j]);
546  }
547  } /* recvsize > 0 */
548  } /* if (merecving ...) */
549  if (merecving && sender[step] >= 0 && sens == 1) {
550  buff2block(v_inter, vinter_nb, h_inter, hinter_nb,
551  recvptr, ptrmynewblock, mb);
552  } /* if (merecving...) */
553  } /* for (sens = 0) */
554  step -= 1;
555  if (step < 0)
556  step = tot - 1;
557  } while (step != tot - 1 - myrang);
558 after_comm:
559  free(sender);
560  } /* { int tot,nr,ns ...} */
561  /* don't forget to clean up things! */
562  if (myprow1 >= 0 && mypcol1 >= 0) {
563  freememory((char *) ptrrecvbuff);
564  };
565  if (myprow0 >= 0 && mypcol0 >= 0) {
566  freememory((char *) ptrsendbuff);
567  };
568  if (nprow != 1)
569  Cblacs_gridexit(gcontext);
570  free(v_inter);
571  free(h_inter);
572  free(param);
573 }/* distrib */
574 static2 void
575 init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
576  int nprocs, mypnum, n0, n1;
577  int *proc0, *proc1, **psend, **precv, *myrang;
578 {
579  int ns, nr, i, tot;
580  int *sender, *recver, *g0, *g1;
581  tot = max(n0, n1);
582  sender = (int *) mr2d_malloc((nprocs + tot) * sizeof(int) * 2);
583  recver = sender + tot;
584  *psend = sender;
585  *precv = recver;
586  g0 = recver + tot;
587  g1 = g0 + nprocs;
588  for (i = 0; i < nprocs; i++) {
589  g0[i] = -1;
590  g1[i] = -1;
591  }
592  for (i = 0; i < tot; i++) {
593  sender[i] = -1;
594  recver[i] = -1;
595  }
596  for (i = 0; i < n0; i++)
597  g0[proc0[i]] = i;
598  for (i = 0; i < n1; i++)
599  g1[proc1[i]] = i;
600  ns = 0;
601  nr = 0;
602  *myrang = -1;
603  for (i = 0; i < nprocs; i++)
604  if (g0[i] >= 0 && g1[i] >= 0) {
605  if (i == mypnum)
606  *myrang = nr;
607  sender[ns] = g0[i];
608  ns += 1;
609  recver[nr] = g1[i];
610  nr += 1;
611  assert(ns <= n0 && nr <= n1 && nr == ns);
612  }
613  for (i = 0; i < nprocs; i++)
614  if (g0[i] >= 0 && g1[i] < 0) {
615  if (i == mypnum)
616  *myrang = ns;
617  sender[ns] = g0[i];
618  ns += 1;
619  assert(ns <= n0);
620  }
621  for (i = 0; i < nprocs; i++)
622  if (g1[i] >= 0 && g0[i] < 0) {
623  if (i == mypnum)
624  *myrang = nr;
625  recver[nr] = g1[i];
626  nr += 1;
627  assert(nr <= n1);
628  }
629 }
630 #define Mlacpy(mo,no,ao,ldao,bo,ldbo) \
631 { \
632 complex *_a,*_b; \
633 int _m,_n,_lda,_ldb; \
634  int _i,_j; \
635  _m = (mo);_n = (no); \
636  _a = (ao);_b = (bo); \
637  _lda = (ldao) - _m; \
638  _ldb = (ldbo) - _m; \
639  assert(_lda >= 0 && _ldb >= 0); \
640  for (_j=0;_j<_n;_j++) { \
641  for (_i=0;_i<_m;_i++) \
642  *_b++ = *_a++; \
643  _b += _ldb; \
644  _a += _lda; \
645  } \
646 }
647 static2 int
648 block2buff(vi, vinb, hi, hinb, ptra, ma, buff)
649  int hinb, vinb;
650  IDESC *hi, *vi;
651  MDESC *ma;
652  complex *buff, *ptra;
653 {
654  int h, v, sizebuff;
655  complex *ptr2;
656  sizebuff = 0;
657  for (h = 0; h < hinb; h++) {
658  ptr2 = ptra + hi[h].lstart * ma->lda;
659  for (v = 0; v < vinb; v++) {
660  Mlacpy(vi[v].len, hi[h].len,
661  ptr2 + vi[v].lstart,
662  ma->lda,
663  buff + sizebuff, vi[v].len);
664  sizebuff += hi[h].len * vi[v].len;
665  }
666  }
667  return sizebuff;
668 }
669 static2 void
670 buff2block(vi, vinb, hi, hinb, buff, ptrb, mb)
671  int hinb, vinb;
672  IDESC *hi, *vi;
673  MDESC *mb;
674  complex *buff, *ptrb;
675 {
676  int h, v, sizebuff;
677  complex *ptr2;
678  sizebuff = 0;
679  for (h = 0; h < hinb; h++) {
680  ptr2 = ptrb + hi[h].lstart * mb->lda;
681  for (v = 0; v < vinb; v++) {
682  Mlacpy(vi[v].len, hi[h].len,
683  buff + sizebuff, vi[v].len,
684  ptr2 + vi[v].lstart,
685  mb->lda);
686  sizebuff += hi[h].len * vi[v].len;
687  }
688  }
689 }
690 static2 int
691 inter_len(hinb, hi, vinb, vi)
692  int hinb, vinb;
693  IDESC *hi, *vi;
694 {
695  int hlen, vlen, h, v;
696  hlen = 0;
697  for (h = 0; h < hinb; h++)
698  hlen += hi[h].len;
699  vlen = 0;
700  for (v = 0; v < vinb; v++)
701  vlen += vi[v].len;
702  return hlen * vlen;
703 }
704 void
705 Clacpy(m, n, a, lda, b, ldb)
706  complex *a, *b;
707  int m, n, lda, ldb;
708 {
709  int i, j;
710  lda -= m;
711  ldb -= m;
712  assert(lda >= 0 && ldb >= 0);
713  for (j = 0; j < n; j++) {
714  for (i = 0; i < m; i++)
715  *b++ = *a++;
716  b += ldb;
717  a += lda;
718  }
719 }
720 static2 void
722  int *ctxtp;
723 {
724  int ori, final; /* original context, and new context created, with
725  * line form */
726  int nprow, npcol, myrow, mycol;
727  int *usermap;
728  int i, j;
729  ori = *ctxtp;
730  Cblacs_gridinfo(ori, &nprow, &npcol, &myrow, &mycol);
731  usermap = mr2d_malloc(sizeof(int) * nprow * npcol);
732  for (i = 0; i < nprow; i++)
733  for (j = 0; j < npcol; j++) {
734  usermap[i + j * nprow] = Cblacs_pnum(ori, i, j);
735  }
736  /* Cblacs_get(0, 0, &final); */
737  Cblacs_get(ori, 10, &final);
738  Cblacs_gridmap(&final, usermap, 1, 1, nprow * npcol);
739  *ctxtp = final;
740  free(usermap);
741 }
IDESC::lstart
int lstart
Definition: pcgemr.c:176
max
#define max(A, B)
Definition: pcgemr.c:180
Cpcgemr2d
void Cpcgemr2d()
Cigerv2d
void Cigerv2d()
freememory
#define freememory
Definition: pcgemr.c:223
MDESC::ctxt
int ctxt
Definition: pcgemr.c:165
Cblacs_gridexit
void Cblacs_gridexit()
memoryblocksize
int memoryblocksize()
Cigebs2d
void Cigebs2d()
fortran_mr2dnew
#define fortran_mr2dnew
Definition: pcgemr.c:154
Cblacs_pinfo
void Cblacs_pinfo()
NBPARAM
#define NBPARAM
Definition: pcgemr.c:295
block2buff
static2 int block2buff()
dispmat
#define dispmat
Definition: pcgemr.c:221
Cblacs_gridinfo
void Cblacs_gridinfo()
complex::r
float r
Definition: pcgemr.c:161
Cpcgemr2do
void Cpcgemr2do()
Cigesd2d
void Cigesd2d()
fortran_mr2d
#define fortran_mr2d
Definition: pcgemr.c:153
MDESC::sprow
int sprow
Definition: pcgemr.c:170
gridreshape
static2 void gridreshape()
MDESC::n
int n
Definition: pcgemr.c:167
MDESC::nbcol
int nbcol
Definition: pcgemr.c:169
mr2d_malloc
void * mr2d_malloc()
init_chenille
static2 void init_chenille()
MDESC
Definition: pcgemr.c:163
localindice
int localindice()
Cblacs_exit
void Cblacs_exit()
scanD0
#define scanD0
Definition: pcgemr.c:220
clacpy_
#define clacpy_
Definition: pcgemr.c:156
MDESC::desctype
int desctype
Definition: pcgemr.c:164
IDESC
Definition: pcgemr.c:175
static2
#define static2
Definition: pcgemr.c:143
Cigamx2d
void Cigamx2d()
Cblacs_gridmap
void Cblacs_gridmap()
Cblacs_pnum
int Cblacs_pnum()
Cigebr2d
void Cigebr2d()
scan_intervals
#define scan_intervals
Definition: pcgemr.c:224
Cblacs_gridinit
void Cblacs_gridinit()
Ccgerv2d
void Ccgerv2d()
inter_len
static2 int inter_len()
MDESC::spcol
int spcol
Definition: pcgemr.c:171
Csetpvmtids
void Csetpvmtids()
Cblacs_setup
void Cblacs_setup()
buff2block
static2 void buff2block()
redist.h
Ccgesd2d
void Ccgesd2d()
paramcheck
void paramcheck()
Cigsum2d
void Cigsum2d()
Cblacs_get
void Cblacs_get()
DESCLEN
#define DESCLEN
Definition: pcgemr.c:245
localsize
int localsize()
Cblacs_pcoord
void Cblacs_pcoord()
MAGIC_MAX
#define MAGIC_MAX
Definition: pcgemr.c:297
IDESC::len
int len
Definition: pcgemr.c:177
Clacpy
#define Clacpy
Definition: pcgemr.c:158
Cigamn2d
void Cigamn2d()
DIVUP
#define DIVUP(a, b)
Definition: pcgemr.c:182
MDESC::lda
int lda
Definition: pcgemr.c:172
changeorigin
int changeorigin()
MDESC::nbrow
int nbrow
Definition: pcgemr.c:168
setmemory
#define setmemory
Definition: pcgemr.c:222
MDESC::m
int m
Definition: pcgemr.c:166
ppcm
int ppcm()
complex
Definition: pcgemr.c:160
Mlacpy
#define Mlacpy(mo, no, ao, ldao, bo, ldbo)
Definition: pcgemr.c:630