From a955185fd5c615e336f225ff01c540d2d8aad4e6 Mon Sep 17 00:00:00 2001 From: David Chin Date: Fri, 29 Jul 2022 10:19:44 -0400 Subject: [PATCH] Update Slurm script for 2.2.2 --- example_slurm_job.sh | 53 +++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/example_slurm_job.sh b/example_slurm_job.sh index ca13e6f..09dc79b 100644 --- a/example_slurm_job.sh +++ b/example_slurm_job.sh @@ -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