<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
   {font-family:"Cambria Math";
   panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
   {font-family:Calibri;
   panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
   {font-family:Tahoma;
   panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
   {font-family:Consolas;
   panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
   {margin:0cm;
   margin-bottom:.0001pt;
   font-size:12.0pt;
   font-family:"Times New Roman","serif";
   color:black;}
a:link, span.MsoHyperlink
   {mso-style-priority:99;
   color:blue;
   text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
   {mso-style-priority:99;
   color:purple;
   text-decoration:underline;}
pre
   {mso-style-priority:99;
   mso-style-link:"HTML Vorformatiert Zchn";
   margin:0cm;
   margin-bottom:.0001pt;
   font-size:10.0pt;
   font-family:"Courier New";
   color:black;}
span.HTMLVorformatiertZchn
   {mso-style-name:"HTML Vorformatiert Zchn";
   mso-style-priority:99;
   mso-style-link:"HTML Vorformatiert";
   font-family:Consolas;
   color:black;}
span.E-MailFormatvorlage19
   {mso-style-type:personal-reply;
   font-family:"Calibri","sans-serif";
   color:#1F497D;}
.MsoChpDefault
   {mso-style-type:export-only;
   font-size:10.0pt;}
@page WordSection1
   {size:612.0pt 792.0pt;
   margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
   {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>thank you very much for your work!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As I&#8217;ll be away for the holidays, I&#8217;ll try your patch in the new year and will report back.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Can you elaborate on the cut generator problem? Is it user-specified which one is used, or is this a choice done by the algorithm?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>And can you point me at the source code for them, so that I can check them for thread safety in case we actually use them?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Cornelius Riemenschneider<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>ITscope GmbH<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Ludwig-Erhard-Allee 20<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>76131 Karlsruhe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Email: cornelius.riemenschneider@itscope.de<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>https://www.itscope.com<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Handelsregister: AG Mannheim, HRB 232782<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Sitz der Gesellschaft: Karlsruhe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Gesch&#228;ftsf&#252;hrer: Alexander M&#252;nkel, Benjamin Mund, Stefan Reger<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> john.forrest@fastercoin.com [mailto:cbc-bounces@list.coin-or.org] <b>Im Auftrag von </b>John Forrest<br><b>Gesendet:</b> Mittwoch, 18. Dezember 2013 14:23<br><b>An:</b> cbc@list.coin-or.org<br><b>Betreff:</b> Re: [Cbc] Threadsafe usage of Cbc<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>Cornelius,<br><br>I have made some changes, which I hope will be enough for you.&nbsp; I have done the minimum amount of work.<br><br>I don't think they can hurt anyone but as Ted Ralphs is preparing a new release, I will delay updating Cbc/stable/CbcSolver.?pp for a day or two.&nbsp; If anyone wants to test the code I attach CbcSolver.?pp.<br><br>You need to compile with -DCBC_THREAD_SAFE.&nbsp; The main thing this does is that Cbc only reads argv/argc type parameters in a crude threadsafe way.&nbsp; You also need to use alternative versions of CbcMain0/1.<br><br>parallel.cpp has been added to Cbc/examples which is a simple example.<br><br>Please tell me if there are any problems.&nbsp; Some lesser used Cgl cut generators may not be threadsafe, but I think the commonly used ones are.<br><br>John Forrest<br><br><br>On 17/12/13 15:11, Cornelius Riemenschneider wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hello,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>we use CBC via googles or-tools from java in our application.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Compared to scientific problems, our problems are small and solved by Cbc in &lt;1s (which is great!).<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>As we process requests from users concurrently, we&#8217;d also like to call Cbc concurrently.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Currently, this is impossible, because Cbc uses the static parameters array in CbcMain0 and CbcMain1 and thus crashes or reads incorrect parameters.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>One backtrace, for example is:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>#2 0x00007fb3435bf52b in __libc_message (do_abort=&lt;optimized out&gt;, fmt=&lt;optimized out&gt;) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189<br>#3 0x00007fb3435c8d76 in malloc_printerr (action=3, str=0x7fb3436a1248 &quot;double free or corruption (!prev)&quot;, ptr=&lt;optimized out&gt;) at malloc.c:6283<br>#4 0x00007fb3435cdaac in *__GI___libc_free (mem=&lt;optimized out&gt;) at malloc.c:3738<br>#5 0x00007fb342733f06 in std::string::assign(std::string const&amp;) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6<br>#6 0x00007fb2d652cb7b in establishParams(int&amp;, CbcOrClpParam*) () from libjnilinearsolver.so<br>#7 0x00007fb2d64edc3b in CbcMain0(CbcModel&amp;) () from libjnilinearsolver.so<br>#8 0x00007fb2d6511bec in callCbc(char const*, CbcModel&amp;) () from libjnilinearsolver.so<br>#9 0x00007fb2d64e3fce in operations_research::CBCInterface::Solve(operations_research::MPSolverParameters const&amp;) () from libjnilinearsolver.so<br>#10 0x00007fb2d64cfe45 in operations_research::MPSolver::Solve(operations_research::MPSolverParameters const&amp;) () from libjnilinearsolver.so<br>#11 0x00007fb2d64cff3b in operations_research::MPSolver::Solve() () from libjnilinearsolver.so<br>#12 0x00007fb2d64c91cf in Java_com_google_ortools_linearsolver_mainJNI_MPSolver_1solve_1_1SWIG_10 () from libjnilinearsolver.so<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'># from here on it&#8217;s just the JVM<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>As I don&#8217;t know the code and it&#8217;s hard to read, I can&#8217;t really fix the problem by myself,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>but wouldn&#8217;t it be better to move parameters inside CbcModel instead of having a static array laying around?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Andi f that&#8217;s done (or another solution is found), do you know of any thread-safety issues in cbc?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Keep in mind, we don&#8217;t want Cbc to solve our problem in multiple threads, we just want to be able to solve different problems simultaneous.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Cornelius Riemenschneider<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>--<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ITscope GmbH<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Ludwig-Erhard-Allee 20<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>76131 Karlsruhe<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Email: <a href="mailto:cornelius.riemenschneider@itscope.de">cornelius.riemenschneider@itscope.de</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="https://www.itscope.com">https://www.itscope.com</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Handelsregister: AG Mannheim, HRB 232782<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Sitz der Gesellschaft: Karlsruhe<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Gesch&#228;ftsf&#252;hrer: Alexander M&#252;nkel, Benjamin Mund, Stefan Reger<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Cbc mailing list<o:p></o:p></pre><pre><a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><o:p></o:p></pre><pre><a href="http://list.coin-or.org/mailman/listinfo/cbc">http://list.coin-or.org/mailman/listinfo/cbc</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>