1 #include "Bdef.h"
BI_GetMpiGeType(BLACSCONTEXT * ctxt,int m,int n,int lda,BI_MPI_Datatype Dtype,int * N)2 BI_MPI_Datatype BI_GetMpiGeType(BLACSCONTEXT *ctxt, int m, int n, int lda,
3 BI_MPI_Datatype Dtype, int *N)
4 {
5 int info;
6 BI_MPI_Datatype GeType;
7
8 /*
9 * Some versions of mpich and its derivitives cannot handle 0 byte typedefs,
10 * so we set type MPI_BYTE as a flag for a 0 byte message
11 */
12 #ifdef ZeroByteTypeBug
13 if ( (m < 1) || (n < 1) )
14 {
15 *N = 0;
16 return (BI_MPI_BYTE);
17 }
18 #endif
19 *N = 1;
20 BI_MPI_Type_vector(n, m, lda, Dtype, &GeType, info);
21 BI_MPI_Type_commit(&GeType, info);
22
23 return(GeType);
24 }
25