.\" ** You probably do not want to edit this file directly ** .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. .TH "TAU_PROFILE_TIMER_DY" "3" "08/31/2005" "" "TAU Instrumentation API" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" TAU_PROFILE_TIMER_DYNAMIC \- Defines a dynamic timer. .SH "SYNOPSIS" .PP \fBC/C++:\fR .HP 26 \fB\fBTAU_PROFILE_TIMER_DYNAMIC\fR\fR\fB(\fR\fBProfiler\ \fR\fB\fItimer\fR\fR\fB, \fR\fBchar*\ or\ string&\ \fR\fB\fIfunction_name\fR\fR\fB, \fR\fBchar*\ or\ string&\ \fR\fB\fItype\fR\fR\fB, \fR\fBTauGroup_t\ \fR\fB\fIgroup\fR\fR\fB);\fR .PP \fBFortran:\fR .HP 26 \fB\fBTAU_PROFILE_TIMER_DYNAMIC\fR\fR\fB(\fR\fBinteger\ \fR\fB\fIprofiler\fR\fR\fB(2)\fR\fB, \fR\fBcharacter\ \fR\fB\fIname\fR\fR\fB(size)\fR\fB);\fR .SH "DESCRIPTION" .PP TAU_PROFILE_TIMER_DYNAMIC operates similar to TAU_PROFILE_TIMER except that the timer is created each time the statement is invoked. This way, the name of the timer can be different for each execution. .SH "EXAMPLE" .PP \fBC/C++ :\fR .sp .nf int main(int argc, char **argv) { int i; TAU_PROFILE_TIMER(t,"main()", "", TAU_DEFAULT); TAU_PROFILE_SET_NODE(0); TAU_PROFILE_START(t); for (i=0; i&5; i++) { char buf[32]; sprintf(buf, "Iteration %d", i); TAU_PROFILE_TIMER_DYNAMIC(timer, buf, "", TAU_USER); TAU_PROFILE_START(timer); printf("Iteration %d\\n", i); f1(); TAU_PROFILE_STOP(timer); } return 0; } .fi .PP \fBFortran :\fR .sp .nf subroutine ITERATION(val) integer val character(13) cvar integer profiler(2) / 0, 0 / save profiler print *, "Iteration ", val write (cvar,'(a9,i2)') 'Iteration', val call TAU_PROFILE_TIMER_DYNAMIC(profiler, cvar) call TAU_PROFILE_START(profiler) call F1() call TAU_PROFILE_STOP(profiler) return end .fi .SH "SEE ALSO" .PP TAU_PROFILE_TIMER(3), TAU_PROFILE_START(3), TAU_PROFILE_STOP(3)