-
November 10th, 2009, 01:07 PM
#1
how to measure power consumed by algorithms
i've to make a program in c/c++ through which we can find out the power consumed by any algorithm(basically a c/c++ program).... here we are assuming we know the specific processor we are working on....can u please tell me the functions or commands that can be used to do so and the logic behind it.... if there's any paper or website where info of this sort is available please let me kno...if theres no way to measure power consumption for any generic processor then we can take intel pentium 4 as the processor on which we have to measure the power consumed..
-
November 10th, 2009, 06:27 PM
#2
Re: how to measure power consumed by algorithms
I'm not certain how possible it is to predict the CPU time without actually running it on the processor. If running it, then asking windows how long it took is sufficient then there's a functiona available then look into the windows api function:
GetThreadTimes
If you need to be able to predict it and you have a lot of development time available then you could possibly look up the processor timings in the intel manuals for each processor instruction. If you are considdering this then then be sure that you're not going to be stopped by the Halting problem before you start development.
Hope this is of some help
Signature
Please use: [ code ][/ code ] tags and reasonably correct tabbing. They really help us read your code
End Signature
-
November 11th, 2009, 12:25 PM
#3
Re: how to measure power consumed by algorithms
thanks for replying..... I will actually run the program on the processor to determine the power consumption..... Assuming if I know the number of cpu clock ticks that were taken to execute the program... How will we proceed further to determine the power consumed...
-
November 11th, 2009, 02:06 PM
#4
Re: how to measure power consumed by algorithms
 Originally Posted by shivamskn
thanks for replying..... I will actually run the program on the processor to determine the power consumption..... Assuming if I know the number of cpu clock ticks that were taken to execute the program... How will we proceed further to determine the power consumed...
I don't believe algorithms consume power. The cpu is running whether you're giving it anything to do. Moving disc heads around would consume more electricity than when the disc is idle, but to the best of my knowledge, cpu power consumption would be constant.
Why is that a concern anyway?
-
November 11th, 2009, 04:55 PM
#5
Re: how to measure power consumed by algorithms
my college project requires me to do so..... I've to basically run an algorithm on a computer using c/c++ and then the same algorithm is to be executed using an fpga and then I've have to compare the amount of power consumption using the 2 methods and determine which was better... As per me there will be some power consumption dependent on the amount of resources of the processor utilised
-
November 11th, 2009, 05:10 PM
#6
Re: how to measure power consumed by algorithms
Thats going to be dificult.
My best guess would be to see if you can determine the power usage of the PC per second then just multiply the CPU time of the process by the power usage of your computer.
Beyond that its very hard to define because even when your process isnt running then your OS will be sitting there in a loop saying
have I got anything else to do yet? ... no...
have I got anything else to do yet? ... no...
and unless this part of the OS knows how to throttle down your CPU then it will take about as much power as your algorithm.
Signature
Please use: [ code ][/ code ] tags and reasonably correct tabbing. They really help us read your code
End Signature
-
November 11th, 2009, 05:35 PM
#7
Re: how to measure power consumed by algorithms
Most OSes are interrupt-driven these days; but yeah, there's always going to be *some* power consumption even when the processor isn't doing anything.
Typically power problems are addressed by finding a processor which uses little enough power, and then figuring out how to write code that will work with its limitations.
-
November 11th, 2009, 06:10 PM
#8
Re: how to measure power consumed by algorithms
 Originally Posted by shivamskn
my college project requires me to do so..... I've to basically run an algorithm on a computer using c/c++ and then the same algorithm is to be executed using an fpga and then I've have to compare the amount of power consumption using the 2 methods and determine which was better... As per me there will be some power consumption dependent on the amount of resources of the processor utilised
Are you sure that it's not asking about big(O) notation?
-
November 11th, 2009, 06:13 PM
#9
Re: how to measure power consumed by algorithms
No, given that he mentioned an FPGA, I don't think that's a misinterpretation. It probably is an actual power issue.
-
November 11th, 2009, 06:14 PM
#10
Re: how to measure power consumed by algorithms
Yeah, I too was wondering whether the word "power" was being misused in the title. Are we really talking about measuring electrical power as in "watts" or is this about CPU utilization?
-
November 13th, 2009, 03:46 PM
#11
Re: how to measure power consumed by algorithms
nah we are actually talking abt power consumed.... the project has got something to do with adaptive systems.... does any1 of u kno wat is the per cycle power consumption of a p4 processor without ht technology....
-
November 13th, 2009, 05:46 PM
#12
Re: how to measure power consumed by algorithms
 Originally Posted by shivamskn
nah we are actually talking abt power consumed.... the project has got something to do with adaptive systems.... does any1 of u kno wat is the per cycle power consumption of a p4 processor without ht technology....
You can find long lists of power consumption on the Intel website, but AFAIK those are fairly theoretical values - typically idle and maximum power consumption. I don't think you'll get any sensible values about power consumption without actually measuring power consumption.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|