Skip to content

Commit

Permalink
add gromacs mpi
Browse files Browse the repository at this point in the history
  • Loading branch information
mariojmdavid committed Jan 22, 2024
1 parent 7657bba commit f96bdbc
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 9 deletions.
11 changes: 6 additions & 5 deletions docs/udocker/udocker-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Access the INCD advanced computing facility at Lisbon using ssh:

```bash
ssh -l <username> cirrus8.a.incd.pt
module load python/3.10.13
module load python
```

* The end user can download and execute udocker without system administrator intervention.
Expand All @@ -69,6 +69,7 @@ export PATH=$HOME/udocker-1.3.10/udocker:$PATH
```

---

## In the beginning - I

Make a directory for the tutorial and set en variable of udocker to that dir:
Expand Down Expand Up @@ -166,7 +167,7 @@ udocker run -v $TUT_DIR/udocker-files/tensorflow:/home/user -w /home/user tf_gpu

---

## Job output
## Job output of tensoflow run

And, if all goes well you should see in the keras-xxx.out something like this:

Expand Down Expand Up @@ -194,9 +195,9 @@ Epoch 5/5

* I have a tarball that I built with docker from a Dockerfile in part 3 of this tutorial: `gromacs.tar`.
* It was saved with:
* `docker save -o gromacs.tar gromacs`
* `docker save -o gromacs.tar gromacs`
* Now we will load the tarball with udocker:
* `udocker load -i gromacs.tar gromacs`
* `udocker load -i gromacs.tar gromacs`

---

Expand Down Expand Up @@ -248,7 +249,7 @@ sbatch run-gromacs.sh

---

## Job output
## Job output of Gromacs run

The Gromacs output files can be found in `$HOME/udocker-tutorial/gromacs/output`, and the slurm job output in `$HOME/udocker-tutorial/udocker-files/gromacs-*.out/err`

Expand Down
29 changes: 29 additions & 0 deletions udocker-files/prep-gromacs-mpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#SBATCH --job-name=prep_gromacs
#SBATCH --ntasks=1
#SBATCH --partition=hpc
#SBATCH --output=gromacs-prep-%j.out
#SBATCH --error=gromacs-prep-%j.err

export TUT_DIR=$HOME/udocker-tutorial
export PATH=$HOME/udocker-1.3.10/udocker:$PATH
cd $TUT_DIR
export UDOCKER_DIR=$TUT_DIR/.udocker
module load python

echo "###############################"
hostname
echo ">> udocker command"
which udocker
echo
echo ">> List images"
udocker images
echo
echo ">> Create container"
udocker create --name=grom_mpi gromacs-mpi
echo
echo ">> Set execmode to F3"
udocker setup --execmode=F3 grom_mpi
echo
echo ">> List containers"
udocker ps -m -p
2 changes: 1 addition & 1 deletion udocker-files/prep-gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export TUT_DIR=$HOME/udocker-tutorial
export PATH=$HOME/udocker-1.3.10/udocker:$PATH
cd $TUT_DIR
export UDOCKER_DIR=$TUT_DIR/.udocker
module load python/3.10.13
module load python

echo "###############################"
hostname
Expand Down
2 changes: 1 addition & 1 deletion udocker-files/prep-keras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export TUT_DIR=$HOME/udocker-tutorial
export PATH=$HOME/udocker-1.3.10/udocker:$PATH
cd $TUT_DIR
export UDOCKER_DIR=$TUT_DIR/.udocker
module load python/3.10.13
module load python

echo "###############################"
hostname
Expand Down
27 changes: 27 additions & 0 deletions udocker-files/run-gromacs-mpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#SBATCH --job-name=run_gromacs_mpi
#SBATCH --ntasks=16
#SBATCH --nodes=2
#SBATCH --ntasks-per-core=1
#SBATCH --ntasks-per-node=8
#SBATCH --partition=hpc
#SBATCH --output=gromacs-mpi-%j.out
#SBATCH --error=gromacs-mpi-%j.err

export TUT_DIR=$HOME/udocker-tutorial
export PATH=$HOME/udocker-1.3.10/udocker:$PATH
export UDOCKER_DIR=$TUT_DIR/.udocker
export OUT_NAME=output/ud-tutorial
export TRR=${OUT_NAME}.trr
export XTC=${OUT_NAME}.xtc
export EDR=${OUT_NAME}.edr
export LOG=${OUT_NAME}.log
module load python/3.10.13
module load gcc11/openmpi/4.1.4
cd $TUT_DIR
module list

echo "###############################"
srun --mpi=pmi2 udocker run -v=$TUT_DIR/gromacs:/home/user -w=/home/user grom_mpi \
gmx mdrun -s /home/user/input/md.tpr -e $EDR -x $XTC -o $TRR -g $LOG \
-maxh 0.50 -resethway -noconfout -nsteps 10000
2 changes: 1 addition & 1 deletion udocker-files/run-gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export TRR=${OUT_NAME}.trr
export XTC=${OUT_NAME}.xtc
export EDR=${OUT_NAME}.edr
export LOG=${OUT_NAME}.log
module load python/3.10.13
module load python
cd $TUT_DIR

echo "###############################"
Expand Down
2 changes: 1 addition & 1 deletion udocker-files/run-keras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
export TUT_DIR=$HOME/udocker-tutorial
export PATH=$HOME/udocker-1.3.10/udocker:$PATH
export UDOCKER_DIR=$TUT_DIR/.udocker
module load python/3.10.13
module load python
cd $TUT_DIR

echo "###############################"
Expand Down

0 comments on commit f96bdbc

Please sign in to comment.