Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You will need to fill out the Resources tab to describe the job you want to run.  Select a queue (debug), Number of Nodes (1:ppn=4,

CUDA code with eclipse

Import the code below into a new c++ project (rt click in the open area under c/c++ perspective's  Project Explorer pane.  Name your project and select the Makefile and Empty Project for it's type, then when the project appears in the pane right click on your project and : Import->General->Filesystem) and bring in the vecadd/ code from your $HOME.  Then follow the steps in the 2nd bullet link (or attached PDF) below.

  • cp -R ~arnoldg/vecadd/ $HOME ; ls $HOME/vecadd/
  • cdt and cuda makefile projects
  • build the project with eclipse ( Project -> Build , or use the hammer icon )

TAU profiling with eclipse

CUDA profiling with TAU is not yet in eclipse, use the command line...

This URL describes using TAU with cuda code:

http://www.ncsa.illinois.edu/UserInfo/Resources/Software/Tools/TAU/#gpusupport




$ cd $HOME/vecadd
$ tau_exec -T serial -XrunTAU-cupti-icpc -cuda ./vectorAdd
$ # press return to exit the vectorAdd program
$ paraprof &
$ less /usr/apps/tools/tau/README.gpu # experiment with TAU_METRICS set in your environment

Note for the bored: the dev/ directory contains trial1.cvp created by computeprof--the Nvidia-CUDA profiler that ships with CUDA.  You can visualize it with the computeprof command on forge.

Paraprof setup on forge

  • start paraprof  from the ssh command line (not in Eclipse )
    • File -> Database Configuration -> accept defaults , confirm new perfdmf database/schema and "Save Configuration"
  • Exit paraprof (important because there can not be 2 paraprof processes trying to access your database at the same time...Eclipse will be starting one in the steps that follow)

TAU with mpi compute pi example

A requirement for using TAU with eclipse locally is to setup the following directory and symbolic link to work around an Eclipse bug with TAU:
$ cd $HOME
$ mkdir -p ./uf/ncsa
$ ln -s $HOME ./uf/ncsa/$USER # workaround to handle Eclipse/TAU trying to submit jobs with $HOME/$HOME in pathname

Create a new project in eclipse by right clicking in the Project Explorer pane of the c/c++ perspective and choosing the MPI PI C example project with the gcc toolchain.  This should create a new project with source files in the src/ directory.

The project will probably need the mpi.h include directory defined and added to all languages/configurations.  Build the application when you're done with this step.  A Debug/ directory should appear in your project which we'll need later when filling out the Profile Configurations -> Application tab:

To profile with TAU, there are a couple steps to follow in the c/c++ perspective.   First fill out the TAU settings under the TAU tab for the Profile Configurations.  For the first TAU trial use the default settings.


Set the Performance Analysis tab to build-only without launch, then Apply and Profile the application which will build a new TAU instrumented version of the code.


While building, watch the console in eclipse for the TAU compile and link commands.  These can be useful later if you run TAU outside of Eclipse (or in your larger Makefile to define the compiler and linker commands ):
**** Build of configuration Debug__tau-icpc-mpi for project mpipic ****

make all
Building file: ../src/mpipic.c
Invoking: GCC C Compiler
/usr/apps/tools/tau/2.20.3-forge/x86_64/bin/tau_cc.sh  -tau_options='-optCompInst ' -tau_makefile=/usr/apps/tools/tau/2.20.3-forge/x86_64/lib/Makefile.tau-icpc-mpi -I/usr/local/mpi/mvapich2/mvapich2-1.7rc1-intel-12.0.4/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/mpipic.d" -MT"src/mpipic.d" -o "src/mpipic.o" "../src/mpipic.c"

Finished building: ../src/mpipic.c
 
Building target: mpipic
Invoking: GCC C Linker
/usr/apps/tools/tau/2.20.3-forge/x86_64/bin/tau_cc.sh  -tau_options='-optCompInst ' -tau_makefile=/usr/apps/tools/tau/2.20.3-forge/x86_64/lib/Makefile.tau-icpc-mpi  -o "mpipic"  ./src/mpipic.o   

Finished building target: mpipic
 

        • Build Finished ****

Building will create a new directory named similar to the TAU makefile from the TAU tab options.  Once the instrumented application is built, then fill out the Profile Configuration tabs for the Application and Arguments to point to that executable and directory:

The Arguments tab should be adjusted to point to that directory (deselect the default directory box and browse the path ).


Then in the Performance Analysis tab, allow TAU to profile for this run by deselecting the build-only box:

You will need to fill out the Resources tab to describe the job you want to run.  Select a queue (debug), Number of Nodes (1:ppn=4*,*flags=ADVRES:eclipse ) , Mpirun command (mpirun_rsh), Number of cores (should be nodes*ppn or 4), and wall time (ten minutes = 00:10:00  ).
Finally, once the program runs, use TAU.  Allow TAU to run in the background if the dialog box persists while the job is submitted.

Homework questions.

How could you use Eclipse with TAU and a Makefile project ?

Can you manipulate jobs (cancel ) in the Systems Monitoring perspective ?

Does the Systems Monitoring perspective support more than one running resource manager ?

) , Mpirun command (mpirun_rsh), Number of cores (should be nodes*ppn or 4), and wall time (ten minutes = 00:10:00  ).
Finally, once the program runs, use TAU.  Allow TAU to run in the background if the dialog box persists while the job is submitted.

...