- removed comment
Don't use fork()
It seems that it is in many cases not safe to call fork() in MPI applications. This page http://www.open-mpi.de/faq/?category=openfabrics#ofa-fork 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.
Keyword:
Comments (6)
-
-
reporter - removed comment
This is not about a particular thorn. This is about all source code in Cactus thorns that may be running under MPI. We should review the code, and add a note to the documentation, and maybe even report compiler or run-time warnings when fork() is called.
-
- marked as enhancement
- marked as
- removed comment
A quick grep over the ET doesn't reveal any usage of fork, except in Formaline - but there it is disabled by default.
-
- removed comment
Maybe this could be an entry for #831?
-
- removed comment
I believe fork() is ok. exec() can be a problem and so is doing anything with MPI in the forked() process (including and in particular calling MPI_Finalize).
-
- edited description
- changed status to resolved
There is no more (active) code in the ET that uses fork(). The only places where
fork()
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. - Log in to comment
Which thorn is this ticket about?