Skip to content

Commit a76657b

Browse files
authored
Move to C API (#271)
Works around the issues encountered last time (#169) by generating a small C program which in turn generates the necessary constants, types and offsets. To avoid the problem of link-time definitions, it uses the Fortran constants for all handles, which are converted to the C variants at `MPI_Init`. This approach has several benefits: - No need for CMake or a Fortran compiler - No implicit use of gfortran ABI for strings - Simpler to extend, as the new functions only need to be added in one place. I've also taken the liberty splitting the source into several files based on functionality, which should make it easier to find things.
1 parent 7fcee0b commit a76657b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2602
-2833
lines changed

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
/deps/VERSION
2-
/deps/build/
3-
/deps/deps.jl
4-
/deps/usr/
5-
/deps/src/
61
libjuliampi.so
72
libjuliampi.dylib
83
*.cov
94
*.mem
105
Manifest.toml
11-
deps/build.log

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dist: trusty
55
os:
66
- linux
77
- osx
8-
8+
99
julia:
1010
- 1.0
1111
- 1.1
@@ -35,9 +35,8 @@ matrix:
3535

3636
before_install:
3737
- sh ./conf/travis-install-mpi.sh $MPI_IMPL
38-
- export PATH=$HOME/OpenMPI/bin:$HOME/MPICH/bin:$PATH
39-
- export CC=mpicc
40-
- export FC=mpif90
38+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export JULIA_MPI_PATH=$HOME/$MPI_IMPL; fi
39+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$HOME/$MPI_IMPL/bin:$PATH; fi
4140
# Work around OpenMPI attempting to create overly long temporary
4241
# file names - and erroring as a result
4342
- export TMPDIR=/tmp

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = []
44
version = "0.9.0"
55

66
[deps]
7-
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
87
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
98
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
109
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -19,4 +18,4 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1918
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2019

2120
[targets]
22-
test = ["Test", "LinearAlgebra"]
21+
test = ["LinearAlgebra", "Test"]

conf/travis-install-mpi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ case "$os" in
4444
wget http://www.mpich.org/static/downloads/3.2.1/$MPICHVER.tar.gz
4545
tar -zxf $MPICHVER.tar.gz
4646
cd $MPICHVER
47-
sh ./configure --prefix=$HOME/MPICH --enable-shared > /dev/null
47+
sh ./configure --prefix=$HOME/mpich --enable-shared > /dev/null
4848
make -j > /dev/null
4949
sudo make install > /dev/null
5050
;;
@@ -55,7 +55,7 @@ case "$os" in
5555
wget --no-check-certificate https://www.open-mpi.org/software/ompi/v3.0/downloads/$OMPIVER.tar.gz
5656
tar -zxf $OMPIVER.tar.gz
5757
cd $OMPIVER
58-
sh ./configure --prefix=$HOME/OpenMPI > /dev/null
58+
sh ./configure --prefix=$HOME/openmpi > /dev/null
5959
make -j > /dev/null
6060
sudo make install > /dev/null
6161
;;

deps/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
deps.jl
2+
build.log
3+
gen_consts.c
4+
gen_consts
5+
6+
# no longer used
7+
VERSION
8+
build/
9+
usr/
10+
src/

deps/CMakeLists.txt

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)