If you want to change clock speeds, you need to use overclocking tools in Windows like EVGA’s Precision X, where there is an API that supports that natively. Under Unix/Linux, there is no equivalent that I am aware of, and you will have to resort to BIOS modification of clock speeds.
You’re in luck because there is a huge thread on the Overclock.net forums that deals specifically with various different BIOS’ that others have modified for the GTX Titan. In fact, when I had a Titan, I was able to overclock to somewhere around 1050-1100MHz with a modified BIOS (DP units enabled). There are even some BIOS’ that completely do away with the GPU Boost functionality, so that clocks are more stable instead up boosting whenever the driver/card feels like doing it.
If you want to monitor under Linux via nvidia-smi, you’ll want to take a look at this:
For Windows, you can use GPU-z, which can poll/store dynamic clock speeds at a decent enough resolution (at least 1 second)
Even for Tesla K20, where this feature is supported, the application clocks available in the stock BIOS are very limited (I believe only 3 choices) Not sure about K40, but I imagine it is a similar issue there.