Skip to content

Commit

Permalink
Merge pull request #580 from slayoo/cleanup
Browse files Browse the repository at this point in the history
minimalistic test_mpi + cleanup around MPICH->MPI (we accept any MPI implementation)
  • Loading branch information
slayoo committed Mar 12, 2019
2 parents 6523151 + 0514675 commit c074e97
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ install:
- if [[ $DEPS == 'FULL' && $TRAVIS_OS_NAME == 'linux' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DLIBPROJ4=ON"; fi
- if [[ $DEPS == 'MINI' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DLIBPROJ4=OFF"; fi

# MPICH
# MPI
- if [[ $DEPS == 'FULL' && $TRAVIS_OS_NAME == 'linux' ]]; then export APT_PACKAGES="${APT_PACKAGES} libmpich-dev"; fi
# TODO conflict - if [[ $DEPS == 'FULL' && $TRAVIS_OS_NAME == 'osx' ]]; then export BREW_PACKAGES="${BREW_PACKAGES} mpich"; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPICH=OFF"; fi
- if [[ $DEPS == 'FULL' && $TRAVIS_OS_NAME == 'linux' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPICH=ON"; fi
- if [[ $DEPS == 'MINI' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPICH=OFF"; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPI=OFF"; fi
- if [[ $DEPS == 'FULL' && $TRAVIS_OS_NAME == 'linux' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPI=ON"; fi
- if [[ $DEPS == 'MINI' ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DMPI=OFF"; fi

# Python & NumPy (installing always as needed for the Python module build)
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export APT_PACKAGES="${APT_PACKAGES} python-dev python-numpy-dev"; fi
Expand Down
44 changes: 22 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ set(FFTWDIR "" CACHE PATH "GDL: Specifiy the FFTW directory tree")
set(LIBPROJ4 OFF CACHE BOOL "GDL: Enable LIBPROJ4 ?")
set(LIBPROJ4DIR "" CACHE PATH "GDL: Specifiy the LIBPROJ4 directory tree")

set(MPICH OFF CACHE BOOL "GDL: Enable MPICH ?")
set(MPICHDIR "" CACHE PATH "GDL: Specify the MPICH (experimental) directory tree")
set(MPI OFF CACHE BOOL "GDL: Enable MPI ?")
set(MPIDIR "" CACHE PATH "GDL: Specify the MPI (experimental) directory tree")

set(PYTHON ON CACHE BOOL "GDL: Enable Python ?")
set(PYTHONDIR "" CACHE PATH "GDL: Specifiy the use Python directory tree")
Expand Down Expand Up @@ -795,22 +795,22 @@ if(LIBPROJ4)
endif(LIBPROJ4_FOUND)
endif(LIBPROJ4)

# mpich (experimental)
# -DMPICH=ON|OFF
# -DMPICHDIR=DIR
if(MPICH)
set(CMAKE_PREFIX_PATH ${MPICHDIR})
# MPI (experimental)
# -DMPI=ON|OFF
# -DMPIDIR=DIR
if(MPI)
set(CMAKE_PREFIX_PATH ${MPIDIR})
find_package(MPI QUIET)
set(USE_MPI ${MPI_FOUND})
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
set(LIBRARIES ${LIBRARIES} ${MPI_LIBRARIES})
else(MPI_FOUND)
message(FATAL_ERROR "MPICH is required but was not found.\n"
"Use -DMPICHDIR=DIR to specify the MPICH directory tree.\n"
"Use -DMPICH=OFF to not use it.")
message(FATAL_ERROR "MPI is required but was not found.\n"
"Use -DMPIDIR=DIR to specify the MPI directory tree.\n"
"Use -DMPI=OFF to not use it.")
endif(MPI_FOUND)
endif(MPICH)
endif(MPI)

# python
# -DPYTHON=ON|OFF
Expand Down Expand Up @@ -1147,17 +1147,17 @@ else(OPENMP AND OPENMP_FOUND)
message("OpenMP support OFF")
endif(OPENMP AND OPENMP_FOUND)
set(WXWIDGETS_LIBRARIES ${wxWidgets_LIBRARIES})
module(WXWIDGETS "WxWidgets ")
module(MAGICK "ImageMagick")
module(TIFF "TIFF ")
module(GEOTIFF "GeoTIFF ")
module(NETCDF "NetCDF ")
module(HDF "HDF4 ")
module(HDF5 "HDF5 ")
module(FFTW "FFTW ")
module(LIBPROJ4 "Libproj4 ")
set(MPICH_LIBRARIES ${MPI_LIBRARIES})
module(MPICH "MPICH ")
module(WXWIDGETS "WxWidgets ")
module(MAGICK "ImageMagick ")
module(TIFF "TIFF ")
module(GEOTIFF "GeoTIFF ")
module(NETCDF "NetCDF ")
module(HDF "HDF4 ")
module(HDF5 "HDF5 ")
module(FFTW "FFTW ")
module(LIBPROJ4 "Libproj4 ")
set(MPI_LIBRARIES ${MPI_LIBRARIES})
module(MPI "MPI ")
module(PYTHON "Python ")
module(UDUNITS "UDUNITS-2 ")
module(EIGEN3 "EIGEN3 ")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The table below summarises GDL mandatory and optional dependencies along with th
| [FFTW](http://www.fftw.org/) | + | + | + | + | + | + | + | + |
| [PROJ.4](http://proj4.org/) | - | - | - | + | - | + | - | + |
| [GSHHG](http://www.soest.hawaii.edu/wessel/gshhg/) | - | - | - | + | - | - | - | + |
| [MPICH](https://www.mpich.org/) | - | - | - | - | - | + | - | + |
| [MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface) | - | - | - | - | - | + | - | + |
| [Python](https://www.python.org/)/[NumPy](http://www.numpy.org/) | + | + | + | + | + | + | - | + |
| [udunits](https://www.unidata.ucar.edu/software/udunits/) | + | + | + | + | + | + | + | + |
| [Eigen](https://eigen.tuxfamily.org/) | + | + | + | + | + | + | + | + |
Expand Down
1 change: 1 addition & 0 deletions testsuite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ TESTS = \
test_modulo.pro \
test_moment.pro \
test_mpfit.pro \
test_mpi.pro \
test_multiroots.pro \
test_n_tags.pro \
test_nans_in_sort_and_median.pro \
Expand Down
10 changes: 10 additions & 0 deletions testsuite/test_mpi.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pro test_mpi
has_mpi = ~ (execute("rank=mpidl_comm_rank()") eq 0)
if ~has_mpi then exit, status=77

rank = mpidl_comm_rank()
size = mpidl_comm_size()
print, rank, size
if rank ne 0 then exit, status=1
if size ne 1 then exit, status=1
end

0 comments on commit c074e97

Please sign in to comment.