提交 b1c4abae authored 作者: Frederic Bastien's avatar Frederic Bastien

Debugprint of clients

上级 e3569d12
...@@ -575,7 +575,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False, ...@@ -575,7 +575,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
if prefix_child is None: if prefix_child is None:
prefix_child = prefix prefix_child = prefix
def get_id_str(obj): def get_id_str(obj, get_printed=True):
if obj in done: if obj in done:
id_str = done[obj] id_str = done[obj]
elif ids == "id": elif ids == "id":
...@@ -586,7 +586,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False, ...@@ -586,7 +586,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
id_str = "[id %s]" % char_from_number(len(done)) id_str = "[id %s]" % char_from_number(len(done))
elif ids == "": elif ids == "":
id_str = "" id_str = ""
done[obj] = id_str if get_printed:
done[obj] = id_str
return id_str return id_str
...@@ -629,14 +630,26 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False, ...@@ -629,14 +630,26 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
data = "" data = ""
if smap: if smap:
data = " " + str(smap.get(a.outputs[0], '')) data = " " + str(smap.get(a.outputs[0], ''))
clients = ''
if len(getattr(r, 'clients', [])) > 1:
def get_index(c):
try:
return order.index(c)
except ValueError:
return -1
clients = " clients:" + str([(get_id_str(c, False), get_index(c))
for c,i in r.clients
if c != 'output'])
if profile is None or a not in profile.apply_time: if profile is None or a not in profile.apply_time:
print('%s%s%s %s%s \'%s\' %s %s %s%s' % (prefix, a.op, print('%s%s%s %s%s \'%s\' %s %s %s%s%s' % (prefix, a.op,
idx, idx,
id_str, type_str, id_str, type_str,
r_name, r_name,
destroy_map_str, destroy_map_str,
view_map_str, view_map_str,
o, data), file=file) o, data, clients), file=file)
# if len(r.clients) > 1:
# import pdb;pdb.set_trace()
else: else:
op_time = profile.apply_time[a] op_time = profile.apply_time[a]
op_time_percent = (op_time / profile.fct_call_time) * 100 op_time_percent = (op_time / profile.fct_call_time) * 100
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论