Docker MPI

203 views
Skip to first unread message

Doug Shi-Dong

unread,
Oct 21, 2019, 9:53:36 PM10/21/19
to deal.II User Group
Hello everyone,

I would like to use Travis CI to test pull requests, and I am currently following the steps described in https://github.com/dealii/dealii/wiki/Docker-Images

Except I am using the following Docker image: dealii/dealii:v9.1.1-gcc-mpi-fulldepsspack-debugrelease

It seems that this Docker imagine does not contain an MPI package in its installation. Here is a log of my Travis CI build


The command apt search mpi shows that no packages such as openmpi or mpich is available. However, oddly enough, DEAL_II_WITH_MPI is ON, when my CMake checks for it.

If no MPI is available, how do I compile the code within this Docker container?

Best regards,

Doug

Bruno Turcksin

unread,
Oct 22, 2019, 8:18:22 AM10/22/19
to deal.II User Group
Doug,

You are using an image build using spack so everything is installed using spack instead of the package manager. If you type `spack find` inside a container, you will see that mpich is installed.

Best,

Bruno

Doug Shi-Dong

unread,
Oct 23, 2019, 6:15:47 PM10/23/19
to deal.II User Group
Dr. Turcksin,

Thank you for the answer. Makes sense why I couldn't find it use apt search. CMake's FindMPI was unable to find it though. Might just need to give it some hints on the spack MPI location.

Either way, I realised that I'm using some features with bugs that were fixed in the current development version.

Are you aware of anyone hosting a "development" Docker build for their own continuous integration. I know this can be very expensive to keep up with the commits. Otherwise, I guess I should just build my own Docker with my current deal.II fork.

Best regards,

Doug

Bruno Turcksin

unread,
Oct 24, 2019, 8:35:28 AM10/24/19
to dea...@googlegroups.com
Doug,

Le mer. 23 oct. 2019 à 18:15, Doug Shi-Dong <doug.s...@gmail.com> a écrit :
> Are you aware of anyone hosting a "development" Docker build for their own continuous integration. I know this can be very expensive to keep up with the commits. Otherwise, I guess I should just build my own Docker with my current deal.II fork.
No, I don't know of anyone building a Docker image for each commit in
the master but I guess we could do it. If there is a bug fix or a new
feature in master that I need, I usually just create a new image from
master. Since the library is very stable, I don't need to create a new
image very often.

Best,

Bruno

Reza Rastak

unread,
Oct 24, 2019, 10:02:47 PM10/24/19
to deal.II User Group
Hi,

I have a related issue regarding the docker image. I can see `mpich` when I type `spack find`. However, I don't have access to executable programs `mpirun` or `mpiexec`.

>> mpirun
bash: mpirun: command not found

when I try to load the module I see the following error messages.

>> spack load mpich
==> This command requires spack's shell integration.
  
  To initialize spack's shell commands:
  
      # for bash and zsh
      . /usr/local/share/spack/setup-env.sh
  
      # for csh and tcsh
      setenv SPACK_ROOT /usr/local
      source /usr/local/share/spack/setup-env.csh
  
  This exposes a 'spack' shell function, which you can use like
      $ spack load package-foo
  
  Running the Spack executable directly (for example, invoking
  ./bin/spack) will bypass the shell function and print this
  placeholder message, even if you have sourced one of the above
  shell integration scripts.

>> . /usr/local/share/spack/setup-env.sh
>> spack load mpich
bash: module: command not found

Does anyone know how I can access `mpirun`?

Thank you,

Reza

luca.heltai

unread,
Oct 25, 2019, 8:41:17 AM10/25/19
to Deal.II Users
You can do

export PATH=$(spack location -i mpich)/bin:$PATH

to prepend the path of mpich to your PATH. This is not done automatically. Alternatively, you could also run, as root:

cd /usr/local
spack view add . mpich

which aliases all mpi commands to /usr/local/bin

I usually do this in a custom docker image, derived from the official deal.II image, which I then upload to my personal docker hub, and use for my CI needs.

Best,
Luca.

---
FROM dealii/dealii:v9.1.1-gcc-mpi-fulldepsspack-debugrelease

MAINTAINER luca....@gmail.com

USER root
RUN spack install googletest ninja \
&& spack clean -a \
&& cd /usr/local && spack view add . googletest ninja mpich

RUN chmod 777 /home/$USER

USER $USER
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/aa77f722-f3cb-4ae8-a46c-7c6e815e0338%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages