Skip to content

Commit

Permalink
Added environment modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Apr 23, 2019
1 parent 23b161a commit 3f5a548
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 18 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,28 @@ singularity shell nbcrrolls-electrostatics-singularity-master-latest.simg
Now the container is running and we can start a BrownDye2 job (using the Thrombin example):

```
module load browndye2
cp -ai $BD2_PATH/examples/thrombin .
cd thrombin
sed -i 's/-PE0//g' *
make all
sed -i 's/<n_trajectories> 10000 /<n_trajectories> 1000 /' t_m_simulation.xml.bak
make all # takes about min to run
module unload browndye2
```

And if you want to use BrownDye version 1:

```
export PATH=$BD1_PATH/bin:$PATH
module load browndye1
cp -ai $BD1_PATH/thrombin-example .
cd thrombin-example
sed -i 's/-PE0//g' *
sed -i 's/<n-trajectories> 10000 /<n-trajectories> 1000 /' input.xml.bak # limit the number of calculated trajectories
make all
bd_top input.xml
nam_simulation t-m-simulation.xml # this takes about 20min to run
nam_simulation t-m-simulation.xml # this takes about 3 min to run
cat results.xml
module unload browndye1
```
After we are finished we can quit the container:

Expand All @@ -50,12 +55,9 @@ To list available applications:
```
$ singularity apps nbcrrolls-electrostatics-singularity-master-latest.simg
apbs
make_rxn_pairs
nam_simulation
pdb2pqr
pqr2xml
nam_simulation
we_simulation
xyz_trajectory
```

To run, for example, apbs calculation:
Expand Down
50 changes: 39 additions & 11 deletions Singularity
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#################################################################################
# Singularity Definition File
#
# Version: 2.0
# Version: 2.1
# Software: Molecular electrostatics singularity image
# Software Version: 2019.4.22
# Software Version: 2019.4.23
# Description: Docker image for BrownDye, APBS and PDB2PQR
# Website: https://browndye.ucsd.edu
# Github: https://github.com/nbcrrolls/electrostatics-singularity
Expand Down Expand Up @@ -43,7 +43,7 @@ OSVersion: xenial # 16.04
MODIFYING_AUTHOR_NAME Marty Kandes
MODIFYING_AUTHOR_EMAIL mkandes@sdsc.edu

LAST_UPDATED 20190422
LAST_UPDATED 20190423

%help

Expand Down Expand Up @@ -76,7 +76,8 @@ OSVersion: xenial # 16.04
#fi

%post -c /bin/bash
export LC_ALL=C
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
set -o errexit
#
APBS_VERSION=1.5
Expand All @@ -103,6 +104,8 @@ OSVersion: xenial # 16.04

DEBIAN_FRONTEND=noninteractive
apt-get -y install ubuntu-standard
apt-get -y install software-properties-common
add-apt-repository universe
# Upgrade all packages to their latest versions
apt-get -y update && apt-get -y upgrade
apt-get -y install build-essential
Expand All @@ -114,6 +117,8 @@ OSVersion: xenial # 16.04
apt-get -y install liblapack-dev
# works with Ubuntu 16.04 (Xenial)
apt-get -y install libreadline6
# needs 'universe' repo for modules
apt-get -y install environment-modules

cd /tmp
wget -qO - ${OCAML_URL}/${OCAML_PKG}.tar.gz | tar xzf -
Expand Down Expand Up @@ -150,8 +155,8 @@ OSVersion: xenial # 16.04
#apt-get -y purge ocaml
apt-get -y purge libexpat-dev
apt-get -y purge libboost-dev
apt-get -y clean
apt-get -y autoremove
apt-get -y purge liblapack-dev
apt-get -y clean && apt-get -y autoremove
rm -rf /var/lib/apt/lists/*

# add apbs
Expand All @@ -162,13 +167,32 @@ OSVersion: xenial # 16.04
wget -qO- --no-check-certificate ${PDB2PQR_URL}/${PDB2PQR_PKG}.tar.gz | tar xzf - -C /opt
ln -s /opt/${PDB2PQR_PKG} /opt/pdb2pqr

# add modules to /usr/share/modules/modulefiles
ln -s /usr/share/modules /usr/share/Modules
MODULE_PATH=/usr/share/modules/modulefiles
echo "#%Module1.0" > ${MODULE_PATH}/browndye1
echo "conflict browndye2" >> ${MODULE_PATH}/browndye1
echo "prepend-path PATH /opt/browndye/bin" >> ${MODULE_PATH}/browndye1

echo "#%Module1.0" > ${MODULE_PATH}/browndye2
echo "conflict browndye1" >> ${MODULE_PATH}/browndye2
echo "prepend-path PATH /opt/browndye2/bin" >> ${MODULE_PATH}/browndye2

# stupid ubuntu/dash
rm /bin/sh
ln -s /bin/bash /bin/sh

# Make filesystem mount points
mkdir /cvmfs /oasis /projects /scratch

%environment

# Set system locale
export LC_ALL=C
export LC_ALL=C.UTF-8
export LANG=C.UTF-8

. /etc/profile.d/modules.sh
export -f module

# Set APBS, PDB2PQR, and BrownDye environment variables
export APBS_VERSION=1.5
Expand All @@ -183,13 +207,15 @@ OSVersion: xenial # 16.04
export BD2_VERSION="2.0-11_Mar_2019"
export BD2_PATH=/opt/browndye2

export PATH=${APBS_PATH}/bin:${PDB2PQR_PATH}:${BD2_PATH}/bin:$PATH
export PATH=${APBS_PATH}/bin:${PDB2PQR_PATH}:${PATH}
export LD_LIBRARY_PATH=${APBS_PATH}/lib

%apphelp apbs

apbs version 1.5
For instructions on use see http://www.poissonboltzmann.org/
Please register your use of APBS and PDB2PQR at http://eepurl.com/by4eQr

apbs is installed in /opt/apbs

%apprun apbs
Expand All @@ -200,6 +226,7 @@ OSVersion: xenial # 16.04

pdb2pqr version 2.1.0
For instructions on use see http://www.poissonboltzmann.org/

pdb2pqr is installed in /opt/pdb2pqr

%apprun pdb2pqr
Expand All @@ -208,18 +235,19 @@ OSVersion: xenial # 16.04

%apphelp nam_simulation

BrownDye version 2.0
BrownDye version 1 and 2
For instructions on use see https://browndye.ucsd.edu
All BrowDye programs are installed in /opt/browndye/bin
All BrowDye programs are installed in /opt/browndye{1:2}/bin

%apprun nam_simulation

/opt/browndye2/bin/nam_simulation "$@"

%apphelp we_simulation

BrownDye version 2.0
BrownDye version 1 and 2
For instructions on use see https://browndye.ucsd.edu
All BrowDye programs are installed in /opt/browndye{1:2}/bin

%apprun we_simulation

Expand Down

0 comments on commit 3f5a548

Please sign in to comment.