File: Makelocal-benchmark

package info (click to toggle)
cod-tools 3.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 154,792 kB
  • sloc: perl: 57,588; sh: 36,842; ansic: 6,402; xml: 1,982; yacc: 1,117; makefile: 727; python: 166
file content (48 lines) | stat: -rw-r--r-- 1,259 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
#---*- Makefile -*-------------------------------------------------------------
#$Author: antanas $
#$Date: 2019-11-15 20:10:14 +0200 (Fri, 15 Nov 2019) $
#$Revision: 7425 $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.7.0/makefiles/Makelocal-benchmark $
#------------------------------------------------------------------------------
#*
#  Benchmarks a script.
#**

# The following variables should be predefined in the Makeconf file:
# ${BENCH_SCRIPT}
#                   Full path to the benchmarked script.
# ${BENCH_DEPEND}
#                   Additional dependencies that should be assembled
#                   before carrying out the benchmarking.
# ${BENCH_FILES}
#                   List of files that should be used for the benchmarking.

BENCH_SCRIPT ?=
BENCH_DEPEND ?=
BENCH_FILES  ?= ${wildcard *.inp}

SHELL = /bin/bash

.PHONY: all run times

all:

${BENCH_SCRIPT}: | ${BENCH_DEPEND}

run: ${BENCH_SCRIPT} ${BENCH_FILES}
	@for file in ${BENCH_FILES}; do \
	( \
		echo === $$file ===; \
		set -x; \
		${BENCH_SCRIPT} < $$file \
	); \
	done

times: ${BENCH_SCRIPT} ${BENCH_FILES}
	@for file in ${BENCH_FILES}; do \
	( \
		echo === $$file ===; \
		set -x; \
		time ${BENCH_SCRIPT} < $$file \
	); \
	done