Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] Warning on fork() disappears if I use MPI threads!!
From: George Bosilca (bosilca_at_[hidden])
Date: 2010-11-29 12:22:15


If your code doesn't exactly what is described in the code snippet attached to your previous email, then you can safely ignore the warning. In fact, any fork done prior to the communication is a non-issue, but it is difficult to identify. Therefore, we output the warning as soon as we detect a fork after MPI_Init.

You can find more information about the usage of fork in Open MPI at http://www.open-mpi.de/faq/?category=tuning#fork-warning

  george.

On Nov 29, 2010, at 12:12 , <ananda.mudar_at_[hidden]> wrote:

> I am posting this question again as it was sent before the long weekend and didn’t see any responses so far. Can anyone please explain the discrepancy I am observing with the scenario explained in the post below?
>
> Thanks
> Ananda
> Sent: Tuesday, November 23, 2010 2:24 PM
> To: devel_at_[hidden]
> Subject: Warning on fork() disappears if I use MPI threads!!
>
> Hi
>
> I am running into a very wierd problem.
>
> If I initialize MPI normally ie; with MPI_Init(), and make one of the MPI process to do "popen()" call, I get the following warning/error message:
>
> == Message start ===
> An MPI process has executed an operation involving a call to the
> "fork()" system call to create a child process. Open MPI is currently
> operating in a condition that could result in memory corruption or
> other system errors; your MPI job may hang, crash, or produce silent
> data corruption. The use of fork() (or system() or other calls that
> create child processes) is strongly discouraged.
> == Message end ====
>
> However this error message goes away, if I initialize MPI with threads ie; MPI_Init_thread(). Can anyone explain this discrepancy?
>
> I am giving a snippet of the program that causes this problem:
>
> == Code snippet start ======
> if ( rank == 0) {
> output = popen("ls -l", "r");
> while((c=getc(output))!=EOF)
> printf("%c",c);
> pclose(output);
> }
> == Code snippet end ======
>
> If this is a design constraint, how can I overcome this problem.
>
> Thanks
> Ananda
>
> Ananda B Mudar, PMP
> Senior Technical Architect
> Wipro Technologies
> Ph: 972 765 8093
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel