Friday, 6 September 2013

How to measure multithreaded process time on a shared environment?

How to measure multithreaded process time on a shared environment?

Since I am running performance evaluation tests of my multithreaded
program on a shared multicore environment, the process can get swapped out
periodically. I want to compute the latency, i.e., only the duration when
the process was active. This will allow me to extrapolate how the
performance would be on a non-shared environment, i.e., where only one
program is running (most of the time), or on different workloads.
Usually two kinds of time are measured:
The wall-clock time (i.e., the time since the process started) but this
includes the time when the process was swapped out.
The processor time (i.e., sum total of CPU time used by all threads) but
this is not useful to compute the latency of the process.
I believe what I need is makespan of times of individual threads, which
can be different from the maximum CPU time used by any thread due to the
task dependency structure among the threads. Furthermore, multi-threading
brings indeterminacy on its own; this can be taken care of running the
test multiple times and summarizing the results. Moreover, the latency
also depends on how the OS schedules the threads; things get more
complicated if some threads of a process wait for CPU while others run.
Is there an efficient way to compute/approximate this makespan time? For
providing code examples, please use any programming language, but
preferably C or C++.

No comments:

Post a Comment