[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] I am not sure if it falls under the issue of "Thread Saf
Re: [Help-glpk] I am not sure if it falls under the issue of "Thread Safety of GLPK"
Wed, 21 May 2014 20:46:25 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0
GLPK is not thread safe. So no two threads should try to call the GLPK
library at the same time.
What you can do is run multiple processes using GLPK at the same time.
On 21.05.2014 14:18, Amit Gurung wrote:
I have created a simple class GLPK_PROBLEM to implement the glpk problem
I have two for loop(one nested to the other) running for large number of
iterations (say, m * n for instance 512 x 100000).
Before the Inner for loop call i have created 2 object instance of the
class GLPK_PROBLEM and initialize them with all the constraints-values.
and inside the Inner loop i am assigning the coefficient for the maximizing
equation ( using glp_get_obj_coef ) then computing/calling the glp_simplex
(object,¶m) and using the result obtained by glp_get_obj_val(object).
In short the program creates 2 objects each time in the Outer loop for m
iterations(say) and each of these objects are used in the Inner loop n
This Work very well by GLPK package. I thank you and the glpk team with
all my heart.
But when this very operation when i try to parallelize with the outer loop
#pragma omp parallel for
it does not work well for large iterations but works well for small
iterations. And the program aborts at different location at different
My query is it this task possible?
Is my problem at all related to the issue of "*Thread safety of GLPK" ? *If
not can you please direct me where i might have gone wrong?
Also, is it necessary to use glp_delete_prob(), glp_free , glp_free_env ?
if so what should be the sequence of there usages?
Thank you in advance.
Help-glpk mailing list