Skip to content

Commit 4c925ef

Browse files
Merge branch 'main' of github.com:prehensilecode/alphafold_singularity
2 parents 607d1aa + fe747f3 commit 4c925ef

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

Singularity.def

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ patch -p0 < /app/alphafold/docker/openmm.patch
8585
# Add SETUID bit to the ldconfig binary so that non-root users can run it.
8686
chmod u+s /sbin/ldconfig.real
8787

88+
### SETUID bit does not matter: Apptainer does not allow suid commands
89+
### Workaround below is to use /mnt/out/ld.so.cache for the ld cache file
90+
8891
%environment
8992
export PATH="/opt/conda/bin:/usr/local/cuda-11.1/bin:$PATH"
9093
%runscript
9194
cd /app/alphafold
92-
ldconfig
95+
ldconfig -C /mnt/output/ld.so.cache
9396
exec python /app/alphafold/run_alphafold.py "$@"
9497
# %startscript
9598
# cd /app/alphafold

example_slurm_job.sh

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
#!/bin/bash
22
#SBATCH --partition=gpu
3-
#SBATCH --time=18:00:00
3+
#SBATCH --time=2:00:00
44
#SBATCH --gpus=4
55
#SBATCH --cpus-per-gpu=12
66
#SBATCH --mem=45G
77

88
### NOTE
9-
### This job script cannot be used without modification for your specific environment.
9+
#### This job script cannot be used without modification for your specific environment.
1010

1111
module load python/gcc/3.11
12-
module load alphafold/2.3.1
12+
module load alphafold/2.3.2
1313

1414
### Check values of some environment variables
15+
echo SLURM_GPUS_ON_NODE=$SLURM_GPUS_ON_NODE
16+
echo SLURM_JOB_GPUS=$SLURM_JOB_GPUS
17+
echo SLURM_STEP_GPUS=$SLURM_STEP_GPUS
1518
echo ALPHAFOLD_DIR=$ALPHAFOLD_DIR
1619
echo ALPHAFOLD_DATADIR=$ALPHAFOLD_DATADIR
1720

1821
###
19-
### README This runs AlphaFold 2.3.1 on the T1050.fasta file
22+
### README This runs AlphaFold 2.3.2 on the T1050.fasta file
2023
###
2124

2225
# AlphaFold should use all GPU devices available to the job by default.
@@ -35,11 +38,12 @@ echo ALPHAFOLD_DATADIR=$ALPHAFOLD_DATADIR
3538

3639
# Run AlphaFold; default is to use GPUs
3740
python3 ${ALPHAFOLD_DIR}/singularity/run_singularity.py \
41+
--use_gpu \
3842
--data_dir=${ALPHAFOLD_DATADIR} \
3943
--fasta_paths=T1050.fasta \
4044
--max_template_date=2020-05-14 \
41-
--db_preset=reduced_dbs \
42-
--model_preset=monomer
45+
--model_preset=monomer \
46+
--db_preset=reduced_dbs
4347

4448
echo INFO: AlphaFold returned $?
4549

run_singularity.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@
5252

5353
flags.DEFINE_bool(
5454
'use_gpu', True, 'Enable NVIDIA runtime to run with GPUs.')
55-
flags.DEFINE_boolean(
56-
'run_relax', True,
57-
'Whether to run the final relaxation step on the predicted models. Turning '
58-
'relax off might result in predictions with distracting stereochemical '
59-
'violations but might help in case you are having issues with the '
60-
'relaxation stage.')
55+
flags.DEFINE_enum(
56+
'models_to_relax', 'best', ['best', 'all', 'none'],
57+
'The models to run the final relaxation step on. '
58+
'If `all`, all models are relaxed, which may be time '
59+
'consuming. If `best`, only the most confident model is '
60+
'relaxed. If `none`, relaxation is not run. Turning off '
61+
'relaxation might result in predictions with '
62+
'distracting stereochemical violations but might help '
63+
'in case you are having issues with the relaxation '
64+
'stage.')
6165
flags.DEFINE_bool(
6266
'enable_gpu_relax', True, 'Run relax on GPU if GPU is enabled.')
6367
flags.DEFINE_string(
@@ -247,7 +251,7 @@ def main(argv):
247251
f'--benchmark={FLAGS.benchmark}',
248252
f'--use_precomputed_msas={FLAGS.use_precomputed_msas}',
249253
f'--num_multimer_predictions_per_model={FLAGS.num_multimer_predictions_per_model}',
250-
f'--run_relax={FLAGS.run_relax}',
254+
f'--models_to_relax={FLAGS.models_to_relax}',
251255
f'--use_gpu_relax={use_gpu_relax}',
252256
'--logtostderr',
253257
])

0 commit comments

Comments
 (0)