[mpich-discuss] mpd_uncaught_except_tb and stdin problem

Rajeev Thakur thakur at mcs.anl.gov
Wed Dec 23 08:49:37 CST 2009


To run MPI programs in the background when using the MPD process manager, you need to redirect stdin from /dev/null. For example: 

mpiexec -n 4 a.out < /dev/null &

instead of just mpiexec -n 4 a.out &

Rajeev


> -----Original Message-----
> From: mpich-discuss-bounces at mcs.anl.gov 
> [mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Thomas Ruedas
> Sent: Tuesday, December 22, 2009 10:49 PM
> To: MPICH Discussion List
> Subject: [mpich-discuss] mpd_uncaught_except_tb and stdin problem
> 
> Hi,
> I am running a parallel code using MPICH2-1.2 on different 
> sorts of machines and keep seeing a strange error message or 
> warning related to STDIN handling when starting a run. For 
> instance, when running it on an 8-CPU Mac Pro (with Intel 
> Fortran 11.1) in the foreground (i.e., taking the prompt and 
> writing to stdout), it runs just fine. When I start the very 
> same job as a background job e.g. with mpiexec -machinefile 
> machines -n 4 stagyympi >& scr.out & it starts up ok, does 
> the initial stuff apparently correctly, and then crashes with 
> this error (hostname changed for security reasons):
> mpiexec_my.machine.my.domain: mpd_uncaught_except_tb handling:
>    <type 'exceptions.IOError'>: [Errno 9] Bad file descriptor
>      /Users/ruedas/local/bin/mpiexec  1087  handle_stdin_input
>          sys.stdin.flush()  # probably does nothing
>      /Users/ruedas/local/bin/mpdlib.py  780  handle_active_streams
>          handler(stream,*args)
>      /Users/ruedas/local/bin/mpiexec  530  mpiexec
>          rv = streamHandler.handle_active_streams(timeout=1.0)
>      /Users/ruedas/local/bin/mpiexec  1446  <module>
>          mpiexec()
> 
> I also run the code on a Linux cluster (with Intel Fortran 
> 9.1 and the same MPICH2 version), where I always start it as 
> a background job as shown above. There it runs ok, although I 
> do get this warning:
> 
> mpiexec_my.cluster.my.domain (handle_stdin_input 1089): stdin 
> problem; if pgm is run in background, redirect from /dev/null
> mpiexec_my.cluster.my.domain (handle_stdin_input 1090):     e.g.: 
> mpiexec -n 4 a.out < /dev/null &
> 
> repeatedly. It doesn't seem to do anything bad, it's just 
> there, and I don't know why.
> I should point out that the program reads input only from a 
> file, but not from the prompt or interactively from stdin.
> Can someone please explain to me what this stdin stuff is 
> about and why these messages appear and tell me what to do to 
> run the program in the background on the Mac? I had the 
> impression that the installation went ok on both machines.
> Thanks,
> Thomas
> --
> -----------------------------------
> Thomas Ruedas
> Department of Terrestrial Magnetism
> Carnegie Institution of Washington
> http://www.dtm.ciw.edu/users/ruedas/
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> 



More information about the mpich-discuss mailing list