[mpich-discuss] How to keep the VS console window open on exceptions during debug of a parallel code

Feng Xiao fxiao at mymail.mines.edu
Thu Jun 13 09:28:37 CDT 2013


Thinking most of people here don't use visual studio very often (me
either), I tried several ways and found a solution. It might be useful for
someone, so I am writing to you all again to close my own question.
I added the following line to the Command Line of Post-Build Event of Build
Events on the property pages,
"D:\Program Files\MPICH2\bin\mpiexec.exe" -n 2
"$(TargetDir)\$(TargetName).exe" --result_code=no --report_level=no
The code executes after the build and all messages are written in the VS
output window.



On Thu, Jun 13, 2013 at 7:38 AM, Feng Xiao <fxiao at mymail.mines.edu> wrote:

> Hello all,
>
> I am writing about how to keep the console window open on exceptions
> during debug of a parallel code (either F5 or Ctrl+F5).
> I am running MPICH2 FORTRAN program in Visual Studio 2010, everything
> works fine, expect that I could not see the exception/error messages on the
> console window, it closes right after the program exits on exceptions.
> I do know how to keep the console window open when program meets the end,
> or put a read statement to pause the program during the execution.
> I did some google search, the only relevant solution I could find is
>
> http://www.boost.org/doc/libs/1_36_0/libs/test/doc/html/utf/usage-recommendations/dot-net-specific.html,
> which is about making debugger break at the point the failure by adding
> extra command line argument and seeing the runtime error in the output
> window. However, it looks like something for a serial code without
> mpiexec.exe in the command line, and I am not a advanced VS user, so I
> don't know how to do it for a parallel code, or if there is any other way
> out.
>
> Thanks in advance!
>
> --
> Feng Xiao
>
> Doctoral Student
> Petroleum Engineering
> Colorado School of Mines
>
> Cell 918-814-2644
>
>


-- 
Feng Xiao

Doctoral Student
Petroleum Engineering
Colorado School of Mines

Cell 918-814-2644
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130613/e9ac98eb/attachment.html>


More information about the discuss mailing list