<div dir="ltr"><div class="gmail_quote">I would say that removing the exit call leaves a lot of memory unreachable since it&#39;s supposed to be freed by the process destruction procedure.<br><div dir="ltr"><br>Try launching your own process:<br>
<br><div style="margin-left: 40px;">

<span style="font-family: courier new,monospace;">// For fork().</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#include &lt;unistd.h&gt;</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">// For waitpid().</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#include &lt;sys/wait.h&gt;</span><br></div><div style="margin-left: 80px;">


<br></div><div style="margin-left: 40px; font-family: courier new,monospace;">...<br><br>void MyClass::launch() {<br><br></div><div style="margin-left: 80px; font-family: courier new,monospace;">int res = -1;<br></div><div style="margin-left: 40px; font-family: courier new,monospace;">


<br></div><div style="margin-left: 80px; font-family: courier new,monospace;">if ((res = fork()) == 0) {<br>
&nbsp; // Child process<br><br>&nbsp; // Initializations is your class inheriting from USER_initialize<br>&nbsp; Initializations init;<br><br>&nbsp; bcp_main(0, NULL, &amp;init);<br></div><div style="margin-left: 80px; font-family: courier new,monospace;">


}<br>else if (res &gt; 0) {<br>&nbsp; // Parent process<br>&nbsp; <br>&nbsp; int status = 0;<br><br>
&nbsp; waitpid(res,&amp;status,0);<br><br>&nbsp; assert(WIFEXITED(status));<br>}<br>else {<br>&nbsp; // error forking<br>}<br></div><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">}</span><br></div><br>


<br>I don&#39;t know if it&#39;s the best way to go but it works for me.<br><br clear="all">Dani PĂ©rez.<br>
<br><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Tue, Sep 2, 2008 at 5:49 PM, Eric W Anderson <span dir="ltr">&lt;<a href="mailto:Eric.Anderson@colorado.edu" target="_blank">Eric.Anderson@colorado.edu</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">

I&#39;m new to using BCP, so I apologize if this is a dumb question: &nbsp;Is there a<br>
right way to invoke a BCP-based solver as a subroutine? &nbsp;I see that bcp_main<br>
terminates with exit(), at least in serial mode, rather than returning. &nbsp;If I<br>
comment out the exit(0) call in BCP_single_environment::register_process(), and<br>
my application calls bcp_main(), everything seems to work as intended.<br>
<br>
It seems like this is actively subverting the way BCP wants to be run, though,<br>
so I&#39;m wondering: (a) is there a hidden pitfall to doing what I&#39;m doing, and<br>
(b) is there a better way to be doing it?<br>
<br>
Thanks for any help,<br>
Eric<br>
<font color="#888888"><br>
--<br>
Eric W. Anderson &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; University of Colorado<br>
<a href="mailto:eric.anderson@colorado.edu" target="_blank">eric.anderson@colorado.edu</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dept. of Computer Science<br>
phone: +1-720-984-8864 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Systems Research Lab - ECCR 1B54<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PGP key fingerprints:<br>
 &nbsp; &nbsp; &nbsp; personal: 1BD4 CFCE 8B59 8D6E EA3E &nbsp;EBD5 4DC9 3E61 656C 462B<br>
 &nbsp; &nbsp; &nbsp; academic: D3C5 D6FF EDED 9F1F C36D &nbsp;53A3 74B7 53A6 3C74 5F12<br>
</font><br></div></div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.6 (GNU/Linux)<br>
<br>
iD8DBQFIvWCBdLdTpjx0XxIRAtv+AJ0X2brpHmeML1BjQz1tLpMItU24fgCffjZ2<br>
cVaXoVM71rxqLyiCUqRpK1Q=<br>
=D/BK<br>
-----END PGP SIGNATURE-----<br>
<br>_______________________________________________<br>
BCP mailing list<br>
<a href="mailto:BCP@list.coin-or.org" target="_blank">BCP@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/bcp" target="_blank">http://list.coin-or.org/mailman/listinfo/bcp</a><br>
<br></blockquote></div><br></div>
</div><br></div>