Skip to content

Commit 0d463ce

Browse files
committed
better debugging
1 parent d19cb26 commit 0d463ce

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/graph_polynomials.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function graph_polynomial(gp::GraphProblem, ::Val{:finitefield}; usecuda=false,
7272
local res, respre
7373
for k = 1:max_iter
7474
N = prevprime(N-TI(1))
75+
@debug "iteration $k, computing on GP$(N) ..."
7576
T = Mods.Mod{N,TI}
7677
rk = _polynomial_single(gp, T; usecuda=usecuda, maxorder=maxorder)
7778
push!.(YS, rk)
@@ -95,10 +96,12 @@ end
9596

9697
contractx(gp::GraphProblem, x; usecuda=false) = contractf(_->x, gp; usecuda=usecuda)
9798
function contractf(f, gp::GraphProblem; usecuda=false)
99+
@debug "generating tensors ..."
98100
xs = generate_tensors(f, gp)
99101
if usecuda
100102
xs = CuArray.(xs)
101103
end
104+
@debug "contracting tensors ..."
102105
gp.code(xs...)
103106
end
104107

@@ -108,13 +111,13 @@ function generate_tensors(fx, gp::Independence)
108111
ixs = collect_ixs(gp.code)
109112
n = length(unique!(vcat(ixs...)))
110113
T = typeof(fx(ixs[1][1]))
111-
return Tuple(map(enumerate(ixs)) do (i, ix)
114+
return map(enumerate(ixs)) do (i, ix)
112115
if i <= n
113116
misv(fx(ix[1]))
114117
else
115118
misb(T, length(ix)) # if n!=2, it corresponds to set packing problem.
116119
end
117-
end)
120+
end
118121
end
119122

120123
function misb(::Type{T}, n::Integer=2) where T

src/networks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function optimize_code(@nospecialize(code::EinTypes), ::Val{optmethod}; sc_targe
148148
else
149149
ArgumentError("optimizer `$optmethod` not defined.")
150150
end
151-
println("time/space complexity is $(OMEinsum.timespace_complexity(optcode, size_dict))")
151+
@info "time/space complexity is $(OMEinsum.timespace_complexity(optcode, size_dict))"
152152
return optcode
153153
end
154154

0 commit comments

Comments
 (0)