Tau_THROTTLE is designed to reduce the computational overhead associated with instrumenting a program with TAU. This usually takes the form of selectively instrumented some functions but not others. This can be done manually, but TAU_THROTTLE with do this automatically by helping you develop a criterion to decide which function to instrument.
Looking at the #call column we see that the function computeRandom() is called about 20,000,000 times. It is functions like these that contribute greatly to the overhead associated with instrumenting a program. You see, when a function is entered and exited a small amount of tauinstrument code is executed. When a function is called millions of times even that small amount of code can cause a slow down in execute time.
Let us tell tau not to instrument functions like computeRandom(), this will remove the computational overhead of instrumenting a function that is called 20 millions times. To do this, set these environment variables:
%> export TAU_THROTTLE=1 %> export TAU_THROTTLE_NUMCALLS=400000 %> export TAU_THROTTLE_PERCALL=3000
This will tell tau not to profile any functions which are called more than 400000 times and their inclusive time per call is less than 3 seconds.
Let us now see how much time it takes to run computePi,
%> time mpirun -np 5 ./computePi Pi is 3.14226 real 0m2.123s user 0m1.760s sys 0m0.270s
On my machine computePi runs at about 10% overhead much better than the overhead before using TAU_THROTTLE. Not only does TAU_THROTTLE help reduce the overall runtime overhead of instrumenting a program, it also, as we will see in the next section, increases the accuracy of the resulting profile data.