Simple ways for measuring load imbalance

Some notes from discussions with Vlad on how to simply measuring load balance of a program using PROCESS_CPUTIME and CLOCK_MONOTONIC.

We start with a background introduction

 

CLOCK_REALTIME reports the actual wall clock time.

CLOCK_MONOTONIC is for measuring relative real time. It advances at the same rate as the actual flow of time but it’s not subject to discontinuities from manual or automatic (NTP) adjustments to the system clock.

CLOCK_PROCESS_CPUTIME_ID is for measuring the amount of CPU time consumed by the process.

CLOCK_THREAD_CPUTIME_ID is for measuring the amount of CPU time consumed by the thread, but it’s not supported by Linux. glibc emulates it badly by simply returning the amount of CPU time consumed by the process since the moment the thread was created.

http://stackoverflow.com/questions/3523442/difference-between-clock-realtime-and-clock-monotonic

We can make a guess on how much parallel performance you get by dividing the CLOCK_PROCESS_CPUTIME / CLOCK_MONOTONIC time.

Advertisements
This entry was posted in Tools, Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s