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..
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
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...
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.
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
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
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.
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?
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?
Bookmarks