Skip to content

Commit

Permalink
Update Slurm script for 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
prehensilecode committed Jul 29, 2022
1 parent 8fadff6 commit a955185
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions example_slurm_job.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
#!/bin/bash
#SBATCH --partition=gpu
#SBATCH --time=2:00:00
#SBATCH --gres=gpu:1
#SBATCH -p gpu
#SBATCH --time=18:00:00
#SBATCH --gpus=4
#SBATCH --cpus-per-gpu=12
#SBATCH --mem-per-gpu=30G
#SBATCH --mem=140G

module load alphafold
module load alphafold/2.2.2
module load python/gcc/3.10

# the alphafold modulefile should define:
# * ALPHAFOLD_DIR -- install location AlphaFold
# * ALPHAFOLD_DATADIR -- the DOWLOAD_DIR set in scripts/download_all_data.sh
### Check values of some environment variables
echo SLURM_JOB_GPUS=$SLURM_JOB_GPUS
echo ALPHAFOLD_DIR=$ALPHAFOLD_DIR
echo ALPHAFOLD_DATADIR=$ALPHAFOLD_DATADIR

# Run AlphaFold; default is to use GPUs, i.e. "--use_gpu"
python3 ${ALPHAFOLD_DIR}/singularity/run_singularity.py \
--fasta_paths=T1050.fasta \
--max_template_date=2020-05-14 \
--preset=reduced_dbs
###
### README This runs AlphaFold 2.2.2 on the T1050.fasta file
###

# AlphaFold should use all GPU devices available to the job.
# AlphaFold should use all GPU devices available to the job by default.
# To explicitly specify use of GPUs, and the GPU devices to use, add
# --use_gpu --gpu_devices=${SLURM_JOB_GPUS}

#
# To run the CASP14 evaluation, use:
# --preset=casp14

# To benchmark, running multiple JAX model evaluations:
# --model_preset=monomer_casp14
#
# To benchmark, running multiple JAX model evaluations (NB this
# significantly increases run time):
# --benchmark

# Copy all output from AlphaFold back to directory where "sbatch" command was issued
cp -R $TMPDIR $SLURM_SUBMIT_DIR
# Run AlphaFold; default is to use GPUs, i.e. "--use_gpu" can be omitted.
python3 ${ALPHAFOLD_DIR}/singularity/run_singularity.py \
--use_gpu --gpu_devices=${SLURM_JOB_GPUS} \
--data_dir=${ALPHAFOLD_DATADIR} \
--fasta_paths=T1050.fasta \
--max_template_date=2020-05-14 \
--model_preset=monomer_casp14 \
--benchmark

echo INFO: AlphaFold returned $?

### Copy Alphafold output back to directory where "sbatch" command was issued.
mkdir $SLURM_SUBMIT_DIR/Output-$SLURM_JOB_ID
cp -R $TMPDIR $SLURM_SUBMIT_DIR/Output-$SLURM_JOB_ID

0 comments on commit a955185

Please sign in to comment.