Next: , Previous: ppwcc, Up: Command Reference


B.7 ppwshmemcc

ppwshmemcc is a simple wrapper that takes care of invoking your underlying C compiler with all options and flags needed by the PPW performance tool. ppwshmemcc is meant to be used in place of your regular C compiler (such as cc) such that you can instrument your program for use with PPW with as little effort as possible.

To match the behavior of cc, ppwshmemcc does not automatically append the SHMEM library when linking your application. If your regular compiler requires you to specify -lshmem at the end of your link command, you will also need to specify -lshmem to ppwshmemcc when you link your application.

ppwshmemcc’ will pass any options it does not understand to your underlying C compiler.

B.7.1 Invoking ppwshmemcc

To invoke ppwshmemcc, use the following syntax:

     
     ppwshmemcc [--inst|--inst-functions|--noinst]
           [-v|-V|--version|--ppw-verbose|--ppw-showcommand]
           file.c...
     

B.7.2 ppwshmemcc Command Options

ppwshmemcc gives special meaning to the following options:

--inst
Instrument any source files given to the compiler for recording performance data. This option is on by default unless the --noinst option is given.
--inst-functions
Track all function entry and exits. This allows PPW to record information about how much time was spent in each function, which allows you to localize performance bottlenecks to individual functions. If you make a large number of function calls in a short period of time in your application, be sure to read the PPW manual section `Managing Measurement Overhead'.

Note that this flag will not work with all C compilers. If PPW cannot record per-function performance data with your chosen C compiler and this flag is passed in, ppwshmemcc will print a warning message.

--noinst
Do not instrument the source files to record performance data. Conflicts with any of the --inst options.
-V
--version
Print version information to stdout before before invoking the underlying C compiler.
--ppw-verbose
Print all commands to stdout prefixed by a `+' before invoking them. This option is not passed along to the backend C compiler. Not useful for most users.
--ppw-showcommand
Print all commands out as in --ppw-verbose, except do not run them. Useful for debugging the PPW wrapper script or for poking into the internals of PPW. This option is not passed along to the backend C compiler. Not useful for most users.
-v
Same as --version --ppw-verbose.

B.7.3 ppwshmemcc Notes

If you decide to compile parts of your application using a regular compiler such as gcc, you may experience warnings like this:

     $ gcc -c file.c
     $ ppwcc -o myapp file.o file2.c
     PPW warning: Can't find file.o.ppw.compopts
     PPW warning: missing some compilation info
     PPW warning: Can't find file.o.ppw.src
     PPW warning: missing some source info

In short, you may ignore this warning but read the rest of this section for caveats.

PPW keeps metadata about each file that you compile, including compilation arguments and a snapshot of the source code that was compiled. This metadata is stored in files with extensions matching .ppw.*, such as .ppw.compopts and .ppw.src.

During the linking phase, PPW's wrapper scripts assemble all compilation metadata information (along with other data) into a single .ppw.sar file. If you pass in a .o object file that does not have appropriate .ppw.* files, you will get warnings similar to those mentioned above. You may safely ignore such warnings, although when you view performance data for your application later this metadata will not be available.

If you have a complicated build process that moves object files around from the location in which they were originally compiled, remember to keep the .ppw.* files in the same directory if you wish to preserve this metadata.

Please be sure to use either ppwupcc, ppwshmemcc, or ppwcc when linking your application, as these scripts will pass in the necessary arguments to link your application against all libraries that PPW requires.