<html>#914: Don't use fork()
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Erik Schnetter</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>resolved</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>enhancement</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>EinsteinToolkit thorn</td></tr>
</table>

<p>Changes (by Roland Haas):</p>
<p><table>
<tr><td>status:</td><td>resolved (was new)</td></tr>
</table></p>
<p>It seems that it is in many cases not safe to call fork() in MPI applications. This page <a href="http://www.open-mpi.de/faq/?category=openfabrics#ofa-fork">http://www.open-mpi.de/faq/?category=openfabrics#ofa-fork</a> has some information. The upshot seems to be:
- In many (most) cases, one can call system() or popen() to execute external processes while waiting for them.
- It is generally not safe to call fork() to execute a certain task in the background. However, it should be possible to use threads in this case.</p>
<p><strong>Keyword:</strong></p>
<p>Comment (by Roland Haas):</p>
<p>There is no more (active) code in the ET that uses fork(). The only places where <code>fork()</code> still shows up in C code is Formaline (where it is disabled by default and PTHREADS is used instead) and OpenCLRunTime (where it is commented out altogether).
In both cases there is a comment "Don't use fork, MPI may not like it".
I believe this discussion only ticket can be closed.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/914/dont-use-fork'>https://bitbucket.org/einsteintoolkit/tickets/issues/914/dont-use-fork</a></p>
</html>