File: BI_GetMpiGeType.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 (24 lines) | stat: -rw-r--r-- 579 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
#include "Bdef.h"
BI_MPI_Datatype BI_GetMpiGeType(BLACSCONTEXT *ctxt, int m, int n, int lda,
                                BI_MPI_Datatype Dtype, int *N)
{
   int info;
   BI_MPI_Datatype GeType;

/*
 * Some versions of mpich and its derivitives cannot handle 0 byte typedefs,
 * so we set type MPI_BYTE as a flag for a 0 byte message
 */
#ifdef ZeroByteTypeBug
   if ( (m < 1) || (n < 1) )
   {
      *N = 0;
      return (BI_MPI_BYTE);
   }
#endif
   *N = 1;
   BI_MPI_Type_vector(n, m, lda, Dtype, &GeType, info);
   BI_MPI_Type_commit(&GeType, info);

   return(GeType);
}