Commit c5cfded1 authored by Doak, Peter W's avatar Doak, Peter W
Browse files

example of explicit binding to cpu's

parent 380cc15b
#!/bin/bash
##PBS -S /bin/bash
#PBS -m be
#PBS -N h2so4
#PBS -q cnms14q
#PBS -l nodes=2:ppn=32
#PBS -l walltime=24:00:00
source /opt/modules/3.1.6/init/bash
#cd $GLOBAL_SCRATCH
cd $PBS_O_WORKDIR
export MODULEPATH=$MODULEPATH:/projects/cnms/modules
module load whatever
export OMP_NUM_THREADS=1
cd $PBS_O_WORKDIR
#this can be useful to see from outside shells
cat $PBS_NODEFILE >pbs_nodefile
cores_per_node=32
wcr=($(wc pbs_nodefile))
count=${wcr[0]}
awk -v count=$count -v cpn=$cores_per_node 'BEGIN { a= 0; r=0; cores=count/2; prev_node="" }; { if (a < cpn) { print "rank " r "=" $1 " slot=" a; r = r + 1; a = a + 2; prev_node=$1 } else { if (r < cores && prev_node != $1 ) {a = 0; print "rank " r "=" $1 " slot=" a ; r = r + 1; a = a + 2} }}' pbs_nodefile > rankfile
#VASP runs including significant communication especially for SCALAPACK run
#slower than they should. Refrain from using more than ~1 cpu per atom
#past 64 or 128 cores LSCALAPACK=.FALSE.
mpirun -n $((count / 2)) -v --report-bindings -rf rankfile ${VASP_MPI_FLAGS} $VASP 2>&1 >vasp_out
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment