testInteractions.sh.in 1.79 KB
Newer Older
1 2 3 4
#!/bin/bash

echo ""

James Willis's avatar
James Willis committed
5
rm -f test_nonsym_density_serial.dat test_nonsym_density_1_vec.dat test_nonsym_density_2_vec.dat test_nonsym_force_1_vec.dat test_nonsym_force_2_vec.dat
6 7 8

echo "Running ./testInteractions"

9 10 11
./testInteractions

if [ $? != 0 ]; then
12 13 14
  echo "testInteractions is redundant when vectorisation is disabled"
else
  if [ -e test_nonsym_density_serial.dat ]
15
  then
16
    if python @srcdir@/difffloat.py test_nonsym_density_serial.dat test_nonsym_density_1_vec.dat @srcdir@/tolerance_testInteractions.dat
17
    then
18
      echo "Calculating density using 1 vector accuracy test passed"
19
    else
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
      echo "Calculating density using 1 vector accuracy test failed"
      exit 1
    fi
    if python @srcdir@/difffloat.py test_nonsym_density_serial.dat test_nonsym_density_2_vec.dat @srcdir@/tolerance_testInteractions.dat
    then
      echo "Calculating density using 2 vectors accuracy test passed"
    else
      echo "Calculating density using 2 vectors accuracy test failed"
      exit 1
    fi
  else
    echo "Error Missing density test output file"
    exit 1
  fi
  if [ -e test_nonsym_force_serial.dat ]
  then
    if python @srcdir@/difffloat.py test_nonsym_force_serial.dat test_nonsym_force_1_vec.dat @srcdir@/tolerance_testInteractions.dat
    then
      echo "Calculating force using 1 vector accuracy test passed"
    else
      echo "Calculating force using 1 vector accuracy test failed"
      exit 1
    fi
    if python @srcdir@/difffloat.py test_nonsym_force_serial.dat test_nonsym_force_2_vec.dat @srcdir@/tolerance_testInteractions.dat
    then
      echo "Calculating force using 2 vectors accuracy test passed"
    else
      echo "Calculating force using 2 vectors accuracy test failed"
48 49
      exit 1
    fi
50
  else
51
    echo "Error Missing force test output file"
52 53 54 55 56
    exit 1
  fi
fi

echo "------------"