Skip to content

Commit

Permalink
Fixes after testing with mpich-3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Dec 27, 2012
1 parent e834184 commit c30f24f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mpi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
# MPICH3 example
# --------------
[mpich3]
mpi_dir = /home/devel/mpi/mpich-3.0rc1
mpi_dir = /home/devel/mpi/mpich-3.0.1
mpicc = %(mpi_dir)s/bin/mpicc
mpicxx = %(mpi_dir)s/bin/mpicxx
#include_dirs = %(mpi_dir)s/include
#libraries = mpich opa mpl rt
#libraries = mpich opa mpl rt pthread
#library_dirs = %(mpi_dir)s/lib
#runtime_library_dirs = %(library_dirs)s

Expand Down Expand Up @@ -128,6 +128,7 @@ include_dirs = %(mpi_dir)s\include
libraries = mpi
library_dirs = %(mpi_dir)s\lib


# MPICH2 example (Windows)
# ------------------------
[mpich2-windows]
Expand Down
25 changes: 25 additions & 0 deletions src/compat/mpich3.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
#ifndef PyMPI_COMPAT_MPICH3_H
#define PyMPI_COMPAT_MPICH3_H

#if defined(MPICH_NUMVERSION) && (MPICH_NUMVERSION < 30100000)

static int PyMPI_MPICH3_MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size)
{
int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr;
return MPI_Type_size_x(datatype,size);
}
#define MPI_Type_size_x PyMPI_MPICH3_MPI_Type_size_x

static int PyMPI_MPICH3_MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent)
{
int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr;
return MPI_Type_get_extent_x(datatype,lb,extent);
}
#define MPI_Type_get_extent_x PyMPI_MPICH3_MPI_Type_get_extent_x

static int PyMPI_MPICH3_MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent)
{
int ierr = MPI_Type_commit(&datatype); if (ierr) return ierr;
return MPI_Type_get_true_extent_x(datatype,lb,extent);
}
#define MPI_Type_get_true_extent_x PyMPI_MPICH3_MPI_Type_get_true_extent_x

#endif

#endif /* !PyMPI_COMPAT_MPICH3_H */

0 comments on commit c30f24f

Please sign in to comment.