File: run-basic-tests.sh

package info (click to toggle)
abinit 9.10.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 518,712 kB
  • sloc: xml: 877,568; f90: 577,240; python: 80,760; perl: 7,019; ansic: 4,585; sh: 1,925; javascript: 601; fortran: 557; cpp: 454; objc: 323; makefile: 77; csh: 42; pascal: 31
file content (98 lines) | stat: -rwxr-xr-x 2,304 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh
#
# Copyright (C) 2005-2022 ABINIT Group (Yann Pouillon)
#
# This file is part of the ABINIT software package. For license information,
# please see the COPYING file in the top-level directory of the ABINIT source
# distribution.
#

set -e

# Init
my_name="run-basic-tests"
my_cnffile="tests.env"

# Check arguments
if test "${#}" -lt "2"; then
 echo "Usage: ${my_name} test_dir test_number"
 exit 0
fi

# Check config file
if test -s "${my_cnffile}"; then
 . "${my_cnffile}"
else
 echo "${my_name}: config file ${my_cnffile} not found - aborting now."
 exit 1
fi

# Finish init
my_string="tmp-`hostname`_`date '+%Y%m%d'`"
test_dir="${1}"
test_number="${2}"

mkdir -p "${abinit_outdir}/${test_dir}/${my_string}"
my_output="${abinit_outdir}/${test_dir}/${my_string}/test${test_number}"

# Clean-up
rm -f "${my_output}.in" "${my_output}.out" "${my_output}.log"
rm -f "${my_output}i_*" "${my_output}o_*" "${my_output}_*"
cp "${abinit_inpdir}/${test_dir}/Input/test${test_number}.in" "${my_output}.in"
cp "${abinit_inpdir}/${test_dir}/Input/testin_wannier90o_w90.win" "${my_dir}/testin_wannier90o_w90.win"

# Write abinit.files for test
cat > "${my_output}.files" <<EOF
test${test_number}.in
test${test_number}.out
test${test_number}i
test${test_number}o
test${test_number}
EOF

case "${test_number}" in

 in_fast)
  echo "${abinit_pspdir}/01h.pspgth" >> "${my_output}.files"
  ;;

 in_v1)
  echo "${abinit_pspdir}/70yb.pspnc" >> "${my_output}.files"
  ;;

 in_v5)
  echo "${abinit_pspdir}/01h.pspgth" >> "${my_output}.files"
  echo "${abinit_pspdir}/04be.pspgth" >> "${my_output}.files"
  ;;

 in_bigdft)
  echo "${abinit_pspdir}/01h.pspgth" >> "${my_output}.files"
  ;;

 in_etsf_io)
  echo "${abinit_pspdir}/20ca.paw" >> "${my_output}.files"
  ;;

 in_libxc)
  echo "${abinit_pspdir}/83bi.psphgh" >> "${my_output}.files"
  ;;

 in_wannier90)
  echo "${abinit_pspdir}/31ga.pspnc" >> "${my_output}.files"
  echo "${abinit_pspdir}/33as.pspnc" >> "${my_output}.files"
  ;;

 *)
  echo "${my_name}: unknown test number ${test_number} - aborting now."
  rm -f "${my_output}.files"
  exit 2
  ;;

esac

cd "${abinit_outdir}/${test_dir}/${my_string}"
"${abinit_bindir}/abinit" < "${my_output}.files" > "${my_output}.log"

if test -s "test${test_number}_STATUS"; then
 cat "test${test_number}_STATUS"
fi