Skip to content

Commit 9dbd072

Browse files
committed
parallel build fn fixes
1 parent 69d0432 commit 9dbd072

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/build_function.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,16 @@ function _build_function(target::JuliaTarget, rhss::AbstractArray, args...;
263263

264264
if parallel isa DistributedForm
265265
numworks = Distributed.nworkers()
266-
reducevars = [Variable(gensym(:MTReduceVar))() for i in 1:numworks]
266+
reducevars = [gensym(:MTReduceVar) for i in 1:numworks]
267267
lens = Int(ceil(rhs_length/numworks))
268268
finalsize = rhs_length - (numworks-1)*lens
269-
_rhss = vcat(reduce(vcat,[[getindex(reducevars[i],j) for j in 1:lens] for i in 1:numworks-1],init=Expr[]),
270-
[getindex(reducevars[end],j) for j in 1:finalsize])
269+
_rhss = vcat(reduce(vcat,[[Variable(reducevars[i],j) for j in 1:lens] for i in 1:numworks-1],init=Expr[]),
270+
[Variable(reducevars[end],j) for j in 1:finalsize])
271271

272272
elseif parallel isa DaggerForm
273-
computevars = [Variable(gensym(:MTComputeVar))() for i in axes(rhss,1)]
274-
reducevar = Variable(gensym(:MTReduceVar))()
275-
_rhss = [getindex(reducevar,i) for i in axes(rhss,1)]
273+
computevars = [gensym(:MTComputeVar) for i in axes(rhss,1)]
274+
reducevar = Variable(gensym(:MTReduceVar))
275+
_rhss = [Variable(reducevar,i) for i in axes(rhss,1)]
276276
elseif rhss isa SparseMatrixCSC
277277
_rhss = rhss.nzval
278278
else

0 commit comments

Comments
 (0)