Skip to content

Commit 9466607

Browse files
committed
Initial set of tests
A set of tests and a bash script which I use to make performance comparisons between two form/tform binaries. The tests run in /dev/shm (which should be a tmpfs) to keep disk access performance out of the comparison. There are no promises that this works properly on other systems at this point. `hyperfine' is used for the timings.
1 parent a46e660 commit 9466607

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+646770
-0
lines changed

run.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
3+
ORIGDIR=$(pwd)
4+
5+
TIMESTAMP=$(date +%Y-%m-%d-%H-%M-%S)
6+
7+
RESULTSDIR=$ORIGDIR/output/$TIMESTAMP/results/
8+
LOGDIR=$ORIGDIR/output/$TIMESTAMP/logs/
9+
mkdir -p $RESULTSDIR
10+
mkdir -p $LOGDIR
11+
12+
TESTDIR="/dev/shm/form-bench-$TIMESTAMP/"
13+
mkdir $TESTDIR
14+
15+
TMPDIR=$TESTDIR/formtmp
16+
mkdir $TMPDIR
17+
export FORMTMP=$TMPDIR
18+
19+
cp -r $ORIGDIR/tests/* $TESTDIR
20+
cd $TESTDIR
21+
22+
23+
N=2
24+
declare -A runs
25+
runs["trace"]=$(($N * 30 ))
26+
runs["mincer"]=$(($N * 4 ))
27+
runs["minceex"]=$(($N * 6 ))
28+
runs["mass-fact"]=$(($N * 4 ))
29+
runs["forcer"]=$(($N * 3 ))
30+
runs["forcer-exp"]=$(($N * 4 ))
31+
runs["mbox1l"]=$(($N * 15 ))
32+
runs["color"]=$(($N * 15 ))
33+
runs["chromatic"]=$(($N * 4 ))
34+
declare -A warmup
35+
warmup["trace"]=3
36+
warmup["mincer"]=0
37+
warmup["minceex"]=0
38+
warmup["mass-fact"]=0
39+
warmup["forcer"]=0
40+
warmup["forcer-exp"]=0
41+
warmup["mbox1l"]=1
42+
warmup["color"]=1
43+
warmup["chromatic"]=0
44+
45+
46+
FORM1=tform-test
47+
FORM2=tform-test-ps
48+
CPU=24
49+
50+
#TESTS="trace mincer minceex mass-fact forcer forcer-exp mbox1l color chromatic"
51+
TESTS="trace minceex forcer forcer-exp mbox1l color chromatic"
52+
53+
54+
for test in $TESTS; do
55+
cd $test
56+
echo ""
57+
echo ""
58+
echo Running $test
59+
hyperfine --warmup ${warmup[$test]} --runs ${runs[$test]} \
60+
--export-json $RESULTSDIR/results-$test.json \
61+
--command-name "$FORM1" \
62+
--command-name "$FORM2" \
63+
"nice -n -10 $FORM1 -w$CPU $test.frm > $LOGDIR/$test.log1" \
64+
"nice -n -10 $FORM2 -w$CPU $test.frm > $LOGDIR/$test.log2"
65+
cd ..
66+
done
67+
68+
69+
cd $ORIGDIR
70+
rm -rf $TESTDIR
71+

tests/chromatic/chromatic.frm

Lines changed: 280 additions & 0 deletions
Large diffs are not rendered by default.

tests/color/color.frm

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
#-
2+
#: ScratchSize 1G
3+
4+
Off Statistics;
5+
6+
#define SIZE "8"
7+
* Extend the runtime without increasing SIZE:
8+
#define LONGER "2"
9+
*#define ALTERNATEMETHOD "1"
10+
*
11+
* Test program for the color traces in the paper and a few more.
12+
* The paper: "Color traces for arbitrary groups"
13+
* by T. van Ritbergen, A.N. Schellekens and J.A.M. Vermaseren.
14+
*
15+
* The object is to express color traces in terms of group invariants
16+
* in such a way that the group has not been specified yet. The few
17+
* remaining invariants can be substituted afterwards. The expressions
18+
* in terms of invariants are better for publications. One sees more
19+
* about the structure of the problem this way.
20+
*
21+
* All declarations are made in the file cfactors.h
22+
* One needs version 3 or later of FORM to run these programs.
23+
* The programs will handle all color structures with up to 14 vertices.
24+
* One vertex is one generator in any representation.
25+
* Currently the program handles only one type of non-adjoint representaion.
26+
* If there are two different representations of such type one has to
27+
* try to run the problem in stages.
28+
*
29+
* Examples are:
30+
* One quark-loop with SIZE gluons in a maximally non-planar configuration
31+
* (TYPE = qloop)
32+
* Same but qluon loop (everything in the adjoint representation)
33+
* (TYPE = gloop)
34+
* Two quark loops with SIZE connecting gluons like a circular ladder.
35+
* (TYPE = qqloop)
36+
* Same with one quark loop and one gluon loop.
37+
* (TYPE = qgloop)
38+
* Same with two gluon loops.
39+
* (TYPE = ggloop)
40+
* The Coxeter graph (diagram with 14 vertices in the adjoint representation
41+
* in which there are no loops with fewer than 6 lines) (TYPE = g14)
42+
*
43+
* One should not choose SIZE larger than 7 or most likely the simplification
44+
* routine cannot simplify the final result completely (in some rare cases
45+
* it can though for SIZE = 8).
46+
* For execution times, see the paper.
47+
* It does get very slow for quarks and SIZE > 7.
48+
*
49+
* Program by J.Vermaseren, 24-may-1997
50+
*
51+
#include color.h
52+
AutoDeclare Index i,j,k;
53+
CFunction acc;
54+
Symbol x,y;
55+
.global
56+
G Q{2*`SIZE'} = <T(i1,i2,j1)>*...*<T(i`SIZE',i{`SIZE'+1},j`SIZE')>
57+
*<T(i{`SIZE'+1},i{`SIZE'+2},j1)>*...*<T(i{`SIZE'*2},i{2*`SIZE'+1},j`SIZE')>
58+
*replace_(i{`SIZE'*2+1},i1);
59+
60+
G G{2*`SIZE'} = <f(i1,i2,j1)>*...*<f(i`SIZE',i{`SIZE'+1},j`SIZE')>
61+
*<f(i{`SIZE'+1},i{`SIZE'+2},j1)>*...*<f(i{`SIZE'*2},i{2*`SIZE'+1},j`SIZE')>
62+
*replace_(i{`SIZE'*2+1},i1);
63+
64+
G QQ`SIZE' = <T(i1,i2,j1)>*...*<T(i`SIZE',i{`SIZE'+1},j`SIZE')>
65+
*<T(k1,k2,j1)>*...*<T(k`SIZE',k{`SIZE'+1},j`SIZE')>
66+
*replace_(i{`SIZE'+1},i1,k{`SIZE'+1},k1);
67+
68+
G QG`SIZE' = <T(i1,i2,j1)>*...*<T(i`SIZE',i{`SIZE'+1},j`SIZE')>
69+
*<f(k1,k2,j1)>*...*<f(k`SIZE',k{`SIZE'+1},j`SIZE')>
70+
*replace_(i{`SIZE'+1},i1,k{`SIZE'+1},k1);
71+
72+
G GG`SIZE' = <f(i1,i2,j1)>*...*<f(i`SIZE',i{`SIZE'+1},j`SIZE')>
73+
*<f(k1,k2,j1)>*...*<f(k`SIZE',k{`SIZE'+1},j`SIZE')>
74+
*replace_(i{`SIZE'+1},i1,k{`SIZE'+1},k1);
75+
76+
G girth14 =
77+
f(i1,i2,i3)*f(i1,i4,i5)*f(i2,i6,i7)*f(i3,i8,i9)
78+
*f(i4,i10,i11)*f(i5,i12,i13)*f(i6,i14,i15)*f(i7,i16,i17)
79+
*f(i8,i18,i19)*f(i9,i20,i21)
80+
*f(i10,i21,i15)*f(i13,i19,i14)*f(i17,i11,i18)*f(i12,i16,i20);
81+
82+
* Takes too long
83+
*G girth24 =
84+
* f(i36,i1,i2)*f(i36,i3,i4)*f(i1,i5,i6)*f(i2,i7,i8)
85+
* *f(i3,i9,i10)*f(i4,i11,i12)*f(i5,i13,i14)*f(i6,i15,i16)
86+
* *f(i7,i17,i18)*f(i8,i19,i20)*f(i9,i21,i22)*f(i10,i23,i24)
87+
* *f(i11,i25,i26)*f(i12,i27,i28)*f(i13,i23,i29)*f(i14,i27,i30)
88+
* *f(i15,i25,i31)*f(i16,i21,i32)*f(i17,i26,i29)*f(i18,i32,i33)
89+
* *f(i19,i31,i34)*f(i20,i22,i30)*f(i24,i34,i35)*f(i28,i33,i35);
90+
91+
G fiveq = T(i1,i2,j1)*T(i2,i3,j2)*T(i3,i1,j3)*
92+
T(i4,i5,j2)*T(i5,i6,j4)*T(i6,i4,j5)*
93+
T(i7,i8,j4)*T(i8,i9,j6)*T(i9,i7,j7)*
94+
T(i10,i11,j6)*T(i11,i12,j1)*T(i12,i10,j8)*
95+
T(i13,i14,j3)*T(i14,i15,j5)*T(i15,i16,j7)*T(i16,i13,j8);
96+
97+
Sum i1,...,i{`SIZE'*2},j1,...,j`SIZE',k1,...,k`SIZE';
98+
Sum i{`SIZE'*2+1},...,i36,j{`SIZE'+1},...,j8;
99+
Multiply <y^1>+...+<y^`LONGER'>;
100+
.sort
101+
102+
#message call color
103+
#call color
104+
#call SORT(tloop-1)
105+
#message call adjoint
106+
#call adjoint
107+
#call SORT(tloop-2)
108+
#call simpli
109+
id acc(x?) = x;
110+
id y^x? = 1/`LONGER';
111+
.sort
112+
113+
*--#[ Check results
114+
Local Q16 = -Q16
115+
+ NA*I2R*cR^7
116+
- 14*NA*I2R*cA*cR^6
117+
+ 161/2*NA*I2R*cA^2*cR^5
118+
- 2975/12*NA*I2R*cA^3*cR^4
119+
+ 64085/144*NA*I2R*cA^4*cR^3
120+
- 67655/144*NA*I2R*cA^5*cR^2
121+
+ 1413487/5184*NA*I2R*cA^6*cR
122+
- 14740249/217728*NA*I2R*cA^7
123+
+ 70*d44(cOlpR1,cOlpA1)*cR^4
124+
- 546*d44(cOlpR1,cOlpA1)*cA*cR^3
125+
+ 9191/6*d44(cOlpR1,cOlpA1)*cA^2*cR^2
126+
- 66199/36*d44(cOlpR1,cOlpA1)*cA^3*cR
127+
+ 4463815489/5598720*d44(cOlpR1,cOlpA1)*cA^4
128+
+ 18763481/3110400*d44(cOlpR1,cOlpA1)*d44(cOlpA2,cOlpA3)*NA^-1
129+
+ 56/3*d44(cOlpA1,cOlpA2)*I2R*cR^3
130+
- 1813/15*d44(cOlpA1,cOlpA2)*I2R*cA*cR^2
131+
+ 7637/30*d44(cOlpA1,cOlpA2)*I2R*cA^2*cR
132+
- 21073/120*d44(cOlpA1,cOlpA2)*I2R*cA^3
133+
- 224*d66(cOlpR1,cOlpA1)*cR^2
134+
+ 2704/3*d66(cOlpR1,cOlpA1)*cA*cR
135+
- 7912/9*d66(cOlpR1,cOlpA1)*cA^2
136+
+ 168*d444(cOlpR1,cOlpA1,cOlpA2)*cR^2
137+
- 3416/5*d444(cOlpR1,cOlpA1,cOlpA2)*cA*cR
138+
+ 4380543991/6220800*d444(cOlpR1,cOlpA1,cOlpA2)*cA^2
139+
+ 536/15*d444(cOlpA1,cOlpA2,cOlpA3)*I2R*cR
140+
- 125711/1575*d444(cOlpA1,cOlpA2,cOlpA3)*I2R*cA
141+
+ 896/3*d644(cOlpR1,cOlpA1,cOlpA2)*cR
142+
- 9296/15*d644(cOlpR1,cOlpA1,cOlpA2)*cA
143+
- 2624/9*d644(cOlpA1,cOlpR1,cOlpA2)*cR
144+
+ 3902758067/6531840*d644(cOlpA1,cOlpR1,cOlpA2)*cA
145+
- 4544/135*d644(cOlpA1,cOlpA2,cOlpA3)*I2R
146+
+ 136*d88(cOlpR1,cOlpA1)
147+
+ 35*d844(cOlpR1,cOlpA1,cOlpA2)
148+
- 31931/1440*d844(cOlpA1,cOlpR1,cOlpA2)
149+
- 1312/3*d664(cOlpR1,cOlpA1,cOlpA2)
150+
+ 659/12*d664(cOlpA1,cOlpA2,cOlpR1)
151+
- 14215999/1036800*d4444a(cOlpR1,cOlpA1,cOlpA2,cOlpA3)
152+
+ 213768787/1036800*d4444b(cOlpA1,cOlpA2,cOlpR1,cOlpA3)
153+
;
154+
155+
Local G16 = -G16
156+
- 121/31104*NA*cA^8
157+
- 13/432*d44(cOlpA1,cOlpA2)*cA^4
158+
+ 91/90*d444(cOlpA1,cOlpA2,cOlpA3)*cA^2
159+
- 16/27*d644(cOlpA1,cOlpA2,cOlpA3)*cA
160+
+ d4444a(cOlpA1,cOlpA2,cOlpA3,cOlpA4)
161+
;
162+
163+
Local QQ8 = -QQ8
164+
+ 367/54432*NA*I2R^2*cA^6
165+
+ 64899031/16588800*cOldddff(cOlpR1,cOlpR2,cOlpA1)*cA
166+
- 17/12*cOldff554(cOlpR1,cOlpR2,cOlpA1)
167+
- 159094348241/5016453120000*d33(cOlpR1,cOlpR2)*cA^5
168+
+ 35065709/17915904000*d33(cOlpR1,cOlpR2)*d44(cOlpA1,cOlpA2)*NA^-1*cA
169+
+ 9012683/18662400*d44(cOlpR1,cOlpR2)*cA^4
170+
+ 318287/3110400*d44(cOlpR1,cOlpR2)*d44(cOlpA1,cOlpA2)*NA^-1
171+
- 7/27*d44(cOlpR1,cOlpA1)*I2R*cA^3
172+
- 431647/12441600*d44(cOlpR1,cOlpA1)*d44(cOlpR2,cOlpA2)*NA^-1
173+
+ 11/360*d44(cOlpA1,cOlpA2)*I2R^2*cA^2
174+
- 359/432*d55(cOlpR1,cOlpR2)*cA^3
175+
+ 49/24*d66(cOlpR1,cOlpR2)*cA^2
176+
+ 4/9*d66(cOlpR1,cOlpA1)*I2R*cA
177+
+ 20096267/41472000*d543(cOlpR1,cOlpA1,cOlpR2)*cA^2
178+
+ 256036391/580608000*d543(cOlpR2,cOlpA1,cOlpR1)*cA^2
179+
- 1099101299/248832000*d444(cOlpR1,cOlpR2,cOlpA1)*cA^2
180+
- 7/30*d444(cOlpR1,cOlpA1,cOlpA2)*I2R*cA
181+
+ 17/1575*d444(cOlpA1,cOlpA2,cOlpA3)*I2R^2
182+
- 7/3*d77(cOlpR1,cOlpR2)*cA
183+
+ 4794133/4147200*d653(cOlpA1,cOlpR1,cOlpR2)*cA
184+
+ 70310809/58060800*d653(cOlpA1,cOlpR2,cOlpR1)*cA
185+
- 49/36*d644(cOlpR1,cOlpR2,cOlpA1)*cA
186+
+ 7/45*d644(cOlpR1,cOlpA1,cOlpA2)*I2R
187+
- 49/36*d644(cOlpR2,cOlpR1,cOlpA1)*cA
188+
+ 7804501/1814400*d644(cOlpA1,cOlpR1,cOlpR2)*cA
189+
- 5/27*d644(cOlpA1,cOlpR1,cOlpA2)*I2R
190+
- 359/180*d554(cOlpR1,cOlpR2,cOlpA1)*cA
191+
- 19720033979/104509440000*d4433b(cOlpA1,cOlpA2,cOlpR1,cOlpR2)*cA
192+
+ d88(cOlpR1,cOlpR2)
193+
+ 35/96*d853(cOlpA1,cOlpR1,cOlpR2)
194+
+ 13/1440*d853(cOlpA1,cOlpR2,cOlpR1)
195+
+ 199/540*d844(cOlpA1,cOlpR1,cOlpR2)
196+
- 1/3*d763(cOlpR1,cOlpA1,cOlpR2)
197+
- 1/3*d763(cOlpR2,cOlpA1,cOlpR1)
198+
+ 7/6*d754(cOlpR2,cOlpR1,cOlpA1)
199+
+ 7/4*d664(cOlpR1,cOlpR2,cOlpA1)
200+
- 5/6*d664(cOlpR1,cOlpA1,cOlpR2)
201+
- 5/6*d664(cOlpR2,cOlpA1,cOlpR1)
202+
- 1/6*d655(cOlpA1,cOlpR1,cOlpR2)
203+
- 7437791/41472000*d6433b(cOlpA1,cOlpA2,cOlpR1,cOlpR2)
204+
- 12199/1382400*d6433c(cOlpA1,cOlpA2,cOlpR1,cOlpR2)
205+
- 119473/6220800*d6433c(cOlpA1,cOlpA2,cOlpR2,cOlpR1)
206+
+ 1403/115200*d5443a(cOlpR1,cOlpA1,cOlpA2,cOlpR2)
207+
- 226219/4147200*d5443a(cOlpR2,cOlpA1,cOlpA2,cOlpR1)
208+
+ 18757/57600*d5443c(cOlpR1,cOlpA1,cOlpA2,cOlpR2)
209+
+ 951979/2073600*d5443c(cOlpR2,cOlpA1,cOlpA2,cOlpR1)
210+
- 253697/1658880*d4444a(cOlpR1,cOlpR2,cOlpA1,cOlpA2)
211+
+ 1167989/2764800*d4444a(cOlpR1,cOlpA1,cOlpR2,cOlpA2)
212+
+ 1498639/4147200*d4444b(cOlpR2,cOlpA1,cOlpR1,cOlpA2)
213+
- 76367/1036800*d4444b(cOlpA1,cOlpA2,cOlpR1,cOlpR2)
214+
;
215+
216+
Local QG8 = -QG8
217+
+ 353/54432*NA*I2R*cA^7
218+
+ 4641769/44789760*d44(cOlpR1,cOlpA1)*cA^4
219+
+ 2638717/12441600*d44(cOlpR1,cOlpA1)*d44(cOlpA2,cOlpA3)*NA^-1
220+
- 19/180*d44(cOlpA1,cOlpA2)*I2R*cA^3
221+
+ 163/72*d66(cOlpR1,cOlpA1)*cA^2
222+
- 2085523/24883200*d444(cOlpR1,cOlpA1,cOlpA2)*cA^2
223+
+ 52/1575*d444(cOlpA1,cOlpA2,cOlpA3)*I2R*cA
224+
- 77/60*d644(cOlpR1,cOlpA1,cOlpA2)*cA
225+
- 3874757/26127360*d644(cOlpA1,cOlpR1,cOlpA2)*cA
226+
- 2/135*d644(cOlpA1,cOlpA2,cOlpA3)*I2R
227+
+ d88(cOlpR1,cOlpA1)
228+
+ 199/540*d844(cOlpA1,cOlpR1,cOlpA2)
229+
+ 11/12*d664(cOlpR1,cOlpA1,cOlpA2)
230+
- 5/6*d664(cOlpA1,cOlpA2,cOlpR1)
231+
+ 2914957/4147200*d4444a(cOlpR1,cOlpA1,cOlpA2,cOlpA3)
232+
- 120809/829440*d4444b(cOlpA1,cOlpA2,cOlpR1,cOlpA3)
233+
;
234+
235+
Local GG8 = -GG8
236+
+ 61/15552*NA*cA^8
237+
- 13/432*d44(cOlpA1,cOlpA2)*cA^4
238+
+ 91/90*d444(cOlpA1,cOlpA2,cOlpA3)*cA^2
239+
- 16/27*d644(cOlpA1,cOlpA2,cOlpA3)*cA
240+
+ d4444a(cOlpA1,cOlpA2,cOlpA3,cOlpA4)
241+
;
242+
243+
Local girth14 = -girth14
244+
+ 1/648*NA*cA^7
245+
- 8/15*d444(cOlpA1,cOlpA2,cOlpA3)*cA
246+
+ 16/9*d644(cOlpA1,cOlpA2,cOlpA3)
247+
;
248+
249+
Local fiveq = -fiveq
250+
+ 1/192*NA*I2R^5*cA^3
251+
+ 1/4*d33(cOlpR1,cOlpR2)*I2R^3*cA^2
252+
+ 5/48*d33(cOlpR1,cOlpR2)*d33(cOlpR3,cOlpR4)*NA^-1*I2R*cA
253+
+ 5/48*d33(cOlpR1,cOlpR3)*d33(cOlpR2,cOlpR4)*NA^-1*I2R*cA
254+
+ 1/8*d33(cOlpR1,cOlpR4)*d33(cOlpR2,cOlpR3)*NA^-1*I2R*cA
255+
+ 1/16*d44(cOlpR1,cOlpA1)*I2R^4
256+
+ 3/8*d433(cOlpR3,cOlpR1,cOlpR2)*I2R^2*cA
257+
+ 1/2*d3333(cOlpR1,cOlpR2,cOlpR3,cOlpR4)*I2R*cA
258+
+ d43333a(cOlpR5,cOlpR2,cOlpR1,cOlpR4,cOlpR3)
259+
;
260+
.sort
261+
262+
#do ex = {`activeexprnames_'}
263+
#if `ZERO_`ex'' == 0
264+
#message Error in `ex'
265+
#terminate
266+
#endif
267+
#enddo
268+
*--#]
269+
270+
.end

0 commit comments

Comments
 (0)