[Openmcl-devel] counting cpu cycles?

Jeff Caldwell jeffrey.d.caldwell at gmail.com
Sat Dec 21 05:24:01 PST 2013


I think the keyword you are looking for is "affinity". The call will be
different on different OSs. Here is an example stackoverflow thread.

http://stackoverflow.com/questions/1407786/how-to-set-cpu-affinity-of-a-particular-pthread

Jeff


On Saturday, December 21, 2013, Florian Dietz wrote:

>  The function ccl::rdtsc can be used for counting cpu cycles, but it
> returns results depending on the current cpu the program is running on,
> which can be a problem for multithreaded applications.
>
> Is there a way to get consistent values from the same cpu, so that one can
> measure how many cpu cycles a given function took to execute?
>
> Alternatively, if this is not possible, would it be possible (and
> sensible) to restrict a process to only a single cpu, to avoid this problem?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20131221/cbcbe03e/attachment.htm>


More information about the Openmcl-devel mailing list