Skip to content
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

number of parallel threads invoked by CPLEX parallel optimizer not working #904

Closed
CBongiova opened this issue Nov 28, 2016 · 6 comments
Closed

Comments

@CBongiova
Copy link

CBongiova commented Nov 28, 2016

Dear all,

I have included callbacks in my JuMP function, which in return turns off parallel processing in CPLEX.
Having a look online, I found I can invoke the CplexSolver and set CPX_PARAM_THREADS=4. This parameter specifies how CPLEX should bind threads to cores on platforms where CPLEX supports binding threads to cores ( see https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.6.3/ilog.odms.cplex.help/CPLEX/Parameters/topics/Threads.html)

Nevertheless, when I then run my runfile I get the following message:

"Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x64f645ea -- jl_gc_pool_alloc at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:832
while loading C:\Users\bongiova\Desktop\Scripts_Julia\EDARP\run.jl, in expression starting on line 13"

where my expression starting on line 13 is just the following:

model.solveEDARP("C:/Users/bongiova/Desktop/Scripts_Julia/EDARP/mor2-16.txt",solver=CplexSolver(CPX_PARAM_CUTSFACTOR=1,CPX_PARAM_THREADS=4),valid=true)

(where solveEDARP(path; relax=false, solver=CplexSolver(), valid::Bool = true) is my function containing the optimization model in JuMP)

Does anyone have an idea about what is going on? Is this a Julia bug?

screenshot 48

@joehuchette
Copy link
Contributor

Yes, it appears that julia and CPLEX's multithreading are not interacting properly. What version of Julia/JuMP/CPLEX are you using?

@CBongiova
Copy link
Author

CBongiova commented Nov 28, 2016

Hi joehuchette,
Thanks for your answer! I am using julia 0.5.0 (the latest release) with cplex version 12.6.2.0. My JuMP version is 0.14.1
Do you think there might be a way to fix this issue and use CPLEX's multithreading in julia?

@joehuchette
Copy link
Contributor

joehuchette commented Nov 28, 2016

Could you post a minimal reduction of your code that completely reproduces the problem?

@CBongiova CBongiova reopened this Nov 28, 2016
@mlubin
Copy link
Member

mlubin commented Nov 29, 2016

http://www.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.cplex.help/CPLEX/UsrMan/topics/progr_adv/callbacks_adv/05_thread_safety.html

It is then the responsibility of the user to implement that control callback in such a way that the callback is thread-safe.

I wouldn't expect this to work at all in Julia, would need some deep technical work to understand and correctly fix the issue. You could try using Gurobi which doesn't require its callbacks to be thread safe.

Anyway we ought to display a warning in CPLEX.jl if you use threads and callbacks until this is resolved.

@CBongiova
Copy link
Author

Thanks, multithreading seems to be working fine in Gurobi.

@mlubin
Copy link
Member

mlubin commented Dec 4, 2016

Closed in favor of jump-dev/CPLEX.jl#98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants