File: blacs2sys_handle_.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 (30 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Bdef.h"
#if (INTFACE == C_CALL)
BI_MPI_Comm Cblacs2sys_handle(int BlacsCtxt)
#else
int blacs2sys_handle_(int *BlacsCtxt)
#endif
{
#if (INTFACE == C_CALL)
   int i[2];
   extern int BI_MaxNSysCtxt;
   extern BI_MPI_Comm *BI_SysContxts;

   if (BI_F77_MPI_COMM_WORLD == NULL) Cblacs_pinfo(i, &i[1]);
   if ( (BlacsCtxt >= BI_MaxNSysCtxt) || (BlacsCtxt < 0) )
   {
      BI_BlacsErr(-1, __LINE__, __FILE__,
        "No system context corresponding to BLACS system context handle %d\n",
                  BlacsCtxt);
   }
   else if (BI_SysContxts[BlacsCtxt] == BI_MPI_COMM_NULL)
   {
      BI_BlacsErr(-1, __LINE__, __FILE__,
        "No system context corresponding to BLACS system context handle %d\n",
                  BlacsCtxt);
   }
   return(BI_SysContxts[BlacsCtxt]);
#else
   return(*BlacsCtxt);
#endif
}