<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear He<br>
<br>
There exists another callback to invoke special behavior for
sub-SCIPs, namely the NODESELCOPY callback.<br>
<br>
I see two options for you: The easy option is to disable the node
selector completely inside the sub-SCIPs and resort to one of the
default node selectors. This is achieved by setting the copy
callback to NULL.<br>
<br>
Unfortunately, it is not possible to communicate with the main
SCIP data structures in this callback, so that <br>
I would advise you to use some static global nodeselector data
pointer instead, which you initially set to NULL.<br>
<br>
Inside the include callback of your node selector, you check if
the global data is set to NULL, and if so,<br>
allocate memory for it at the moment you do it now. Whenever a
sub-SCIP tries to include your node selector as well,<br>
you can simply let it point to the same data as the main node
selector does.<br>
<br>
For being able to correctly free the global data, you could try to
count the number of node selectors that currently point to<br>
this data, and increase/decrease it correctly whenever you are now
freeing your data, but only free it when the usage counter reaches
zero.<br>
<br>
For this second suggestion, you need to modify only the your
include- and free callbacks, or possibly init/exit, depending on
where you initialize your data data structures right now. The copy
callback can be left as is, see for yourself in one of the other
node selectors of SCIP.<br>
<br>
The whole business becomes slightly more involved if your node
selector not only reads, but only modifies the data when time is
evolving, in which case you indeed have to copy the data from the
global data structure into a local data structure.<br>
<br>
Kind regards,<br>
Gregor<br>
<br>
<br>
<br>
<br>
<br>
Am 20.10.2014 um 01:23 schrieb 何河:<br>
</div>
<blockquote
cite="mid:CAL4OG_rStczBNcKuKfWEG_Eu+aLQE7ACO-Jh4DLpd0GHtCQO7w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif">
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif">Dear all,<br>
<br>
</div>
From the documentation:<br>
The NODESELINIT callback is executed after the problem was
transformed. The node selector may, e.g., use this call to
initialize his node selector data.<br>
<br>
If the INIT is costly, e.g. including file reading, is there a
way to just do it once at the beginning and simply copy the
values read? In my case, it's called many times after the
plugin is copied to solve a sub-SCIP process and the same file
is read repeatedly. Any suggestion is appreciated. Thanks!!
<div class="">
<div id=":1ji" class="" tabindex="0"><img
moz-do-not-send="true" class=""
src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"><br>
</div>
<div id=":1ji" class="" tabindex="0">He<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="http://listserv.zib.de/mailman/listinfo/scip">http://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</body>
</html>