Calculate CPU Utilization

General OpenMP discussion

Calculate CPU Utilization

Postby neeludhiman » Wed Mar 12, 2008 2:47 am

Dear All,

Could someone please suggest me how can I calculate the percentage of each CPU being utilised in case of OpenMP in multiprocessor environment, where multiple threads are running on multiple propcessors?e.g; ProcessorA: 30%, ProcessorB: 80%, ProcessorC: 50%. I want to calculate it from Fortran code. Please help.

Thanks,
Neelu
neeludhiman
 

Re: Calculate CPU Utilization

Postby ejd » Wed Mar 12, 2008 6:32 am

OpenMP was not designed to give this type of information. If you look at the original design, work is given to threads. However, there is no mapping between threads and processors. That was left to be handled by the operating system. We have since found that because of data locality, cache reuse, etc., there are times when it is very profitable to map threads to processors in certain ways. In fact, at this point, almost all of the vendors have some way to specify this mapping (binding threads to processors). However, I don't believe any implementation allows you to get the binding information or the thread mapping if the binding is off. Therefore, there is no way for the user to find out which processor is being used.

There is also the problem of the observation affecting what is being observed. Since OpenMP is added on to a base language, anything done by the user to find out about how much time is being taken or what processor is being used will have an affect on the running program.

So I guess my question to you is why do you care?

If you are interested in profiling your program, there are tools that different vendors already provide to look at this that have low relative overheads by looking at the running process from outside the process. There is a whitepaper that describes an interface that can be used to do this (if a vendor decided to do implement the whitepaper).
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: Calculate CPU Utilization

Postby NeeluDhiman » Thu Mar 13, 2008 3:34 am

Hi,

Thanks a lot for your suggestions. But isn't there any way to get Task Manager information using some API, such that we can call this API from within the parallel section to get CPU Usage information?

Thanks,
Neelu
NeeluDhiman
 

Re: Calculate CPU Utilization

Postby ejd » Wed Aug 13, 2008 11:40 pm

I believe there is - but I am not a windoze person so I can not answer your question. Perhaps someone else reading this posting can answer your question. However, since this is really an OpenMP forum, you might have better luck trying your post on a forum for Windows.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests