<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Unless I'm mistaken, there is no -dbg runtime option. Also, the configure flag you're using is for debugging MPICH itself, not the application, so you can safely ignore it. Debugging parallel applications is always tricky. Short of using a real parallel debugger (Totalview, DDT, etc.), you can use some tricks to get gdb to work. </div><div><br></div><div>1) mpiexec -n 1 gdb <application> : -n <nun procs - 1> <application></div><div><br></div><div>This will start up the application and attach a debugger to process 0. I think this will only work if rank 0 is local, but that's often enough for debugging purposes. </div><div><br></div><div>2) Insert a sleep or while loop in the code of the target process. </div><div><br></div><div>If you cause the process that you want to debug to busy wait, you can give yourself enough time to ssh to it and attach a debugger with something like 'gdb --pid <pid>'.  </div><div><br></div><div>There are probably other tricks that would work, but these are the two most common. Give them a shot and one should work for you. </div><div><br></div><div>Thanks,</div><div>Wesley</div><div><br>On Nov 17, 2013, at 10:55 PM, "<a href="mailto:ylniu@iccas.ac.cn">ylniu@iccas.ac.cn</a>" <<a href="mailto:ylniu@iccas.ac.cn">ylniu@iccas.ac.cn</a>> wrote:<br><br></div><blockquote type="cite"><div>

<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
<style>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体; COLOR: #000000; FONT-SIZE: 10.5pt
}
</style>

<meta name="GENERATOR" content="MSHTML 8.00.6001.23536">

<div>Dear all,</div>
<div> </div>
<div>I want to debug parallel fortran program with idb.</div>
<div> </div>
<div>The configure parameter of MPICH2 or MPICH3 is as follows:</div>
<div> </div>
<div>
<div>./configure --prefix=$HOME/program/mpich/mpich2-1.4.1p1 \</div>
<div>            
--enable-f77 --enable-fc F77=ifort FC=ifort \</div>
<div>            
FFLAGS="-g -traceback -checkall" FCFLAGS="-g -traceback -checkall" \</div>
<div>            
--enable-static --enable-g=dbg \</div>
<div>            
--enable-traceback --enable-f90modules</div>
<div> </div>
<div>or</div>
<div> </div>
<div>
<div>./configure --prefix=$HOME/program/mpich/mpich2-1.4.1p1 \</div>
<div>            
--enable-f77 --enable-fc F77=ifort FC=ifort \</div>
<div>            
FFLAGS="-g -traceback -checkall" FCFLAGS="-g -traceback -checkall" \</div>
<div>            
--enable-static --enable-g=all \</div>
<div>            
--enable-traceback --enable-f90modules</div></div>
<div> </div></div>
<div> </div>
<div>mpirun -machinefile $PBS_NODEFILE -np $NPROCS -gdb=idb 
-parallel myprogram -npool 1</div>
<div> </div>
<div>There comes the error message:</div>
<div>=======================================================================================</div>
<div>match_arg (./utils/args/args.c:160): unrecognized argument dbg </div>
<div>HYDU_parse_array (./utils/args/args.c:175): argument matching returned 
error </div>
<div>parse_args (./ui/mpich/utils.c:1609): error parsing input array </div>
<div>HYD_uii_mpx_get_parameters (./ui/mpich/utils.c:1660): unable to parse user 
arguments </div>
<div>main (./ui/mpich/mpiexec.c:153): error parsing parameters </div>
<div>=======================================================================================</div>
<div> </div>
<div>How can mpirun recognition the argument "dbg"?</div>
<div> </div>
<div>Best regards!</div>
<div> </div>
<hr style="WIDTH: 210px; HEIGHT: 1px" align="left" color="#b5c4df" size="1">

<div><span>
<div style="FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<div><a href="mailto:ylniu@iccas.ac.cn">ylniu@iccas.ac.cn</a></div></div></span></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a></span><br><span>To manage subscription options or unsubscribe:</span><br><span><a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a></span></div></blockquote></body></html>