I am using PATHSolver to solve linear complementarity problems. I have no problem when using it “normally”, but I get this error when I use parallel computing, as below.
What seems to be problematic is the presence of the while loop in the function (same if I use a for loop). Any ideas?
addprocs(3)
@everywhere using PATHSolver
M = [0 0 -1 -1 ;
0 0 1 -2 ;
1 -1 2 -2 ;
1 2 -2 4 ]
q1 = [2; 2; -2; -6]
q2 = [1; 2; 3; -6]
q3 = [5; 2; 3; -6]
q4 = [6; 1; 8; -6]
q = [q1,q2,q3,q4]
@everywhere function examplefun(M,q)
i = 1
f = 0
while i < 10
myfunc(x) = M*x + q
n = 4
lb = zeros(n)
ub = 100*ones(n)
options(convergence_tolerance=1e-6, output=:no, cumulative_iteration_limit=100000, crash_iteration_limit=200, time_limit=3600)
z, f = solveLCP(myfunc,M, lb, ub)
i = i+1
end
return f
end
@everywhere mutable struct state_solve
M::Array{Int64,2}
q::Array{Int64,1}
end
@everywhere function solve(state::state_solve)
M = state.M
q = state.q
sol = examplefun(M,q)
end
parSim = [state_solve(M,qi) for qi in q]
@time solve_result = pmap(solve,parSim)
ERROR: On worker 3:
IOError: unlink: no such file or directory (ENOENT)
uv_error at ./libuv.jl:97 [inlined]
unlink at ./file.jl:888
#rm#9 at ./file.jl:268
rm at ./file.jl:260 [inlined]```