#!/bin/sh
#PBS -q x                                # x = queue name
#PBS -l select=6:mpiprocs=2:ompthreads=8 # 6 machines x 16 cores (2 processes x 8 threads in each machine)
#PBS -W group_list=y                     # y = your group id (if necessary)
#PBS -l walltime=01:00:00                # max. running time = one hour (if necessary)
cd $PBS_O_WORKDIR

# Configuration for MPI.  Depends on environment
#. /etc/profile.d/modules.sh
#module load intel/16.0.3.210 intel-mpi/5.1.3.210

# Configuration for the pairwise alignment stage:
export MAFFT_MPIRUN="mpirun"    
export MAFFT_N_THREADS_PER_PROCESS="8"            # must be equal to ompthreads above
export MAFFT_TMPDIR=/fast/shared/filesystem/maffttmp

# Configuration for progressive alignment stage:
/somewhere/bin/mafft --mpi --large --globalpair --thread 16 input > output
# Use 16 cores on one of the machines assigned by scheduler.
# --globalpair can be replaced by --genafpair, --localpair, --oldgenafpair
