8 import sys
, thread
, time
, os
23 print "\nDepth %s:" % d
24 if 'CLEAR' in os
.environ
:
26 if 'PARALLEL' in os
.environ
:
30 x
= alphaBeta(pos
, d
, top
= True, splits
= splits
)
31 print " ", removePV(x
)
32 print " ", algebraicForPV(x
['pv'])
40 print "\nDepth %s:" % d
42 x
= alphaBeta(pos
, d
, top
= True, splits
= splits
)
43 print ["no split", "one split"][splits
]
44 print " ", removePV(x
)
45 print " ", algebraicForPV(x
['pv'])
47 times
[splits
] = x
['time']
48 pvCache
, otherPVCache
= otherPVCache
, pvCache
49 speedup
= float(times
[0]) / times
[1]
50 print "Speed-up: %.2fx (ratio: %.1f%%)" % (speedup
, 100.0 /
53 if __name__
== '__main__':
54 thread
.start_new_thread(main2
, ())