[Top][All Lists]

[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

From: Heinrich Schuchardt
Subject: Re: [Help-glpk] I am not sure if it falls under the issue of "Thread Safety of GLPK"
Date: Wed, 21 May 2014 20:46:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0

Hello Amit,

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.

Best regards

Heinrich Schuchardt

On 21.05.2014 14:18, Amit Gurung wrote:
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
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

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

reply via email to

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