[Scip] problems with SCIPfree / SCIPreleaseCons
Stefan Heinz
heinz at zib.de
Wed Mar 7 21:47:16 MET 2012
Hi,
the answer is: It depends. Did you check the following explanation for
capturing and releasing
http://scip.zib.de/doc/html/OBJ.html
After you created a constraint or a variable the objects have are
captured. The simple reason for that is, if these objects are not
captured they would get deleted right away. The capture which is added
during creation is the one the user has to worry about. If you store the
constraints and variables internally you do at that moment of creation
usually nothing except adding these things to the SCIP problem. During
the adding process another capture is put on the objects. For these
capture you as a user do not need to worry about. These are internal
SCIP captures. In the end when you are deleting you data structure you
need to call the release function to remove the capture which was
created during the creation of the objects.
Hope that clear that issue a little bit.
On 03/06/2012 05:05 PM, Hélène Toussaint wrote:
> Hi,
>
> I have a BCP code with one pricer and one constraint handler. I keep
> in memory all the variables (included the variables generated by the
> pricer) and all the initial constraints. I use several vectors like it
> is done in the queens example. The constraints generated by the
> constraints handler are not kept in memory. The initial constraints
> are changed when I generate a new variable.
>
> I'd like to release all variables and constraints and free SCIP in the
> same way it is done in the queens example but it causes assertions:
>
> If I call these functions :
>
> SCIPreleaseVar
>
> SCIPreleaseCons
>
> SCIPfree
>
> I have the following message caused by SCIPreleaseCons:
>
> src/scip/cons.c:4933: SCIPconsRelease: Assertion `!(*cons)->active ||
> (*cons)->updatedeactivate' failed.
>
This looks like that you called the release function to often. That has
the effect that you remove a capture count which is made internally by
SCIP which results into the deletion of the objected since the count
reaches zero. The assert() check if the constraint in not active which
should not be the case if it gets deleted.
> If I don't call SCIPreleaseCons the SCIPfree function asserts:
>
> src/scip/var.c:2842: SCIPvarAddLocks: Assertion `var != ((void *)0)'
> failed.
>
I'am not really sure what forces this assert(). If the above stuff does
not help send as the back trace such that we see the function call order.
> I have tried to run with valgrind (with the flag --leak-check=full)
> but it did not give me useful information.
>
That does not help to find the issue :-(
Best Stefan
> I don't understand why I get these assertions. Do you have an idea?
>
> Best,
>
> Hélène
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
More information about the Scip
mailing list