help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] I am not sure if it falls under the issue of "Thread Safety


From: Amit Gurung
Subject: [Help-glpk] I am not sure if it falls under the issue of "Thread Safety of GLPK"
Date: Wed, 21 May 2014 05:18:52 -0700


I have created a simple class GLPK_PROBLEM to implement the glpk problem solving approach.


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,&param)  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 iterations.
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 putting in      

#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 times.
 
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.


--
Praying for your good health,

Amit Gurung,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]