13 MPI_Comm Cblacs2sys_handle(
Int BlacsCtxt);
17 Int info, i, j, *iptr;
18 Int myrow, mycol, nprow, npcol, Ng;
39 nprow =
Mpval(nprow0);
40 npcol =
Mpval(npcol0);
42 if ( (Ng >
BI_Np) || (nprow < 1) || (npcol < 1) )
44 "Illegal grid (%d x %d), #procs=%d", nprow, npcol,
BI_Np);
50 iptr = (
Int *) malloc(i*
sizeof(
Int));
51 for (j=0; j < npcol; j++)
53 for (i=0; i < nprow; i++) iptr[i*npcol+j] = usermap[j*
Mpval(ldup)+i];
55#if (INTFACE == C_CALL)
57 for (j=0; j < Ng; j++) miptr[j] = iptr[j];
58 tcomm = Cblacs2sys_handle(*ConTxt);
59 MPI_Comm_group(tcomm, &grp);
60 MPI_Group_incl(grp, Ng, miptr, &tgrp);
61 MPI_Comm_create(tcomm, tgrp, &comm);
62 MPI_Group_free(&tgrp);
72 if (comm == MPI_COMM_NULL)
106 MPI_Comm_dup(comm, &ctxt->
pscp.
comm);
107 MPI_Comm_rank(comm, &Iam);
114 MPI_Comm_split(comm, myrow, mycol, &ctxt->
rscp.
comm);
118 MPI_Comm_split(comm, mycol, myrow, &ctxt->
cscp.
comm);