improved printing of stochastic optimization warning in debugmode

上级 91478ce7
...@@ -1174,21 +1174,31 @@ class _Maker(FunctionMaker): #inheritance buys a few helper functions ...@@ -1174,21 +1174,31 @@ class _Maker(FunctionMaker): #inheritance buys a few helper functions
if li != l0 : if li != l0 :
infolog = StringIO() infolog = StringIO()
print >> infolog, "WARNING: Optimization process is unstable..." print >> infolog, "WARNING: Optimization process is unstable..."
print >> infolog, " (HINT: Ops that the nodes point to must compare equal)"
print >> infolog, "(event index) (one event trace) (other event trace)" print >> infolog, "(event index) (one event trace) (other event trace)"
print >> infolog, "-----------------------------------------------------" print >> infolog, "-----------------------------------------------------"
for j in xrange(max(len(li), len(l0))): for j in xrange(max(len(li), len(l0))):
if j >= len(li) or j >= len(l0) or li[j] != l0[j]: if j >= len(li):
print >> infolog, "* ", j print >> infolog, 'trailing event in optimization 0 :', j
if j < len(li): print >> infolog, ' ', str(l0[j])
msg = str(li[j]) elif j >= len(l0):
else: print >> infolog, 'trailing event in optimization', i, ':', j
msg = '-' print >> infolog, ' ', str(li[j])
print >> infolog, " ", msg elif li[j] != l0[j]:
if j < len(l0): print 'non-equal optimization events', i, ':', j
msg = str(l0[j]) print >>infolog, ' ', str(l0[j])
else: print >>infolog, ' ', str(li[j])
msg = '-' #print >> infolog, "* ", j,
print >> infolog, " ", msg #if j < len(li):
# msg = str(li[j])
#else:
# msg = '-'
#print >> infolog, " ", msg
#if j < len(l0):
# msg = str(l0[j])
#else:
# msg = '-'
#print >> infolog, " ", msg
#backport #backport
#print >> infolog, " ", str(li[j]) if j < len(li) else '-', #print >> infolog, " ", str(li[j]) if j < len(li) else '-',
#print >> infolog, " ", str(l0[j]) if j < len(l0) else '-' #print >> infolog, " ", str(l0[j]) if j < len(l0) else '-'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论