File: blacs_pnum_.c

package info (click to toggle)
blacs-mpi 1.1-28.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,320 kB
  • ctags: 2,031
  • sloc: fortran: 14,968; ansic: 12,353; makefile: 531; sh: 1
file content (16 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "Bdef.h"

#if (INTFACE == C_CALL)
int Cblacs_pnum(int ConTxt, int prow, int pcol)
#else
F_INT_FUNC blacs_pnum_(int *ConTxt, int *prow, int *pcol)
#endif
{
   BLACSCONTEXT *ctxt;

   MGetConTxt(Mpval(ConTxt), ctxt);
   if ( (Mpval(prow) >= 0) && (Mpval(prow) < ctxt->cscp.Np) &&
        (Mpval(pcol) >= 0) && (Mpval(pcol) < ctxt->rscp.Np) )
      return( Mkpnum(ctxt, Mpval(prow), Mpval(pcol)) );
   else return(-1);
}