-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #39 #59
Fix #39 #59
Conversation
PS. i removed the finalizer because it's non deterministic when it is ran. it's pointless in the code right now. |
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 96.21% 96.38% +0.17%
==========================================
Files 3 3
Lines 317 332 +15
==========================================
+ Hits 305 320 +15
Misses 12 12
Continue to review full report at Codecov.
|
ah yes, windows does not have sigaction |
src/c_wrappers.jl
Outdated
Any), | ||
Ptr{Cvoid}), | ||
prob.ref, nb_starting_points, x0s, | ||
exists_feas_sol, x_feas_sol, outputs_feas_sol, | ||
exists_inf_sol, x_inf_sol, outputs_inf_sol, prob) | ||
exists_inf_sol, x_inf_sol, outputs_inf_sol, pointer_from_objref(prob)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this as it was with Any
. Otherwise, you will have to use GC.@preserve
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thr ccall still needs to be fixed.
src/c_wrappers.jl
Outdated
statusflag = ccall((:solveNomadProblem, libnomadCInterface), Cint, | ||
(Ptr{Cvoid}, Cint, Ptr{Float64}, # internal data, number of starting points, starting points, | ||
Ptr{Cint}, Ptr{Float64}, Ptr{Float64}, # feasible solution flag, x_feas, outputs feas | ||
Ptr{Cint}, Ptr{Float64}, Ptr{Float64}, # infeasible solution flag, x_inf, output inf | ||
Any), | ||
prob.ref, nb_starting_points, x0s, | ||
exists_feas_sol, x_feas_sol, outputs_feas_sol, | ||
exists_inf_sol, x_inf_sol, outputs_inf_sol, prob) | ||
exists_inf_sol, x_inf_sol, outputs_inf_sol, pointer_from_objref(prob)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the pointer_from_objref
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to do a try
... finally
here with the free occurring in the finally. The try should start just after we obtain the CNomadProblem.
In case of an error, we should always free.
yeah, i'll fix this tonight, i think it should no be tied to c_Nomad_problem |
@amontoison this is ready to be merged, it's either this or a fork of nomad that doesn't set handlers. After than i'll have another patch ready for the compatibility with nomad 4.2 |
Hi, how should I run multithread with NOMAD.jl. I tried with the following:
but it gives the following error:
What could be the problem? |
This makes it possible to run threaded function in nomad.jl
ref: https://discourse.julialang.org/t/x/84343