#!/bin/tcsh # ########################################################################## # # job name #$ -N hf_4x4x2_ta ##$ -M pblaha@theochem.tuwien.ac.at # # MPIR_HOME from submitting environment #$ -v MPIR_HOME # # needs in # $NSLOTS # the number of tasks to be used # $TMPDIR/machines # a valid machine file to be passed to mpirun # #$ -cwd #####$ -j y #$ -o job.out #$ -e job.err # the following number / 4 = number of nodes #$ -pe mpich 32 set mpijob=1 set jobs_per_node=4 #### the definition above requests 32 cores and we have 4 cores /node. #### We request only k-point parallel, thus mpijob=1 #### the resulting machines names are in $TMPDIR/machines setenv OMP_NUM_THREADS 1 echo "Got $NSLOTS slots." > job.out echo "Got $NSLOTS slots." > job.err pwd echo ' ' set proclist=`cat $TMPDIR/machines` set nproc=$NSLOTS echo $nproc nodes for this job: $proclist if ($jobs_per_node != 4 ) then set j=1 while ($j <= $nproc ) @ j1 = $j + $jobs_per_node @ j1 = $j1 - 1 echo $proclist[$j-$j1] >>.proclist_tmp @ j = $j + 4 end set proclist=`cat .proclist_tmp` rm .proclist_tmp set nproc=$#proclist endif echo $nproc nodes for this job: $proclist echo '#' > .machines # example for an MPI parallel lapw0 echo -n 'lapw0:' >> .machines set i=1 while ( $i <= $nproc ) echo -n $proclist[$i] " " >>.machines @ i = $i + 4 end echo ' ' >> .machines #example for k-point and mpi parallel lapw1/2 #set j=1 #while ($j <= $jobs_per_node ) set i=1 while ($i <= $nproc ) echo -n '1:' >>.machines @ i1 = $i + $mpijob @ i2 = $i1 - 1 echo $proclist[$i-$i2] >>.machines set i=$i1 end ###@ j ++ #end echo 'granularity:1' >>.machines echo 'extrafine:1' >>.machines #setenv SCRATCH /tmp run_lapw -NI -p -fc 3