Superlu_dist solver

Hi there,

I am trying to figure out which fenics version or installation type comes with pre installed superlu_dist solver. I have tried installing the latest version but once i print list of solvers using “list_linear_solver_methods()” i dont see superlu_dist in the list no matter which version of fenics i try. I have tried installing all versions form 2016 till the latest one. I am using fenics on docker enterprise edition.

I would be thankful if someone from the community can kindly point me towards the correct version or environment (Anaconda, Docker, Ubuntu … or any other)

Best Regards,

Ovais

Users of FEniCS typically install suplerlu_dist along with PETSc. It’s not a requirement of DOLFIN. I’d check your PETSc installation.

Further to this it looks like the stable Docker images don’t download superlu_dist, see here. It should be straightforward for you to build PETSc with superlu_dist with the additional --download-superlu_dist argument.

3 Likes

Exactly as @nate pointed out. You can either do it yourself when installing PETSc or if you want to test I have a Docker image with superlu_dist installed.

You can pull it from via

docker pull bhaveshshrimali/dolfin_superlu:latest
3 Likes

superlu-dist is included in Debian/Ubuntu builds.

3 Likes

Thanks for the reply nate. I did try your suggestion by ammending dockerfile and building image using

docker build -t image_1 .

Then i created a container by

docker run -ti --name image-1 -v $(pwd):/home/fenics/shared image_1

The installation runs fine but now i am getting the error no module named dolfin
newproblem

Can you kindly point out the mistake/error which might be leading to this issue.

Thanks for your kind support

PS here is the copy of my Dockerfile

# examplebuild_1/Dockerfile
FROM quay.io/fenicsproject/base:latest
MAINTAINER fenics-project <fenics-support@googlegroups.org>

USER root
WORKDIR /home/fenics

# Environment variables
ENV PETSC_VERSION=3.12.3 \
    SLEPC_VERSION=3.12.1 \
    PYBIND11_VERSION=2.4.3 \
    MPI4PY_VERSION=3.0.3 \
    PETSC4PY_VERSION=3.12.0 \
    SLEPC4PY_VERSION=3.12.0 \
    TRILINOS_VERSION=12.10.1 \
    OPENBLAS_NUM_THREADS=1 \
    OPENBLAS_VERBOSE=0 \
    FENICS_PREFIX=$FENICS_HOME/local

# Non-Python utilities and libraries
RUN apt-get -qq update && \
    apt-get -y --with-new-pkgs \
        -o Dpkg::Options::="--force-confold" upgrade && \
    apt-get -y install curl && \
    curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
    apt-get -y install \
        bison \
        ccache \
        cmake \
        doxygen \
        flex \
        g++ \
        gfortran \
        git \
        git-lfs \
        graphviz \
        libboost-filesystem-dev \
        libboost-iostreams-dev \
        libboost-math-dev \
        libboost-program-options-dev \
        libboost-system-dev \
        libboost-thread-dev \
        libboost-timer-dev \
        libeigen3-dev \
        libfreetype6-dev \
        liblapack-dev \
        libmpich-dev \
        libopenblas-dev \
        libpcre3-dev \
        libpng-dev \
        libhdf5-mpich-dev \
        libgmp-dev \
        libcln-dev \
        libmpfr-dev \
        man \
        mpich \
        nano \
        pkg-config \
        wget \
        bash-completion && \
    git lfs install && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Python3 based environment
RUN apt-get -qq update && \
    apt-get -y --with-new-pkgs \
        -o Dpkg::Options::="--force-confold" upgrade && \
    apt-get -y install \
        python3-dev \
        python3-flufl.lock \
        python3-numpy \
        python3-ply \
        python3-pytest \
        python3-scipy \
        python3-tk \
        python3-urllib3 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install setuptools
RUN wget https://bootstrap.pypa.io/get-pip.py && \
    python3 get-pip.py && \
    pip3 install --no-cache-dir setuptools && \
    rm -rf /tmp/*

# Install PETSc from source
RUN apt-get -qq update && \
    apt-get -y install \
        python-minimal && \
    wget -nc --quiet https://gitlab.com/petsc/petsc/-/archive/v${PETSC_VERSION}/petsc-v${PETSC_VERSION}.tar.gz -O petsc-${PETSC_VERSION}.tar.gz && \
    mkdir -p petsc-src && tar -xf petsc-${PETSC_VERSION}.tar.gz -C petsc-src --strip-components 1 && \
    cd petsc-src && \
    ./configure --COPTFLAGS="-O2" \
                --CXXOPTFLAGS="-O2" \
                --FOPTFLAGS="-O2" \
                --with-fortran-bindings=no \
                --with-debugging=0 \
                --download-blacs \
                --download-hypre \
                --download-metis \
                --download-mumps \
                --download-ptscotch \
                --download-scalapack \
                --download-spai \
                --download-suitesparse \
                --download-superlu \
				--download-superlu_dist \
                --prefix=/usr/local/petsc-32 && \
     make && \
     make install && \
     rm -rf /tmp/*

# Install SLEPc from source
# NOTE: Had issues building SLEPc from source tarball generated by bitbucket.
# Website tarballs work fine, however.
RUN apt-get -qq update && \
    apt-get -y install \
        python-minimal && \
    wget -nc --quiet https://gitlab.com/slepc/slepc/-/archive/v${SLEPC_VERSION}/slepc-v${SLEPC_VERSION}.tar.gz -O slepc-${SLEPC_VERSION}.tar.gz && \
    mkdir -p slepc-src && tar -xf slepc-${SLEPC_VERSION}.tar.gz -C slepc-src --strip-components 1 && \
    export PETSC_DIR=/usr/local/petsc-32 && \
    cd slepc-src && \
    ./configure --prefix=/usr/local/slepc-32 && \
    make SLEPC_DIR=$(pwd) && \
    make install && \
    rm -rf /tmp/*

# By default use the 32-bit build of SLEPc and PETSc.
ENV SLEPC_DIR=/usr/local/slepc-32 \
    PETSC_DIR=/usr/local/petsc-32

# Install jupyterlab, sympy, mpi4py, petsc4py, slepc4py and pybind11 from source.
RUN pip3 install --no-cache-dir jupyter jupyterlab matplotlib sympy==1.1.1 pkgconfig && \
    pip3 install --no-cache-dir https://github.com/mpi4py/mpi4py/archive/${MPI4PY_VERSION}.tar.gz && \
    pip3 install --no-cache-dir https://bitbucket.org/petsc/petsc4py/downloads/petsc4py-${PETSC4PY_VERSION}.tar.gz && \
    pip3 install --no-cache-dir https://bitbucket.org/slepc/slepc4py/downloads/slepc4py-${SLEPC4PY_VERSION}.tar.gz && \
    pip3 install --no-cache-dir pybind11==${PYBIND11_VERSION} && \
    wget -nc --quiet https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz && \
    tar -xf v${PYBIND11_VERSION}.tar.gz && \
    cd pybind11-${PYBIND11_VERSION} && \
    mkdir build && \
    cd build && \
    cmake -DPYBIND11_TEST=False ../ && \
    make && \
    make install && \
    rm -rf /tmp/*

# Our helper scripts
WORKDIR $FENICS_HOME
COPY fenics.env.conf $FENICS_HOME/fenics.env.conf
COPY bin $FENICS_HOME/bin
RUN PYTHON3_SITE_DIR=$(python3 -c "import site; print(site.getsitepackages()[0])") && \
    PYTHON3_VERSION=$(python3 -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))') && \
    echo "$FENICS_HOME/local/lib/python$PYTHON3_VERSION/site-packages" >> $PYTHON3_SITE_DIR/fenics-user.pth && \
    chown -R fenics:fenics $FENICS_HOME

USER fenics
RUN echo 'source ~/.profile' >> $FENICS_HOME/.bash_profile && \
    echo '. ~/fenics.env.conf' >> $FENICS_HOME/.profile && \
    mkdir -p $FENICS_HOME/.config/matplotlib
COPY matplotlibrc $FENICS_HOME/.config/matplotlib/matplotlibrc
COPY WELCOME $FENICS_HOME/WELCOME

USER root

Thanks for your reply. I did try your solution and was able to pull the docker image you had created. I am not able to open jupyterbook using urls that appear once i run docker container

Can you kindly suggest what might be the reason ?

Can you please send the link
Thanks

I’m not sure which link you mean. If you’re using Ubuntu then you’d don’t need to use docker, unless you have some particular packaging requirements not addressed by the Ubuntu build.

Have you tried using the FEniCS PPA build, which has more recent versions than the Ubuntu standard build? Installation instructions at Download – FEniCS Project (cf. Installation — FEniCS Project documentation )

2 Likes

Looks like you’re using Docker on Windows and I don’t see any error messages on the screen. Have you tried copy-pasting the bottom most url into your browser? What is the error you’re getting if you do that? I don’t use Jupyter notebook from within Docker, but I do remember setting everything up properly.

Thanks , yes the solution was infact really simple. superlu_dist comes installed in ubuntu build

1 Like

Hello,
I am trying to pull your docker image but it does not work: I do
docker pull bhaveshshrimali/dolfin_superlu:latest
But then I don’t know where the image is stored nor how to build it.

How should I proceed once I did the docker pull? I am on OSX 14.6
Thank you !

docker run -it bhaveshshrimali/dolfin_superlu:latest

Please keep in mind that this question is about basic docker knowledge, and is not specific to dolfin or superlu dist. You could have easily used a search engine to determine what to do after having pulled docker image, and should do so in case of any follow up question.

Thank you for your reply.

I did before posting, and found this. None of the solutions suggested there work.

  1. See if the dockerfile is into /var/lib/docker as suggestd
cd: no such file or directory: /var/lib/docker
  1. Check file cd /Users/xxx/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw as suggested. The file exists, but it does not work either

% sudo docker build -t fe /Users/xxx/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw Password: [+] Building 0.0s (0/0) docker:desktop-linux ERROR: unable to prepare context: path "/Users/xxx/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw" not found

So no, this is not ‘easy’. I will see if your solution works!

Easy or not, this is not a forum on docker, and the question at this point is about docker and not dolfin.

There was no way I could know that before posting. In fact, it may have been a issue specific to that image.

However, I will keep in mind posting on a docker forum next time.

I guess what @francesco-ballarin is trying to say is that you have to first use the basic commands to start a docker container, i.e.:

which is the same for all docker images where you want to attach to a session (in terminal or through jupyter).
Instructions for this can be found at Run containers | Docker Docs

I will try this next time, thank you.