Giter Club home page Giter Club logo

Comments (6)

adelnoureddine avatar adelnoureddine commented on May 30, 2024 1

As this is an edge case, I'll mark it as complete but will add it to my todo list to avoid sending negative numbers when they occur.

from powerjoular.

adelnoureddine avatar adelnoureddine commented on May 30, 2024

Hi @y-ykcir, on Raspberry Pi, we use the power models we generated in our scientific experiments.
The models are specific to each board revision, as we observed a slight variation in accuracy when using a power model generated on a revision in another revision.
However, the variation is quite small, and you can use the model generated for revision 1.2 for your board revision 1.5.
In PowerJoular, we decided to keep the models for each revision as new revisions can have different impact, and unless we test them it's difficult to predict their impact (even though, as said, the impact should me minimal).

For your board, you can add the same models for RPi 4 rev 1.2 to a new revision 1.5 in the source code, or let PowerJoular treat your revision as 1.2.
To do so, you can modify os_utils.adb and add the following code in the function Get_Platform_Name_Raspberry:

Index_Search := Index (To_String (Line_String), "Raspberry Pi 4 Model B Rev 1.5");
if (Index_Search > 0) then
    if (Architecture_Name = "aarch64") then
        return "rbp4b1.2-64";
    else
        return "rbp4b1.2";
    end if;
end if;

from powerjoular.

y-ykcir avatar y-ykcir commented on May 30, 2024

@adelnoureddine Thanks for your reply! I use another Raspberry Pi and it work now.
However, I encountered another problem. When I use the following command to measure the power consumption of the application:

profiler_cmd = f"sudo powerjoular -l -a iwasm -f {output_file}"
self.powerjoular_process = subprocess.Popen(split(profiler_cmd))

Test results PowerJoular.csv-iwasm.csv appears negative numbers

Date,CPU Utilization,CPU Power
2023-07-28 14:34:02,-0.00260,-0.02985
2023-07-28 14:34:03,-0.02604,-0.29845
2023-07-28 14:34:04,-0.04427,-0.47206
2023-07-28 14:34:05,-0.05859,-0.82731
2023-07-28 14:34:06,-0.10156,-1.91620
2023-07-28 14:35:50,-0.00391,-0.05675

Is there an error in the negative number or is there something wrong with the way I use it?
Thanks.

from powerjoular.

adelnoureddine avatar adelnoureddine commented on May 30, 2024

That's odd. Power calculations uses CPU utilization, so it's weird that number is negative.
I'll have to be able to replicate it to see where's the issue (from PowerJoular or the CPU cycles reported from Linux).
The -a option check for all PIDs of the app (iwasm), and adds their energy.
CPU utilization uses data from /proc/stat and /proc/pid/stat.

from powerjoular.

y-ykcir avatar y-ykcir commented on May 30, 2024

@adelnoureddine Thanks for your explaination. Is it possible that my iwasm program is too fast that cause this problem? The data above is the result when iwasm execution time is around 0.5-1 seconds. However, when I extended the execution time of the iwasm program, the overall output of Power looked normal, but a negative number still appeared in the last line.

from powerjoular.

adelnoureddine avatar adelnoureddine commented on May 30, 2024

PowerJoular calculates power data every one second. For the application option -a, it re-checks all the PIDs of an application every second and sums their power data.
For short executions and for the last second, if one of the PIDs stopped (while at least one other is present), it will return a 0 for power data, and hence a negative value when calculating the power consumption (which is the P(n) - P(n-1)).

from powerjoular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.