Scripts - Korundi Cluster

Last modified by alldritt@helsinki_fi on 2024/02/07 06:22

Korundi submit script for FEFFq

example submit script for the Korundi queue system
#!/bin/sh
# Options for SGE
#$ -o feffq_$JOB_ID.out
#$ -e feffq_$JOB_ID.err
#$ -N FEFFq
#$ -S /bin/bash
#$ -V
#$ -cwd
#$ -j y
#$ -l h_cpu=72:00:00
#$ -l h_vmem=2048M
#$ -notify
#$ -m be

##$ -M your.email@helsinki.fi


#-------------------------------------------------------
#
# First check that we have enough disk space on /tmp.
# If not the script exits with status 64. The status
# is also shown in the email message sent on job
# completion.
#
# The limit (in %) is given in shell variable tmplimit
# (note: it is an integer).
#
#-------------------------------------------------------

tmplimit=80

space=`df | grep "/tmp" | awk '{sub("%","",$5); print $5+0;}'`
echo
echo "Disk space usage on /tmp on computation node:" $space "%"

if test 0$space -ge $tmplimit
then
   echo
   echo "qsub script check:"
   echo "File space on tmp on node" `hostname` "dangerously low. Aborting job."
   echo "Please ask an administrator to clean up /tmp on that node."
   echo
    df /tmp
   echo
   exit 64
fi



#-------------------------------------------------------
# Create the computation work directory.
#
# Naming pattern is '/tmp/<USERNAME>/__<CWD>_<JOB>/',
# where <CWD> is the trailing part of the current
#             directory and
#       <JOB> is the job ID of the current run
#-------------------------------------------------------

sd=`pwd`
prefix=/tmp/$USER
if [ ! -d $prefix ]; then
   mkdir $prefix
fi
cd=${sd/$HOME/}
cd=${cd//\//__}
cd=$prefix/${cd}_${JOB_ID}
mkdir $cd

#-------------------------------------------------------
# Copy stuff to running directory
#-------------------------------------------------------

echo "Date:                   " `date`
echo "Submission directory:   " $sd
echo "Running directory:      " `pwd`
echo "Host:                   " `hostname`
echo "JOB_ID:                 " $JOB_ID

rsync -avu $sd/ $cd/

cd $cd

#-------------------------------------------------------
# Run the program
#-------------------------------------------------------

./feffqscript.xanes >log

#-------------------------------------------------------
# Copy stuff back to home directory.
#-------------------------------------------------------

rsync -avu $cd/ $sd/

#-------------------------------------------------------
# Cleanup, i.e. remove the computation work directory.
# This is important. Otherwise /tmp would gradually
# fill up.
#-------------------------------------------------------

cd $sd/
rm -rf $cd

sample script for running a series of FEFFq calculations

example csh script for FEFFq of LiF
#!/bin/csh
set DIR = /home/csahle/FEFF_program_files/feffq/XRSFeff_V010606

set q = ( 0.7 1.6 2.6 4.1 )
set EDGEval = ( K K K K )
set SCFval = ( 5.0 5.0 5.0 5.0 )
set FMSval = ( 8.0 8.0 8.0 8.0 )

@ plot = 1

foreach uu ( LiF.LiK.q0.7av.SCF5.0.FMS8.0 LiF.LiK.q1.6av.SCF5.0.FMS8.0 LiF.LiK.q2.6av.SCF5.0.FMS8.0 LiF.LiK.q4.1av.SCF5.0.FMS8.0 )
echo $uu
echo $plot
cat <<EOF >& feff.inp
TITLE   LiF
*  Li K edge
EDGE  $EDGEval[$plot]
QVEC -1 $q[$plot] 0 0
LJMAX -3
LDEC 3
S02 0.0
CONT      1      1     1     1     1      1
PRIN      1      1     0     0     0      0
EXCHANGE  0
SCF       $SCFval[$plot] 0
XANES     4.0     0.04     0.02
LDOS      -20 20 0.1
RPATH     0.1
FMS       $FMSval[$plot] 0 2
RGRID     0.01

 POTENTIALS
 *    ipot   Z  element            l_scmt  l_fms   stoichiometry
        0    3   Li                 1       1       0.1
        1    3   Li                 1       1       4
        2    9   F                  1       1       4

 ATOMS                          * this list contains 485 atoms
 *   x          y          z      ipot  tag           distance
    0.00000    0.00000    0.00000  0    Li1           0.00000     0
    2.01300    0.00000    0.00000  2    F1            2.01300     1
   -2.01300    0.00000    0.00000  2    F1            2.01300     2
    0.00000    2.01300    0.00000  2    F1            2.01300     3
    0.00000   -2.01300    0.00000  2    F1            2.01300     4
    0.00000    0.00000    2.01300  2    F1            2.01300     5
    0.00000    0.00000   -2.01300  2    F1            2.01300     6
    2.01300    2.01300    0.00000  1    Li1           2.84681     7
   -2.01300    2.01300    0.00000  1    Li1           2.84681     8
    2.01300   -2.01300    0.00000  1    Li1           2.84681     9
   -2.01300   -2.01300    0.00000  1    Li1           2.84681    10
    2.01300    0.00000    2.01300  1    Li1           2.84681    11
   -2.01300    0.00000    2.01300  1    Li1           2.84681    12
    0.00000    2.01300    2.01300  1    Li1           2.84681    13
    0.00000   -2.01300    2.01300  1    Li1           2.84681    14
    2.01300    0.00000   -2.01300  1    Li1           2.84681    15
   -2.01300    0.00000   -2.01300  1    Li1           2.84681    16
    0.00000    2.01300   -2.01300  1    Li1           2.84681    17
    0.00000   -2.01300   -2.01300  1    Li1           2.84681    18
    2.01300    2.01300    2.01300  2    F1            3.48662    19
   -2.01300    2.01300    2.01300  2    F1            3.48662    20
    2.01300   -2.01300    2.01300  2    F1            3.48662    21
   -2.01300   -2.01300    2.01300  2    F1            3.48662    22
    2.01300    2.01300   -2.01300  2    F1            3.48662    23
   -2.01300    2.01300   -2.01300  2    F1            3.48662    24
    2.01300   -2.01300   -2.01300  2    F1            3.48662    25
   -2.01300   -2.01300   -2.01300  2    F1            3.48662    26
 END
EOF


echo "RDINP"

cp -f $DIR/LIB/rdinp ./
limit stacksize unlimited
./rdinp
echo "FMOD1"
cp -f $DIR/LIB/ffmod1 ./
limit stacksize unlimited
./ffmod1

cp -f $DIR/LIB/ldos ./
limit stacksize unlimited
./ldos
echo "FMOD2"
cp -f $DIR/LIB/ffmod2 ./
limit stacksize unlimited
./ffmod2
cp -f xsecl.dat xsecl.$uu
echo "FMOD3"
cp -f $DIR/LIB/ffmod3 ./
limit stacksize unlimited
./ffmod3
cp -f gtrl.dat gtrl.$uu
echo "FMOD4"
cp -f $DIR/LIB/ffmod4 ./
limit stacksize unlimited
./ffmod4
echo "FMOD5"
cp -f $DIR/LIB/ffmod5 ./
limit stacksize unlimited
./ffmod5

echo "FMOD6"
cp -f $DIR/LIB/ffmod6 ./
limit stacksize unlimited
./ffmod6

cp -f xmu.dat xmu.$uu.xanes
cp -f xmul.dat xmul.$uu.xanes
cp -f ldos00.dat ldos00.$uu.dat

@ plot++

end