Skip to content

Instantly share code, notes, and snippets.

@marcc-hpc
Last active April 26, 2018 22:43
Show Gist options
  • Save marcc-hpc/f286a8a27d28a254d1760589210d3073 to your computer and use it in GitHub Desktop.
Save marcc-hpc/f286a8a27d28a254d1760589210d3073 to your computer and use it in GitHub Desktop.
Singularity PyRosetta Script
#!/bin/bash
#SBATCH -p shared
#SBATCH --reservation=t-jgray21
#SBATCH -t 4:0:0
#SBATCH -N 1
#SBATCH -n 20
#SBATCH -J pyrosetta_job
# important presets for pyrosetta
export AMINO_SURFACE_CALL="--job_title HAp_FEP --surface_type HAp_010 --aa_type A --batches 500 --batch_size 100"
export AMINO_SURFACE_CALL=$AMINO_SURFACE_CALL" --database /scratch/groups/jgray21/ktabrizi/database"
export CLUSTER_ID="A_HAp_010_HAp_FEP"
# load new modules
. /cm/shared/lmod/scripts/new_lmod.sh
# load gcc, singularity, python/2.7-anaconda
ml gcc
ml singularity
ml python/2.7-anaconda
ml
# create a local relative temp directory
mkdir -p tmp
export SINGULARITY_HOME=$PWD:$HOME
# start singularity instance 'pyrosetta'
singularity instance.start -B $PWD/tmp:/tmp pyrosetta.simg pyrosetta
# start ipcontroller
singularity exec instance://pyrosetta ipcontroller --log-level=40 --ip='*' --cluster-id="${CLUSTER_ID}" &
# give it a few seconds
sleep 5
# start mpiexec
mpiexec -n 20 singularity exec instance://pyrosetta ipengine --log-level=40 --mpi mpi4py --cluster-id="${CLUSTER_ID}" &
# run a test
singularity exec instance://pyrosetta jupyter-run A.parallel_tests.py
# stop the service
singularity instance.stop pyrosetta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment