#!/bin/bash -l
# you.lu@stfc.ac.uk

#$ -S /bin/bash

echo
echo =========================
echo Py-ChemShell on UCL YOUNG
echo Job ID: $JOB_ID
echo =========================
echo 

echo "ChemShell executable   : $CHEMSH_EXEC"
echo "Number of MPI processes: $CHEMSH_NPROCS"
echo "Number of workgroups   : $CHEMSH_NWORKGROUPS"
echo "Number of procs for MM : $CHEMSH_NPROCS_MM"
echo "Input file             : $CHEMSH_INPUT"
echo "Print level            : $CHEMSH_DEBUG"

# TWK 17/7/2023 Test driver mode
if [[ "$CHEMSH_TEST_DRIVER" != "" ]]
then
    echo
    echo Running the ChemShell test suite:
    echo
    echo CHEMSH_TEST_DRIVER = $CHEMSH_TEST_DRIVER
    echo CHEMSH_TESTSETS = $CHEMSH_TESTSETS
    echo
    CHEMSH_TEST="${CHEMSH_TEST_DRIVER} --sets ${CHEMSH_TESTSETS} --exe "
else
    CHEMSH_TEST=""
fi

# run (launch MPI with gerun on THOMAS)
$CHEMSH_TEST $CHEMSH_WRAPPER mpirun -np $CHEMSH_NPROCS $CHEMSH_EXEC -nwg $CHEMSH_NWORKGROUPS -npmm $CHEMSH_NPROCS_MM -gm $CHEMSH_GA_MEMORY -dbg $CHEMSH_DEBUG $CHEMSH_INPUT > $CHEMSH_OUTPUT


