Apache Airavata
#!/bin/sh
#SBATCH -J default_job
#SBATCH -p development
#SBATCH -o default_job.o%j
#SBATCH -n 128
#SBATCH -t 0:30:0
#SBATCH --mail-user=ccg-admin@ccg-mw2.ncsa.uiuc.edu
#SBATCH --mail-type=ALL
#SBATCH -A TG-CHE080068N
set -x
export X509_USER_PROXY=/work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/x509up_p14595.fileIqTlFB.1
###2007/05/03 export LD_LIBRARY_PATH=/opt/apps/intel13/mvapich2/1.9/lib:/opt/apps/intel13/mvapich2/1.9/lib/shared:/opt/apps/i
ntel/13/composer_xe_2013.2.146/tbb/lib/intel64:/opt/apps/intel/13/composer_xe_2013.2.146/compiler/lib/intel64:/opt/intel/mic/
coi/host-linux-release/lib:/opt/intel/mic/myo/lib:/opt/apps/intel/13/composer_xe_2013.2.146/mpirt/lib/intel64:/opt/apps/intel
/13/composer_xe_2013.2.146/ipp/../compiler/lib/intel64:/opt/apps/intel/13/composer_xe_2013.2.146/ipp/lib/intel64:/opt/apps/in
tel/13/composer_xe_2013.2.146/compiler/lib/intel64:/opt/apps/intel/13/composer_xe_2013.2.146/mkl/lib/intel64:/opt/apps/intel/
13/composer_xe_2013.2.146/tbb/lib/intel64:/opt/apps/xsede/gsi-openssh-6.2p1/lib64:/opt/apps/xsede/gsi-openssh-6.2p1/lib64 #
NOT NEEDED
jobid=`echo $SLURM_JOBID |sed 's/\..*//' `
jobdir="default_job.stampede.tacc.utexas.edu.$jobid.140123"
export OutDir=/work/00421/ccguser/mvanmoer/mvanmoer_proj/$jobdir
#if [ ! -d $OutDir ] ; then
# echo "Making dir: $OutDir";
# mkdir -p $OutDir || exit 1; # let us stop if we can not make this dir - it is too important
#fi
# we need to export SCRATCH_BATCH
export HOME_BATCH=/work/00421/ccguser/mvanmoer/mvanmoer_proj/$jobdir
export SCRATCH_BATCH=/scratch/00421/ccguser/$SLURM_JOBID
if [ ! -d $SCRATCH_BATCH ] ; then
mkdir -p $SCRATCH_BATCH
fi
if [ ! -d $HOME_BATCH ] ; then
echo "Linking HOME_BATCH to SCRATCH_BATH: $HOME_BATCH -> $SCRATCH_BATCH" ;
ln -s $SCRATCH_BATCH $HOME_BATCH || exit 1;
fi
# change directory to SCRATCH_BATCH
cd $SCRATCH_BATCH
pwd
# 2006/03/31 make a link of the Outdir into OutDir for convenience
#/bin/ln -s /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc $OutDir/
###which uberftp
###echo "DEBUG: TEMP01AAAAAA 20070301 skk "; ls -l $X509_USER_PROXY
# 20140115:MVM - not sure where the best place to do this is
# need to copy files from ds_lammps/data to working directory to avoid having
# to upload them through Gridchem
# also not sure if there's a variable containig this path
cp /home1/00421/ccguser/apps/ds_lammps/data/* .
cp -p /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/* .
Diskoutputfile_with_dir=$SCRATCH_BATCH/default_job.out
trap ". /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/qsubin14607_cleanup ; exit 99 " XCPU INT TERM CHLD
ibrun ~/apps/ds_lammps/bin/lmp_stampede < a_0001_300K.in > default_job.out
Ndumps=`find . -type f -name \*dump | wc -l`
if [ $Ndumps -eq "0" ]
then
echo "No dump files were generated, skipping Gordon job." ;
else
echo "dump files generated, creating Gordon job."
export jobdir=$jobdir
export OutDir=$OutDir
sed -i "s/export/export jobdir=$jobdir \nexport/" /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/ssh14607_gordo
n_sh
sed -i "s%export%export OutDir=$OutDir \nexport%" /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/ssh14607_gordo
n_sh
ssh login1.stampede.tacc.utexas.edu /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/ssh14607_gordon_sh > ssh_gor
don.out 2>&1
fi #end of Ndump conditional
. /work/00421/ccguser/mvanmoer/tempdirs/tempdirXhPapVc/qsubin14607_cleanup
# Qsubin CleanUp will be done in Qsubin_Vis