#!/bin/bash
#SBATCH --job-name=autodock-gpu_test
#SBATCH --mail-type=NONE
#SBATCH --cpus-per-task=32
#SBATCH --mem-per-cpu=4gb
#SBATCH --gpus=1
#SBATCH --time=24:00:00
#SBATCH --output=autodock-gpu_test.log
echo "Setting up test environment..."
TEST_PWD=/data/apps/tests/autodock-gpu/1.5.3
TEST_DATADIR=${TEST_PWD}/example_data
TEST_WORKDIR=${TEST_PWD}/test_output
cd ${TEST_PWD}
module load autodock-gpu/1.5.3
# Remove any previous test results and re-create a working directory
if [ -d ${TEST_WORKDIR} ]; then rm -rf ${TEST_WORKDIR}/; fi
mkdir ${TEST_WORKDIR}
echo "Starting test run at $(date) on $(hostname)..."
###################################
autodock_gpu_64wi \
--ffile ${TEST_DATADIR}/input/1stp/derived/1stp_protein.maps.fld \
--lfile ${TEST_DATADIR}/input/1stp/derived/1stp_ligand.pdbqt \
--resnam ${TEST_WORKDIR}/dock_gpu_test.dlg
#--devnum $(echo ${SLURM_STEP_GPUS:-$SLURM_JOB_GPUS} | awk -F, '{print $1 + 1}')
###################################
# There should be some files in the work directory
echo "There should be some results listed below:"
find ${TEST_WORKDIR} -type f ! -empty -ls
echo "Test complete at $(date)."