Example of SLURM array job for Everlyn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash -l | |
#SBATCH -p batch | |
#SBATCH -n 8 | |
#SBATCH -J prank | |
# Start a job array with eight CPUs total where we iterate over 1,000+ FASTA | |
# files and start a prank command for each one. SLURM ensures that there are | |
# no more than eight running at the same time within the same allocation. | |
# | |
# See: https://support.ceci-hpc.be/doc/_contents/QuickStart/SubmittingJobs/SlurmTutorial.html#packed-jobs-example | |
# Location of input files | |
DATA_DIR=/home/aorth/phyml | |
# Location to write output files in node's scratch space | |
SCRATCH_DIR=/var/scratch/aorth/2018-02-13-prank | |
# Create scratch directory and move into it | |
mkdir -p $SCRATCH_DIR | |
cd $SCRATCH_DIR | |
# Load a specific version of prank | |
module load prank/170427 | |
# Change to directory of input files | |
cd $DATA_DIR | |
# Iterate over all FASTA files | |
for file in Hircus-*.fas; do | |
# Run prank with 1 CPU, output to scratch directory | |
srun -n1 --exclusive prank -d=$file -o=$SCRATCH_DIR/${file%.fas} -codon -F -f=paml & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment