Skip to content

Instantly share code, notes, and snippets.

@andersx
Created July 24, 2020 09:10
Show Gist options
  • Save andersx/a158d7f7451f59fbbfb4e7bc419d5159 to your computer and use it in GitHub Desktop.
Save andersx/a158d7f7451f59fbbfb4e7bc419d5159 to your computer and use it in GitHub Desktop.
ORCA alchemy script
#!/bin/bash
# get the filename without the extension
JOB=$1
SUBMIT=qsub.tmp
PWD=`pwd`
cat > $SUBMIT <<!EOF
#!/bin/bash
#SBATCH --job-name=$JOB
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --ntasks=1
#SBATCH --time=00:30:00
#SBATCH --mem=2GB
export ORCA_DIR=/apps/orca4/orca_4_0_1_linux_x86-64_openmpi202/
export LD_LIBRARY_PATH=/home/andersx/lib:$LD_LIBRARY_PATH
source /home/andersx/modules/openmpi202_gnu
export PATH=\$ORCA_DIR:$PATH
cd $PWD
export final_energy=\`grep -s "FINAL" $PWD/${JOB%.inp}.log\`
echo \$final_energy
echo ${JOB%.inp}.log
if [[ -z \$final_energy ]]; then
echo "EMPTY"
cd $PWD
export SCRATCH_DIR=/scratch/andersx/orca_`uuidgen`
mkdir \$SCRATCH_DIR
cp $JOB \$SCRATCH_DIR
cd \$SCRATCH_DIR
pwd
ls
# \$ORCA_DIR/orca $JOB > $PWD/${JOB%.inp}.log
/home/andersx/bin/run_orca4_verbose $JOB > $PWD/${JOB%.inp}.log
pwd
ls
cd $PWD
rm -r \$SCRATCH_DIR
fi
!EOF
sbatch $SUBMIT
# rm $SUBMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment