Docker container for nwchem.


Gets Around
I just started experimenting with docker container for nwchem.

https://www.docker.com/

docker allows you to compile and run the program in a controlled environment, automating this process.

To create an NWCHEM image, one should run command
docker build -t nwchem .
in the directory with Dockerfile
Nwchem-6.6.revision27746-src.2015-10-20.tar.bz2 should be placed next to Dockerfile.
FROM        ubuntu:14.04

MAINTAINER  Vladimir Konjkov <Konjkov.VV@gmail.com>

ENV         NWCHEM_TOP="/opt/nwchem-6.6"

RUN         apt-get update \
            && apt-get -y upgrade \
            && apt-get install -y python-dev gfortran libopenblas-dev libopenmpi-dev openmpi-bin tcsh make ssh patch curl

WORKDIR     /opt
#RUN        curl -SL http://nwchemgit.github.io/images/Nwchem-6.6.revision27746-src.2015-10-20.tar.bz2 | tar -jxf -
ADD         Nwchem-6.6.revision27746-src.2015-10-20.tar.bz2 /opt

WORKDIR     ${NWCHEM_TOP}
RUN         curl -SL http://nwchemgit.github.io/images/Tddft_mxvec20.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Tools_lib64.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Config_libs66.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Cosmo_meminit.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Sym_abelian.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Xccvs98.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Dplot_tolrho.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Driver_smalleig.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Ga_argv.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Raman_displ.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Ga_defs.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Zgesvd.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Cosmo_dftprint.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Txs_gcc6.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Gcc6_optfix.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Util_gnumakefile.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Util_getppn.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Gcc6_macs_optfix.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Notdir_fc.patch.gz | gzip -d | patch -p0
RUN         curl -SL http://nwchemgit.github.io/images/Xatom_vdw.patch.gz | gzip -d | patch -p0

ENV         LARGE_FILES=TRUE
ENV         TCGRSH="/usr/bin/ssh"
ENV         NWCHEM_TARGET=LINUX64
ENV         NWCHEM_MODULES="all python"
ENV         PYTHONVERSION=2.7
ENV         PYTHONHOME="/usr"
ENV         USE_PYTHONCONFIG=Y
ENV         BLASOPT="-L/usr/lib/openblas-base -lopenblas"
ENV         LIBRARY_PATH="$LIBRARY_PATH:/usr/lib/openblas-base"
ENV         USE_MPI=y
ENV         USE_MPIF=y
ENV         USE_MPIF4=y
ENV         MPI_LOC="/usr/lib/openmpi/lib"
ENV         MPI_INCLUDE="/usr/lib/openmpi/include"
ENV         LIBMPI="-lmpi -lopen-rte -lopen-pal -ldl -lmpi_f77 -lpthread"
ENV         LIBRARY_PATH="$LIBRARY_PATH:/usr/lib/openmpi/lib"
ENV         MRCC_METHODS=y
#ENV         CCSDTQ=y
#ENV         CCSDTLR=y
ENV         FC=gfortran

WORKDIR     ${NWCHEM_TOP}/src
RUN         make clean && make nwchem_config && make

WORKDIR     ${NWCHEM_TOP}/contrib
RUN         ./getmem.nwchem

ENV         NWCHEM_EXECUTABLE=${NWCHEM_TOP}/bin/LINUX64/nwchem
ENV         NWCHEM_BASIS_LIBRARY=${NWCHEM_TOP}/src/basis/libraries/
ENV         NWCHEM_NWPW_LIBRARY=${NWCHEM_TOP}/src/nwpw/libraryps/
ENV         FFIELD=amber
ENV         AMBER_1=${NWCHEM_TOP}/src/data/amber_s/
ENV         AMBER_2=${NWCHEM_TOP}/src/data/amber_q/
ENV         AMBER_3=${NWCHEM_TOP}/src/data/amber_x/
ENV         AMBER_4=${NWCHEM_TOP}/src/data/amber_u/
ENV         SPCE=${NWCHEM_TOP}/src/data/solvents/spce.rst
ENV         CHARMM_S=${NWCHEM_TOP}/src/data/charmm_s/
ENV         CHARMM_X=${NWCHEM_TOP}/src/data/charmm_x/
ENV         PATH=$PATH:${NWCHEM_TOP}/bin/LINUX64

WORKDIR     /data
ENTRYPOINT  ["nwchem"]


after successful build one should run container to calculate input.nw file placed in <host_system_dir>
docker run -dv <host_system_dir>:/data nwchem "input.nw"
this command return container ID to read logs by
docker logs <container ID>

I think that this technology will be very useful for testing nwchem work in different environments.
Also It is possible to pause execution, and then continue.
docker pause <container ID>
docker unpause <container ID>


best, Vladimir.

P.S. some docs
https://confluence.desy.de/display/IS/Docker+containers+on+Maxwell
https://github.com/oweidner/docker.openmpi

Forum Vet
Vladimir
Thank you very much for this contribution.
I quite agree that docker can be a very useful technology for testing NWChem.
Do you plan to put this dockerfile on github?
By the way, because the OpenBLAS library shipped with Ubuntu 14.04 uses 32-bit integers, I belive the following changes should be applied to the dockerfile

--- nwchem66.dockerfile.org	2016-10-27 09:32:27.584628422 -0700
+++ nwchem66/nwchem66.dockerfile	2016-10-27 09:33:08.364865247 -0700
@@ -42,6 +42,8 @@
 ENV         PYTHONHOME="/usr"
 ENV         USE_PYTHONCONFIG=Y
 ENV         BLASOPT="-L/usr/lib/openblas-base -lopenblas"
+ENV         BLAS_SIZE=4
+ENV         USE_64TO32=y
 ENV         LIBRARY_PATH="$LIBRARY_PATH:/usr/lib/openblas-base"
 ENV         USE_MPI=y
 ENV         USE_MPIF=y
@@ -56,7 +58,7 @@
 ENV         FC=gfortran
 
 WORKDIR     ${NWCHEM_TOP}/src
-RUN         make clean && make nwchem_config && make
+RUN         make clean && make nwchem_config && make 64_to_32;make
 
 WORKDIR     ${NWCHEM_TOP}/contrib
 RUN         ./getmem.nwchem

Gets Around
Hi Edo.

I plan to test this container on https://www.digitalocean.com/

After that, starting two or more containers in parallelsw with Docker Compose https://docs.docker.com/compose/
I do not fully understand how to write a docker-compose.yml for this. https://docs.docker.com/compose/compose-file/#/network-configuration-reference
I do not understand how containers should be linked.


Forum >> NWChem's corner >> Running NWChem