<div dir="ltr"><div class="gmail_quote">sorry for duplicate, webmail fail.<br></div><div class="gmail_quote"><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On Wed, Feb 12, 2014 at 5:41 PM, Sébastien Villemot <span dir="ltr"><<a href="mailto:sebastien@debian.org" target="_blank">sebastien@debian.org</a>></span> wrote:<br>

</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">Le mardi 04 février 2014 à 23:17 +0100, Julian Taylor a écrit :<br>
> There are well known issues with the gnu openmp variant of openblas in<br>
> respect to forks of applications.<br>
<br></div><div class="">
Please find attached an example of such a breakage, using<br>
parallelisation in R. The example is run simply with:<br>
<br>
  R --vanilla < foo.R<br>
<br>
On sid, with openblas 0.2.8-3 (OpenMP), the program runs and reports 8<br>
condition numbers.<br>
<br>
On sid but with openblas 0.2.8-2 (pthreads), the program hangs.<br>
<span><font color="#888888"><br></font></span></div></blockquote><div><br><br></div><div>thanks, it hangs because R forks:<br>strace -e clone ...<br><br>> mclapply(z, f, mc.cores = num.cores)<br>clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6df0cd9a50) = 28886<br>

clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6df0cd9a50) = 28887<br>clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6df0cd9a50) = 28888<br>

clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6df0cd9a50) = 28889<br></div><div><br><br></div><div>this is the same issue that plagues python and that can be fixed with pthreads but not gnu openmp.<br>

</div><div><br></div><div>As I'm not familiar with R, can you construct a testcase where openblas is used in both the parent and the child of the fork?<br></div><div>It should also hang with openmp.<br></div></div></div>

</div>
</div><br></div>