11 Int nctxt, P0, Q0, Np, i, *g;
15 if (Np+pstart > P0*Q0)
17 fprintf(stderr,
"Illegal reshape command in %s\n",__FILE__);
20 g = (
Int *) malloc(Np *
sizeof(
Int));
23 fprintf(stderr,
"Cannot allocate memory in %s\n",__FILE__);
29 for (i=0; i != Np; i++)
30 g[(i%Q)*P+i/Q] =
Cblacs_pnum(ctxt, (pstart+i)/Q0, (pstart+i)%Q0);
32 for (i=0; i != Np; i++)
33 g[i] =
Cblacs_pnum(ctxt, (pstart+i)/Q0, (pstart+i)%Q0);
38 for (i=0; i != Np; i++)
39 g[(i%Q)*P+i/Q] =
Cblacs_pnum(ctxt, (pstart+i)%P0, (pstart+i)/P0);
41 for (i=0; i != Np; i++)
42 g[i] =
Cblacs_pnum(ctxt, (pstart+i)%P0, (pstart+i)/P0);
Int sl_gridreshape__(Int *ctxt, Int *pstart, Int *row_major_in, Int *row_major_out, Int *P, Int *Q)
Int sl_gridreshape(Int *ctxt, Int *pstart, Int *row_major_in, Int *row_major_out, Int *P, Int *Q)
Int sl_gridreshape_(Int *ctxt, Int *pstart, Int *row_major_in, Int *row_major_out, Int *P, Int *Q)
Int SL_GRIDRESHAPE(Int *ctxt, Int *pstart, Int *row_major_in, Int *row_major_out, Int *P, Int *Q)
Int SL_Cgridreshape(Int ctxt, Int pstart, Int row_major_in, Int row_major_out, Int P, Int Q)