[mpich2-dev] using gprof to profile MPICH2 codes

Dave Goodell goodell at mcs.anl.gov
Sat Apr 11 15:57:46 CDT 2009


Anjin,

In general, the compiler options that you should specify when  
profiling are "-O2 -pg", not "O2 - pg".  In the latter case you are  
passing three separate arguments of "O2", "-", and "pg", each of which  
is considered a potential source file by the compiler.  You cannot  
casually add or remove spaces and dashes.

You will probably also need to specify the GMON_OUT_PREFIX environment  
variable at run time when profiling an MPI application so that each  
process writes its profiling information to a separate file ($ 
{GMON_OUT_PREFIX}.$pid).

Hope that helps,
-Dave

On Apr 11, 2009, at 12:14 PM, Anjin.Pradhan at ait.ac.th wrote:

>
> I have to profile mpich code, so that i can understand the code.
>
> I tried doing     anjin at anjin:~/mpich2-1.0.8p1$ make "CFLAGS = 02 -  
> pg"
>
> but when you do this i get this error
>   make[4]: Entering directory
>   `/home/anjin/Desktop/mpich2-1.0.8p1/src/pm/mpd'
>   /usr/bin/install -c -m 644 ./mpdroot.c mpich2-mpdroot.c
>   gcc -I. -I. 02 - pg  -c mpich2-mpdroot.c
>   gcc: 02: No such file or directory
>   gcc: pg: No such file or directory
>
> So i wanted how i can use gprof or any other code profiler to  
> profile MPICH. I am stuck in this and any help would be greatly  
> appreciated.
>
> Anjin
>
> - Ignored:
>
>
> - Done.
>
>
>
> ----- End forwarded message -----
>
>
> From: Anjin Pradhan <Anjin.Pradhan at ait.ac.th>
> Date: April 11, 2009 Apr 11 12:53:35 AM CDT
> To: mpich2-dev-request at mcs.anl.gov
> Subject: using gprof to profiling mpich code
>
>
> Hi Everyone,
>
> I have to profile mpich code, so that i can understand the code.
>
> I tried doing
>
> anjin at anjin:~/mpich2-1.0.8p1$ make "CFLAGS = 02 - pg"
>
> but when you do this i get this error
>
> make[4]: Entering directory
> `/home/anjin/Desktop/mpich2-1.0.8p1/src/pm/mpd'
> /usr/bin/install -c -m 644 ./mpdroot.c mpich2-mpdroot.c
> gcc -I. -I. 02 - pg  -c mpich2-mpdroot.c
> gcc: 02: No such file or directory
> gcc: pg: No such file or directory
>
>
> So i wanted how i can use gprof or any other code profiler to profile
> MPICH.
>
> I am stuck in this and any help would be greatly appreciated.
>
>
> Anjin
>
>
>
>



More information about the mpich2-dev mailing list