[SCIP] Getting address of transformed variables

Stefan Helber stefan.helber at prod.uni-hannover.de
Thu May 5 14:59:16 CEST 2022


Dear Marc,



Thanks a lot, I do indeed think that your hints are very valuable and helped me to identify some basic misunderstandings on my side. Your suggestion that the segmentation fault problem may be due to some memory corruption caused elsewhere seems plausible and I will explore this venue. I also now understand that I always have to release all the variables which I create myself. I will go and chase my bug, and Valgrind might become my friend on the way.



Again, thanks a lot for the clarifying words!



Stefan



-----Ursprüngliche Nachricht-----
Von: Scip [mailto:scip-bounces at zib.de] Im Auftrag von Marc Pfetsch
Gesendet: Montag, 2. Mai 2022 19:40
An: scip at zib.de
Betreff: Re: [SCIP] Getting address of transformed variables







Dear Stefan,



I don't think that I can solve your problem, but I will try to give some hints.



> However, when I try to get the addresses of the transformed variables

> like this

>

>

> SCIPgetTransformedVar( _scip, p_dicbapsolver->_vars_usageLinks[

> *(_d->link_it) ], &(p_dicbapsolver->_vars_usageLinks[ *(_d->link_it)

> ])

>

> which seems to be perfectly analogous, I get a segmentation fault.



Have you checked whether the problem lies in you data structures by using a debugger? It could also be that at some other place of you code memory is corrupted and the segmentation fault is only a secondary sign that some problem occurred. Under Linux you might want to run valgrind to check whether something strange happens.



> As a consequence, those auxiliary variables to enforce branching

> decisions which I added initially to the master problem do not get

> automatically released ,even though I set the "true" flag for this

> option when I created the pricer in the first place (as well as for

> the branching rule and the constraint handler, of course).



What do you mean by setting the option to "true"? I do not think that such an option exists. You need to release these variables by yourself in any case.



> So to get rid of

> the warning, I release all those variables "manually" right before I

> free the SCIP object itself, which works.



Yes, this should be the right way.



> Would it be better to add those auxiliary variables to the constraints

> of the transformed master problem when the pricer is initialized (as

> opposed to adding them intially to the "original" master problem

> before the transformation takes place)? That should also work, I

> think, even though I have not yet tried it.



In principle, this should not make a difference, but there might be a bug somewhere.



Best



Marc

_______________________________________________

Scip mailing list

Scip at zib.de<mailto:Scip at zib.de>

https://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20220505/bddb2a63/attachment.html>


More information about the Scip mailing list