I have seen that in linux it is possible to enable/diable cpu cores:
https://unix.stackexchange.com/questions/145645/diabling-cpu-cores-on-quad-core-processor-on-linux
And also to change the cpu clock frequency:
https://unix.stackexchange.com/questions/97715/ubuntu-how-do-i-change-clock-speed-from-terminal
I would like to study the energy consumption of an algorithm as a function of some internal parameters and also the clock frequency and cpu/gpu usage, but I have obsolutely no idea about how to measure the energy consumption of a task.
I have seen some software that plots graphically the consumption but how can a program obtain the information about his own energy consumption or the energy consumption of the whole computer in run time?