5 int ctxt, pstart, row_major_in, row_major_out, P, Q;
8 int nctxt, P0, Q0, Np, i, *g;
12 if (Np+pstart > P0*Q0)
14 fprintf(stderr,
"Illegal reshape command in %s\n",__FILE__);
17 g = (
int *) malloc(Np *
sizeof(
int));
20 fprintf(stderr,
"Cannot allocate memory in %s\n",__FILE__);
26 for (i=0; i != Np; i++)
27 g[(i%Q)*P+i/Q] =
Cblacs_pnum(ctxt, (pstart+i)/Q0, (pstart+i)%Q0);
29 for (i=0; i != Np; i++)
30 g[i] =
Cblacs_pnum(ctxt, (pstart+i)/Q0, (pstart+i)%Q0);
35 for (i=0; i != Np; i++)
36 g[(i%Q)*P+i/Q] =
Cblacs_pnum(ctxt, (pstart+i)%P0, (pstart+i)/P0);
38 for (i=0; i != Np; i++)
39 g[i] =
Cblacs_pnum(ctxt, (pstart+i)%P0, (pstart+i)/P0);
49 int *ctxt, *pstart, *row_major_in, *row_major_out, *P, *Q;
56 int *ctxt, *pstart, *row_major_in, *row_major_out, *P, *Q;
63 int *ctxt, *pstart, *row_major_in, *row_major_out, *P, *Q;
70 int *ctxt, *pstart, *row_major_in, *row_major_out, *P, *Q;