Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
37dd466
Removed flags that are unrecognized options on all dune used
dpshelio Aug 9, 2019
67783ce
Add information on installation about the attempted version tested
dpshelio Aug 9, 2019
40bad8d
:pencil2: `std` not being used
dpshelio Aug 9, 2019
8f5d744
Adds Docker that builds and executes the tests as expected
dpshelio Aug 9, 2019
5c3ae8c
Renames INSTALL and gets it consistent around the rest of the files
dpshelio Aug 9, 2019
86123f4
Adds installation instructions within the repository - easier to track
dpshelio Aug 9, 2019
145f4ca
Update instructions to include docker
dpshelio Aug 9, 2019
ef68d9f
Sort travis file to keep in sync with the container instructions
dpshelio Aug 9, 2019
d0b86d3
Update to Zoltan 3.83 the docker and other missing bits
dpshelio Aug 9, 2019
6e7255e
Cleaned up the installation instructions to allign them to the Docker…
dpshelio Aug 9, 2019
3d02c74
Keeping all options for PETSc similar
dpshelio Aug 9, 2019
441c3ed
Update Travis configuration to use xenial and the preferred options
dpshelio Aug 9, 2019
8873ef8
[ci] Unset the CC variables as they are known to interfere with MPI
dpshelio Aug 9, 2019
e1ace7e
:whale2: :pencil2: - fix zoltan file to download
dpshelio Aug 9, 2019
dafad9c
[ci] Test to make PETSc without making it all
dpshelio Aug 9, 2019
df37479
[ci] sudify all the installation for petsc and zoltan
dpshelio Aug 9, 2019
177bfcf
[ci] delete and append lines with sed, need of two different commands
dpshelio Aug 12, 2019
2a8f96b
[docker][ci][doc] Updated PETSC repository location
dpshelio Aug 28, 2019
c365b57
[ci] Try to build a cache and use it
dpshelio Aug 28, 2019
ab46202
[ci] Removes one nn_test run to create cache
dpshelio Aug 28, 2019
af25b5d
[ci] Moved cache to a user writable
dpshelio Aug 28, 2019
c078f49
[ci] trying to get MUMPS building on cache
dpshelio Aug 28, 2019
33f5d50
[ci] installs zoltan and petsc on a cached directory
dpshelio Aug 28, 2019
0007921
[ci] only build dependencies when creating the cache
dpshelio Aug 28, 2019
e1d3986
Revert "[ci] Removes one nn_test run to create cache"
dpshelio Aug 29, 2019
e52ad56
Rename config files with `cfg` extension and propagate these changes …
dpshelio Aug 30, 2019
938db84
Adds information about running PEITS and fixes some problems
dpshelio Aug 30, 2019
86f85da
[docker] Makes it smaller in size
dpshelio Aug 30, 2019
d0f982b
[doc] update to the right docker tag that is going to be once we relased
dpshelio Aug 30, 2019
62de047
[ci] removes printing logs as they aren't needed
dpshelio Aug 30, 2019
63929e4
[ci] Removes one nn_test run - double run doesn't fail
dpshelio Aug 30, 2019
86b97da
Make tests executable scripts
giordano Sep 2, 2019
e668328
Make tests executable scripts (#22)
giordano Sep 10, 2019
07fc1cd
Start bash at login instead of zsh
giordano Sep 10, 2019
5ffa65e
Start bash at login instead of zsh (#23)
dpshelio Sep 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .ci/install_petsc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -xe

if [ ! -f ${ci_path}/petsc_cached ]; then
git clone -b maint https://gitlab.com/petsc/petsc.git
pushd petsc
git checkout 8695de0
./configure --prefix=${ci_path}/usr \
--with-x=0 --with-debugging=0 \
CFLAGS="-O3 -DNDEBUG -ffast-math" \
--with-parmetis=1 \
--with-metis=1 \
--with-hypre=1 --download-hypre=yes \
--with-superlu_dist=1 --download-superlu_dist=yes \
--with-mumps=1 --download-mumps=yes \
--with-ml=1 --download-ml=yes \
--download-scalapack=yes --download-blacs=yes
make
make install
popd
touch petsc_cached
fi
14 changes: 14 additions & 0 deletions .ci/install_zoltan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -xe

if [ ! -f ${ci_path}/zoltan_cached ]; then
wget http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions/zoltan_distrib_v3.83.tar.gz
tar xf zoltan_distrib_v3.83.tar.gz --warning=no-unknown-keyword
mkdir Zoltan_v3.83/zoltanBUILD
pushd Zoltan_v3.83/zoltanBUILD
../configure --prefix=${ci_path}/usr \
--with-parmetis --with-parmetis-incdir=/usr/include/ --with-parmetis-libdir=/usr/lib/
make everything
make install
popd
touch zoltan_cached
fi
19 changes: 19 additions & 0 deletions .ci/setup_travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -xe


ci_path=$HOME/ci-helper

# Check whether cache exists
if [ ! -d ${ci_path} ]; then
mkdir -p ${ci_path}
fi
mkdir -p ${ci_path}/usr

pushd ${ci_path}

# Set up petsc
source $TRAVIS_BUILD_DIR/.ci/install_petsc.sh
# Set up zoltan
source $TRAVIS_BUILD_DIR/.ci/install_zoltan.sh

popd
80 changes: 33 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,43 @@
language: bash
language: cpp
compiler: gcc
os: linux
dist: xenial
sudo: required

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libblas-dev liblapack-dev gfortran libboost-dev mpi-default-bin mpi-default-dev libgmp-dev libopenmpi-dev

install:
- mkdir PEITS_root
- cd PEITS_root

- git clone -b maint https://bitbucket.org/petsc/petsc petsc

- cd petsc
- git checkout 8695de0


- ./configure --prefix=$TRAVIS_BUILD_DIR/PEITS_root/petscBUILD --with-x=0 --with-debugging=0 -CFLAGS="-O3 -DNDEBUG -ffast-math" --with-parmetis=1 --download-parmetis=yes --with-hypre=1 --download-hypre=yes --with-superlu_dist=1 --download-superlu_dist=yes --with-mumps=1 --download-mumps=yes --with-ml=1 --download-ml=yes --with-metis=1 --download-metis=yes --download-scalapack=yes --download-blacs=yes && make all test && make install


- cd ..
- wget http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions/zoltan_distrib_v3.83.tar.gz
- tar xf zoltan_distrib_v3.83.tar.gz --warning=no-unknown-keyword

- mkdir Zoltan_v3.83/BUILD_DIR
- cd Zoltan_v3.83/BUILD_DIR
addons:
apt:
packages:
- libblas-dev
- liblapack-dev
- gfortran
- libboost-dev
- mpi-default-bin
- mpi-default-dev
- libgmp-dev
- libopenmpi-dev
- autotools-dev
- automake
- libug-dev
- libmetis-dev
- libparmetis-dev
cache:
directories:
- /$HOME/ci-helper

before_install:
- test -n $CC && unset CC
- test -n $CXX && unset CXX

- ../configure --prefix=$TRAVIS_BUILD_DIR/PEITS_root/Zoltan_v3.83/BUILD_DIR --with-parmetis --with-parmetis-incdir="$TRAVIS_BUILD_DIR/PEITS_root/petscBUILD/include" --with-parmetis-libdir="$TRAVIS_BUILD_DIR/PEITS_root/petscBUILD/lib"
install:
- source ${TRAVIS_BUILD_DIR}/.ci/setup_travis.sh

- make everything
- make install

script:
- cd $TRAVIS_BUILD_DIR
- mv config.opts_example config.opts

- PETSCPATH=$TRAVIS_BUILD_DIR/PEITS_root/petscBUILD
- ZOLTANPATH=$TRAVIS_BUILD_DIR/PEITS_root/Zoltan_v3.83/BUILD_DIR

- sed -i "s,/home/username/PEITS_root/petscBUILD,$PETSCPATH,g" config.opts
- sed -i "s,/home/username/PEITS_root/Zoltan_v3.8/BUILD_DIR,$ZOLTANPATH,g" config.opts

- sh INSTALL
- cp config.opts_example config.opts
- sed -i -e '/^PETSCPATH/d' -e '/^ZOLTANPATH/d' config.opts
- sed -i -e "1 a PETSCPATH=${ci_path}/usr/lib" -e "1 a ZOLTANPATH=${ci_path}/usr" config.opts
- cat config.opts
- ./INSTALL.sh
- cd tests
- sh ./initial_test.sh
- cd ../data
# now download nn mesh and try it
- wget https://zenodo.org/record/1313709/files/NNmesh_small.tar.gz
- tar xf NNmesh_small.tar.gz
- cp parameter parameterBU
- cp standardparams standardparamsBU
- cd ../tests
- travis_wait 30 sh ./nn_test.sh
- travis_wait 30 sh ./nn_test.sh


61 changes: 61 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM uclrits/cppdev:16.04

USER root
WORKDIR /build
ENV LD_LIBRARY_PATH /usr/local/lib

RUN docker-apt-install libblas-dev liblapack-dev gfortran libboost-dev \
mpi-default-bin mpi-default-dev libgmp-dev libopenmpi-dev gfortran \
libmetis-dev libparmetis-dev autotools-dev automake libug-dev

########## Build PETSC ##########
RUN git clone -b maint https://gitlab.com/petsc/petsc.git && \
cd petsc && git checkout 8695de0 && \
./configure --prefix=/usr \
--with-x=0 --with-debugging=0 \
CFLAGS="-O3 -DNDEBUG -ffast-math" \
--with-parmetis=1 \
--with-metis=1 \
--with-hypre=1 --download-hypre=yes \
--with-superlu_dist=1 --download-superlu_dist=yes \
--with-mumps=1 --download-mumps=yes \
--with-ml=1 --download-ml=yes \
--download-scalapack=yes --download-blacs=yes && \
make all && make install

########## Build Zoltan ##########
# NOTE - Because Zoltan doesn't allow to build on the source directory, it needs to go into zoltanBUILD
# - why does it need the path to incdir and libdir? it doesn't know how to look in the right place?
RUN wget http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions/zoltan_distrib_v3.83.tar.gz && \
tar xf zoltan_distrib_v3.83.tar.gz && \
mkdir Zoltan_v3.83/zoltanBUILD && cd Zoltan_v3.83/zoltanBUILD && \
../configure --prefix=/usr \
--with-parmetis -with-parmetis-incdir=/usr/include/ --with-parmetis-libdir=/usr/lib/ && \
make everything && \
make install

RUN rm -rf {petsc,?oltan}

# Copy the local files
COPY . /build/PEITS/
WORKDIR PEITS

# Configure PEITS build
RUN cp config.opts_example config.opts && \
sed -i -e '/^PETSCPATH/d' -e '/ZOLTANPATH/d' \
-e '/with-metis/d' -e '/with-parmetis/d' \
config.opts && \
sed -i -e '1 a PETSCPATH="/usr/lib"' \
config.opts

# Build PEITS
RUN bash ./INSTALL.sh

# Create User and set environment
RUN useradd -ms /bin/bash peitsier
RUN chown -R peitsier:peitsier /build/PEITS
USER peitsier
ENV HOME /home/peitsier
RUN cp /etc/zsh/newuser.zshrc.recommended /home/peitsier/.zshrc
WORKDIR /mydata
CMD ["bash"]
6 changes: 0 additions & 6 deletions INSTALL

This file was deleted.

154 changes: 154 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Downloading and installing the required modules (Tested on Ubuntu 16.04)

1. Install required libraries.

```bash
sudo apt-get update
sudo apt-get install git gcc build-essential clang make autotools-dev \
autoconf automake libtool cmake scons pkg-config \
libblas-dev liblapack-dev gfortran libboost-dev \
mpi-default-bin mpi-default-dev libgmp-dev libopenmpi-dev \
gfortran autotools-dev automake libug-dev \
libmetis-dev libparmetis-dev
```

1. Create a new folder — e.g. PEITS_root (Parallel EIT Solver) where the modules
will be installed.

```bash
PEITS_root=/path/where/you/want/to/install/PEITS_root
mkdir -p ${PEITS_root}
cd ${PEITS_root}
```
**Important** Change the `PEITS_root=/path/where/you/want/to/install/PEITS_root`
variable to reflect the actual location of the PEITS installation. /e.g./,
`PEITS_root=${HOME}/PEITS_root`.

1. Download the PETSc library:

```bash
git clone -b maint https://gitlab.com/petsc/petsc.git
```
This will create a `petsc` subfolder in the PEITS_root directory.

1. The PETSc libary needs to be configured, from within the `pestc` folder.
Installation has been tested using a previous version of PETSc (commit
`8695de0` - the nearest release is v3.6.3), newer versions cause an error
during configuration:

```bash
cd petsc
git checkout 8695de0
./configure --prefix=${PEITS_root}/petscBUILD \
--with-x=0 --with-debugging=0 \
CFLAGS="-O3 -DNDEBUG -ffast-math" \
--with-parmetis=1 --download-parmetis=yes \
--with-metis=1 --download-metis=yes \
--with-hypre=1 --download-hypre=yes \
--with-superlu_dist=1 --download-superlu_dist=yes \
--with-mumps=1 --download-mumps=yes \
--with-ml=1 --download-ml=yes \
--download-scalapack=yes --download-blacs=yes
```

The `petscBUILD` folder will be created during the configuration process.


1. Build the PETSc source code.

```bash
make all test
make install
```

1. Download Zoltan library (v3.83 required) and extract to the PEITS_root folder.

```bash
cd ${PEITS_root}
wget http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions/zoltan_distrib_v3.83.tar.gz
tar xf zoltan_distrib_v3.83.tar.gz --warning=no-unknown-keyword
```

There may be some warning messages `'Ignoring unknown extended header keyword'`, these can be ignored.
The Zoltan library can also be downloaded through [their website](http://www.cs.sandia.gov/~web1400/1400_download.html).

1. Configure and build the Zoltan library, must be run in a build subdirectory:

```bash
mkdir Zoltan_v3.83/BUILD_DIR
cd Zoltan_v3.83/BUILD_DIR
../configure --prefix=${PEITS_root}/Zoltan_v3.83/BUILD_DIR \
--with-parmetis --with-parmetis-incdir=/usr/include/ \
--with-parmetis-libdir=/usr/lib
make everything
make install
```

1. Download Parallel EIT Solver (PEITS) code into PEITS_root folder:

```bash
cd ${PEITS_root}
git clone https://github.com/EIT-team/PEITS
```

1. Edit the `PEITS/config.opts_example` file and change `PETSCPATH` and `ZOLTANPATH`
to the appropriate directories by replacing `/home/username/PEITS_root/` with
the directory where `PEITS_root` is located, save the edited file as
`config.opts`.

If you have installed metis and parmetis using the package manager as
described above, then you can remove the lines that refer to them: /i.e./,
`--with-metis=...` and `--with-parmetis=...`

1. Run install script. Located in PEITS_root/PEITS/

```bash
./INSTALL.sh
```

The most likely cause of failure at this step is errors in the `config.opts`
file, double check `PETSCPATH` and `ZOLTANPATH` if this step fails.

1. Test installation.

A simple regression test is includes in the PEITS/tests folder. This will check
that the default configuration is producing the expected output (by comparing
file sizes).

```bash
cd ${PEITS_root}/PEITS/tests
sh initial_test.sh
```

If the test is successful, `file sizes match - test OK` will be displayed,
meaning the installation process _should_ have been carried out correctly.

If there is an error regarding loading `libparmetis.so` then we need to add the
petsc library directory to the environmental path:

```bash
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PEITS_root}/petscBUILD/lib/
export LD_LIBRARY_PATH
```

1. Running PEITS. If installation has been completed successfully, the solver
can be called from the `${PEITS_root}/PEITS/src` folder:

```bash
cd ${PEITS_root}/PEITS/src
mpirun -np 2 ./dune_peits
```

where `-np` specifies the number of parallel processors the solver should be run
on.

If the solver needs an unreasonably long time for the assembly of the system
matrix, then the pre-allocation of memory in PETSc needs to be adjusted. In
_file `${PEITS_root}/PEITS/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh` the
number of allocated non-zeros can be changed in the command
`MatMPIAIJSetPreallocation(mat,100,PETSC_NULL,40,PETSC_NULL)`. A safe way of
adjusting this is to use very high numbers (e.g. 1000 and 150) and then running
the solver with the option `-info`, which outputs the precise number of non-zeros
required on the used mesh. Also, on some meshes ML preconditioning fails on some
numbers of parallel processes. If this happens, either the number of processes
can be changed or hypre preconditioning can be used.
Loading