Giter Site home page Giter Site logo

olivierzendra / powprofiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamseew/powprofiler

0.0 0.0 0.0 16.69 MB

PowProfiler (computational but not only) energy modeling tool

License: MIT License

CMake 2.22% C++ 95.70% Shell 1.11% C 0.97%

powprofiler's Introduction

PowProfiler

Or simply powprof is a profiling tool to build computation energy models for mobile robots, and more generally for power critical heterogeneous embedded devices. Born as a simple profiling tool for the companion computers of drones, evolved to a quite complex program that models energy, average power, and drain from the battery through state-of-charge. It helps you understand where the energy of your computation goes, and thus to adjust your code and consume less.

Getting Started

It does not require much, as it's intended for power critical devices; so it compiles on the majority of available Linux based embedded hardware that supports the standard compilation flow (cmake and g++).

To run it, you will need one of the following embedded devices: NVIDIA Jetson Nano or TX2, or ODROID XU3. Nevertheless extending it to another one or using an external multimeter is rather simple (a tutorial will be ready soon).

Setup

Just run the following steps and you should be ok. They generate the executable along with the static and dynamic libraries to include powprof in your code.

  • First, clone the repo (you will find the same repo mirrored on bitbucket and github)
git clone https://bitbucket.org/adamseew/powprofiler.git
cd powprofiler
  • Then, continue with the typical cmake compilation flow. Here is a quick reminder
mkdir build
cd build
cmake ..
make
  • You can include powprof in the environment variable so you can run it directly from bash by calling powprofile
echo 'export PATH=${PATH}:'$PWD >> ~/.bashrc
source ~/.bashrc
  • In case you wish to use powprof in its asynchronous library version, just build the shared library with
sudo make install
  • Make sure that the cache with your shared libraries is up-to-date before including powprof in your project with #include <powprof/async.h>
sudo ldconfig

That's all. Now you can use powprof command to build your computational energy models.

Model build

To build a model you need to use powprof along with a configuration file. Please refer to config3.cfg to see how a simple configuration file looks like (a tutorial is on the way). You need to set the following properties:

  • frequency in Hz. Yes, more frequency means a better model, but keep on mind that it might be too high
  • h is the granularity of the integration for the battery model, i.e., RK4 step
  • directory refers to the directory where the model will be stored
  • component name goes after the dot per each component, e.g., you can have
[components]
    [component.first-component]
    ...
    [component.second-component]
    ...

Instead of the dots in the above slice of code, you have to specify:

  • src the source of the executable. Note that the executable must accept some arguments that change its state. In the example in config3.cfg those are matrix size and exponent
  • range (1 or more) uses the pattern min, max, step (with pow(n) you allow only values that are power of n). For the example above, powprof generates configurations 20, 30, 40, 50, and 60 with the following line. If you have more range entries, powprof combines them automatically
range = 20, 60, 10
  • fixed (0 or more) imagine you need to pass the location of the data as an argument. You can just do it with (powprof uses the order of your entries to understand the order of the arguments)
fixed = /dat/matrix1.csv
  • runtime (optional) the profiling time in ms (important for components running in a loop)

Written your configuration file, you can build the model that will be stored in a csv file by just running powprof along with the configuration file, e.g.,

powprof config3.cfg

this generates an energy model stored in the directory that you specified.

Getting Help

Happy to help you anytime, visit my webpage for contacts or write a github issue (so you will help also the others).

License

It is distributed under MIT license for your convenience, so use it freely in your project as soon as you are aware that it was built for research purposes and we don't support any unethical use of it (i.e., for military involved projects).

powprofiler's People

Contributors

adamseew avatar

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.