timed kernel runs to avoid timeout errors

Hi all

I have a Monte Carlo code which often runs into timeout error (“launch timed out and was terminated”) when it starts large number of particles. Is there a way to put a timer in the kernel that can stop and restart it before it reaches the timeout? I know there are cutTimer functions and Events but I can’t use them in the kernel itself. Since it is a MC code I can’t really determine how many cycles it will take to finish before the start of the kernel. I would appreciate any idea. thx

clock() can be used from within the kernel, however I seriously doubt adding a timer in the kernel is a good idea. It will either not be realiable or the code will run much slower.

Any of the following are probably what you should do:

  1. You have a bug in your code causing infinite loops.

  2. Break your code to smaller calculation units to avoid the timeout.

  3. Run on linux :) - without X server on linux you won’t have this problem.

eyal