SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
blacs_init_.c
Go to the documentation of this file.
1#include "Bdef.h"
2
3#if (INTFACE == C_CALL)
4void Cblacs_gridinit(Int *ConTxt, char *order, Int nprow, Int npcol)
5#else
6F_VOID_FUNC blacs_gridinit_(Int *ConTxt, F_CHAR order, Int *nprow, Int *npcol)
7#endif
8{
9 void Cblacs_gridmap(Int *, Int *, Int, Int, Int);
10 Int *tmpgrid, *iptr;
11 Int i, j;
12
13/*
14 * Grid can be row- or column-major natural ordering when blacs_gridinit is
15 * called. Define a tmpgrid to reflect this, and call blacs_gridmap to
16 * set it up
17 */
18 iptr = tmpgrid = (Int*) malloc( Mpval(nprow)*Mpval(npcol)*sizeof(*tmpgrid) );
19 if (Mlowcase(F2C_CharTrans(order)) == 'c')
20 {
21 i = Mpval(npcol) * Mpval(nprow);
22 for (j=0; j < i; j++) iptr[j] = j;
23 }
24 else
25 {
26 for (j=0; j < Mpval(npcol); j++)
27 {
28 for (i=0; i < Mpval(nprow); i++) iptr[i] = i * Mpval(npcol) + j;
29 iptr += Mpval(nprow);
30 }
31 }
32#if (INTFACE == C_CALL)
33 Cblacs_gridmap(ConTxt, tmpgrid, nprow, nprow, npcol);
34#else
35 blacs_gridmap_(ConTxt, tmpgrid, nprow, nprow, npcol);
36#endif
37 free(tmpgrid);
38}
#define Int
Definition Bconfig.h:22
#define F2C_CharTrans(c)
Definition Bdef.h:246
#define F_VOID_FUNC
Definition Bdef.h:232
#define Mpval(para)
Definition Bdef.h:261
#define Mlowcase(C)
Definition Bdef.h:145
void Cblacs_gridmap()
void Cblacs_gridinit()
char * F_CHAR
Definition pblas.h:113
F_VOID_FUNC blacs_gridinit_(Int *ConTxt, F_CHAR order, Int *nprow, Int *npcol)
Definition blacs_init_.c:6
F_VOID_FUNC blacs_gridmap_(Int *ConTxt, Int *usermap, Int *ldup, Int *nprow0, Int *npcol0)
Definition blacs_map_.c:6