| ... | ... | @@ -6,6 +6,7 @@ title: Profilage de Code |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Code profilers
|
|
|
|
|
|
|
|
In this Wiki, we will provide a methodology to install and run some code profilers. This has been tested on a specific
|
| ... | ... | @@ -116,26 +117,41 @@ export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau"' |
|
|
|
In the above, the `-optKeepFiles` allows to keep intermediate files. The `-optTauSelectFile` specifies the file where additional profiling options are provided. These options are provided in a `select.tau` file, which may be as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
BEGIN_INSTRUMENT_SECTION
|
|
|
|
loops routine="#"
|
|
|
|
END_INSTRUMENT_SECTION
|
|
|
|
|
|
|
|
#Tell tau to not profile these functions
|
|
|
|
BEGIN_EXCLUDE_LIST
|
|
|
|
void Sequencer::thread#
|
|
|
|
void Controller::thread#
|
|
|
|
int NAMD_read_int#
|
|
|
|
void PDBDATA::scan#
|
|
|
|
Real PDBAtom::zcoor#
|
|
|
|
Real PDBAtom::ycoor#
|
|
|
|
Real PDBAtom::xcoor#
|
|
|
|
Bool Molocule::is_hydrogen#
|
|
|
|
|
|
|
|
void quicksort(int *, int, int)
|
|
|
|
# The next line excludes all functions beginning with "sort_" and having
|
|
|
|
# arguments "int *"
|
|
|
|
void sort_#(int *)
|
|
|
|
void interchange(int *, int *)
|
|
|
|
|
|
|
|
END_EXCLUDE_LIST
|
|
|
|
|
|
|
|
#Exclude these files from profiling
|
|
|
|
BEGIN_FILE_EXCLUDE_LIST
|
|
|
|
*mainfunc.C
|
|
|
|
*memusage.C
|
|
|
|
*BackEnd.C
|
|
|
|
|
|
|
|
*.so
|
|
|
|
|
|
|
|
END_FILE_EXCLUDE_LIST
|
|
|
|
|
|
|
|
BEGIN_INSTRUMENT_SECTION
|
|
|
|
|
|
|
|
# A dynamic phase will break up the profile into phase where
|
|
|
|
# each events is recorded according to what phase of the application
|
|
|
|
# in which it occured.
|
|
|
|
dynamic phase name="foo1_bar" file="foo.c" line=26 to line=27
|
|
|
|
|
|
|
|
# instrument all the outer loops in all the routines
|
|
|
|
loops file="#" routine="#"
|
|
|
|
|
|
|
|
# tracks memory allocations/deallocations as well as potential leaks
|
|
|
|
memory file="foo.f90" routine="INIT"
|
|
|
|
|
|
|
|
# tracks the size of read, write and print statements in this routine
|
|
|
|
io file="foo.f90" routine="RINB"
|
|
|
|
|
|
|
|
END_INSTRUMENT_SECTION
|
|
|
|
```
|
|
|
|
|
|
|
|
Here, we specify that loops will be instrumented in all the functions of the program.
|
| ... | ... | |
| ... | ... | |