Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] SIGPIPE handling?
From: Jesse Ziser (ziser_at_[hidden])
Date: 2010-11-30 17:51:26


It turned out I was using development version 1.5.0. After going back
to the release version, I found that there was another problem on my
end, which had nothing to do with OpenMPI. So thanks for the help; all
is well. (And sorry for the belated reply.)

Ralph Castain wrote:
> After digging around a little, I found that you must be using the OMPI devel trunk as no release version contains this code. I also looked to see why it was done, and found that the concern was with an inadvertent sigpipe that can occur internal to OMPI due to a race condition.
>
> So I modified the trunk a little. We will ignore the first few sigpipe errors we get, but will then abort with an appropriate error.
>
> HTH
> Ralph
>
> On Nov 24, 2010, at 5:08 PM, Jesse Ziser wrote:
>
>> Hello,
>>
>> I've noticed that OpenMPI does not seem to detect when something downstream of it fails. Specifically, I think it does not handle SIGPIPE or pass it down to its young, but it still prints an error message every time it occurs.
>>
>> For example, running a command like this:
>>
>> mpirun -np 1 ./mpi-cat </dev/zero | dd bs=1 count=1 >/dev/null
>>
>> (where mpi-cat is just a simple program that initializes MPI and then copies its input to its output) hangs after the dd quits, and produces an eternity of repetitions of this error message:
>>
>> [[35845,0],0] reports a SIGPIPE error on fd 13
>>
>> I am unsure whether this is the intended behavior, but it certainly seems unfortunate from my persepective. Is there any way to make it exit nicely, preferably with a single error, whenever what it's trying to write to doesn't exist anymore? I think I could even submit a patch to make it quit on SIGPIPE, if it is agreed that that makes sense.
>>
>> Here's the source for my mpi-cat example:
>>
>> #include <stdio.h>
>>
>> #include <mpi.h>
>>
>> int main (int iArgC, char *apArgV [])
>> {
>> int iRank;
>>
>> MPI_Init (&iArgC, &apArgV);
>>
>> MPI_Comm_rank (MPI_COMM_WORLD, &iRank);
>>
>> if (iRank == 0)
>> {
>> while(1)
>> if(putchar(getchar()) < 0)
>> break;
>> }
>>
>> MPI_Finalize ();
>>
>> return (0);
>> }
>>
>>
>> Thank you,
>>
>> Jesse Ziser
>> Applied Research Laboratories:
>> The University of Texas at Austin
>> _______________________________________________
>> users mailing list
>> users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users