Espresso_PBS

#!/bin/sh
#
#
# Submit the job to the queue "queue_name"
#---------------------------------------------------
#PBS -q queue_name
#
# resource limits: number and distribution of parallel processes
#------------------------------------------------------------------
#PBS -l select=2:ncpus=20:mpiprocs=20 -l place=scatter
#
# comment: this select statement means: use M chunks (nodes),
# use N (=< 12) CPUs for N mpi tasks on each of M nodes.
# "scatter" will use exactly N CPUs from each node, while omitting
# "-l place" statement will fill all available CPUs of M nodes
#
#PBS -M xxx@campus.technion.ac.il
#
# specifying working directory
#------------------------------------------------------
PBS_O_WORKDIR=$HOME/myespresso/
cd $PBS_O_WORKDIR
#
# running MPI executable with M*N processes
# comment: the "np" must be equal the number of chunks multiplied by the number of "ncpus"
#-----------------------------------------------------------------------------------------
mpirun -np 40 /usr/local/espresso/bin/pw.x < input_name.in > output_name.out