#!/bin/bash
run_gromacs_dir_name=$1

if [ -z "$run_gromacs_dir_name" ]
then
echo "run_gromacs_dir_name missing"
echo "example : ./validate.sh run_01-13-20-17-10-24_compile_01-13-20-16-20-05"
exit 1
fi

cd $run_gromacs_dir_name
perf=`grep Performance results | awk '{ print $2 }'`
end_sim=`grep "Statistics over 1000001 steps using 100001 frames" large_ion_channel.log`

mkdir results-gromacs-ion_channel_large
cp large_ion_channel* results-gromacs-ion_channel_large/.
cp slurm* results-gromacs-ion_channel_large/.
cp results results-gromacs-ion_channel_large/.
cd results-gromacs-ion_channel_large

if [ -z "$perf" ] || [ -z "$end_sim" ]
then
    echo "bench is not validated"
else
    echo bench is validated
    echo end = $end_sim
    echo perf = $perf ns/day
fi
