Skip to content
Snippets Groups Projects
Commit 57e4a3a0 authored by B13nch3n's avatar B13nch3n
Browse files

Switch to turn on CPU optimisation for HHblits in the DOcker image

parent 5d9d4d80
Branches 3DBeacons/container
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ FROM centos:7.4.1708
# Arguments, optional
ARG CPUS_FOR_MAKE=1
ARG OPT_FOR_CPU=0
# Environment variables
ENV CFLAGS="-march=x86-64 -mtune=generic -isystem /usr/local/include/boost/ -isystem /usr/local/openmm/include" \
......@@ -163,7 +164,11 @@ RUN set -eo pipefail; \
/usr/bin/sed -i 's/\/cluster\/toolkit\/production\/bioprogs\/psipred\/bin/\/usr\/local\/bin/g' scripts/HHPaths.pm; \
/usr/bin/sed -i 's/\/cluster\/toolkit\/production\/bioprogs\/psipred\/data/\/usr\/local\/data/g' scripts/HHPaths.pm; \
/usr/bin/sed -i 's/\/cluster\/toolkit\/production\/bioprogs\/blast\/bin/\/usr\/local\/bin/g' scripts/HHPaths.pm; \
/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DHAVE_SSE2=1; \
_hhblts_cmke=""; \
if test ${OPT_FOR_CPU} -eq 0; then \
_hhblts_cmke="-DHAVE_SSE2=1"; \
fi; \
/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local ${_hhblts_cmke}; \
/usr/bin/make -j ${CPUS_FOR_MAKE} NO_PNG=1; \
/usr/bin/make install INSTALL_DIR=/usr/local; \
cd ${SRC_FLDR}; \
......
......@@ -17,6 +17,8 @@ Table Of Contents
* [Obtain the image (Docker `pull`)](#qmeanpull)
* [Obtain an optimised image (Docker `build`)](#qmeanbuild)
* [Additional requirements](#additionalrequirements)
* [Score](#score)
......@@ -97,7 +99,8 @@ before scoring. In detail:
An already built copy of the image for the current
[Dockerfile](docker/Dockerfile) is available in our [GitLab registry](
https://git.scicore.unibas.ch/schwede/QMEAN/container_registry). It can be
https://git.scicore.unibas.ch/schwede/QMEAN/container_registry). It comes
without CPU optimisations, so it should run on most CPUs. The image can be
downloaded by either pulling it yourself or let Docker pull it first time you
run it. To actively pull, use the following command:
......@@ -111,6 +114,28 @@ registry.scicore.unibas.ch/schwede/qmean:4.2.0
$
```
<a name="qmeanbuild"></a>Obtain an optimised image (Docker `build`)
--------------------------------------------------------
The available [Docker image](
https://git.scicore.unibas.ch/schwede/QMEAN/container_registry) only uses the
most common CPU extensions to run HHblits ([DOI](
https://doi.org/10.1186/s12859-019-3019-7), [Git](
https://github.com/soedinglab/hh-suite)). Modern CPUs can do better (run
HHblits faster), providing AVX2 extensions. To make use of them, the QMEAN
image needs to be rebuild with the Docker build argument `OPT_FOR_CPU`
activated, on the target host. Execute the following command inside the
directory storing the Dockerfile
for QMEAN:
```terminal
$ docker build --build-arg OPT_FOR_CPU=1 -t qmean:avx2 .
...
=> => writing image sha256:93da5aa6613847fb7f8b71ed635fe99f72e7dd58f32b40e1e73e3429547c9d25 0.0s
=> => naming to qmean:avx2
$
```
<a name="additionalrequirements"></a>Additional requirements
------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment