File: BI_ContxtNum.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 (17 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "Bdef.h"

int BI_ContxtNum(BLACSCONTEXT *ctxt)
/*
 *  Returns the integer ID of ctxt
 */
{
   int i;
   extern int BI_MaxNCtxt;
   extern BLACSCONTEXT **BI_MyContxts;

   if (ctxt == NULL) return(-1);
   for (i=0; i < BI_MaxNCtxt; i++) if (BI_MyContxts[i] == ctxt) break;
   if (i == BI_MaxNCtxt)
      BI_BlacsErr(-1, -1, "BLACS INTERNAL ROUTINE", "illegal context");
   return(i);
}