-
Notifications
You must be signed in to change notification settings - Fork 0
/
Make_test_template.bak
116 lines (101 loc) · 4.16 KB
/
Make_test_template.bak
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Generic make-include file for all applications
# For inclusion in an application-specific Make_test
# Not intended to be used as a standalone.
# C.D. 8/25/06
# For making the test output. Results are put in out.test.diff.${PROJ}
# Instructions...
# 1. Copy the Makefile from the top level directory to the application
# directory and edit it for the options and architecture you desire
# 2. Select the appropriate job launch command below by uncommenting
# the appropriate set or creating one.
# 3. Go to the application directory
# 4. There should already be sample input and output files constructed from
# code that you trust and the corresponding error tolerance files.
# The sample files are called in.sample.TARGET out.sample.TARGET
# and out.errtol.TARGET where TARGET is built from "make TARGET".
# The test output file is called out.test.TARGET.
# To create an error tolerance file, see instructions in seterrfile.pl.
# 5. In the application directory, run the command
# make -f Make_test check > & maketest.log
# 6. Results are reported in files called out.test.diff.*
# These files show differences between the sample and test output files.
# using the error tolerance file to determine compliance.
# Results are also reported to stderr so should appear in maketest.log
# Look for lines with "Error" and "NOT OK".
# 7. The variable CUSTOM is normally undefined in the master
# Make_test file. With this choice the test consists of comparing
# stdout from a test run with the corresponding sample output file.
# The rule for making this file is supplied here.
# Changing CUSTOM to another name and supplying a rule in the master
# Make_test file for the file out.test${CUSTOM}.${PROJ} allows a custom
# test - for example a test comparing output other than stdout.
# A corresponding out.sample${CUSTOM}.${PROJ} must be supplied.
# 8. The variable PRECLIST lists precisions to test.
# 9. The variable ADDMACRO is available to add further compiler macros to
# the compilation.
#
# For the "heavy" application, follow instructions in heavy/Make_test
# Provisions for architecture-dependent job launching
# Change to suit...
# The job is launched with the commad
# ${LAUNCH} ./${PROJ} ${LAUNCH2} < in.sample.${PROJ} > out.test.${PROJ}
# SGI Origin
#LAUNCH = mpirun -np 4
#LAUNCH2 =
# Linux MPI
#LAUNCH = /uufs/icebox/sys/pkg/mpich/1.2.1/bin/mpirun -np 4 -machinefile $$PBS_NODEFILE # icebox
#LAUNCH = /usr/local/bin/vmi-launch -ncpus 8 -- # VMI
#LAUNCH2 =
# Linux QMP
#LAUNCH = mpirun.ch_gm -np 8
#LAUNCH2 =
# Compaq Alpha cluster (tcsini)
#LAUNCH = prun -N $$RMS_NODES -n $$RMS_PROCS # (tcsini)
#LAUNCH = prun -p test -B 1 -N 1 -n 4 (CHPC sierra cluster - private node sierra1)
#LAUNCH2 =
# SP
#LAUNCH = poe
#LAUNCH2 = -nodes 1 -tasks_per_node 4 -rmpool 1 -euilib ip -euidevice en0
# Scalar machine
LAUNCH =
LAUNCH2 =
out.test.${PROJ}.${PREC}: ${PROJ} in.sample.${PROJ}.${PREC}
${LAUNCH} ./${PROJ} ${LAUNCH2} < \
in.sample.${PROJ}.${PREC} > \
out.test.${PROJ}.${PREC}
out.test.diff.${PROJ}.${PREC}: out.test${CUSTOM}.${PROJ}.${PREC} \
out.sample${CUSTOM}.${PROJ}.${PREC}
perl ../headtail.pl ${PATTERNS} < \
out.test${CUSTOM}.${PROJ}.${PREC} > \
out.test.${PROJ}.${PREC}.tmp
perl ../headtail.pl ${PATTERNS} < \
out.sample${CUSTOM}.${PROJ}.${PREC} > \
out.sample.${PROJ}.${PREC}.tmp
perl ../diffn3.pl out.test.${PROJ}.${PREC}.tmp \
out.sample.${PROJ}.${PREC}.tmp \
out.errtol${CUSTOM}.${PROJ}.${PREC} > \
out.test.diff.${PROJ}.${PREC}
# /bin/rm -f out.test.${PROJ}.${PREC}.tmp \
# out.sample.${PROJ}.${PREC}.tmp
.PHONY: test
test:
for prec in ${PRECLIST};\
do\
for proj in ${PROJS};\
do\
${MAKE} clean;\
${MAKE} $$proj "PRECISION=$$prec" ${ADDMACRO};\
${MAKE} -f Make_test "PROJ=$$proj" "PREC=$$prec" out.test.diff.$$proj.$$prec;\
/bin/rm -f $$proj;\
/bin/rm -f localmake*;\
done;\
done
test_clean:
for prec in ${PRECLIST};\
do\
for proj in ${PROJS};\
do\
/bin/rm -f out.test.$$proj.$$prec.tmp out.sample.$$proj.$$prec.tmp;\
/bin/rm -f out.test.diff.$$proj.$$prec out.test.$$proj.$$prec; \
done;\
done