Skip to content

Commit

Permalink
Merge pull request #60 from joular/develop
Browse files Browse the repository at this point in the history
Version 2.8.2
  • Loading branch information
adelnoureddine authored Jan 30, 2024
2 parents a1c7c7b + 5dcadbc commit 3ed30c0
Show file tree
Hide file tree
Showing 40 changed files with 2,004 additions and 1,174 deletions.
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
36 changes: 18 additions & 18 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
138 changes: 69 additions & 69 deletions PowerMonitor/Main.cpp
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
/*
* Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU General Public License v3.0 only (GPL-3.0-only)
* which accompanies this distribution, and is available at
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* Author : Adel Noureddine
*/

#include <iostream>

#include <SDKDDKVer.h>

#include <stdio.h>
#include <tchar.h>
#include "IntelPowerGadgetLib.h"

using namespace std;

int main() {
CIntelPowerGadgetLib energyLib;

if (energyLib.IntelEnergyLibInitialize() == false) {
return 0;
}

int nNodes = 0;
int nMsrs = 0;

energyLib.GetNumNodes(&nNodes);
energyLib.GetNumMsrs(&nMsrs);

while (true) {
if (!energyLib.ReadSample()) {
return 0;
}

double data[3];
int nData, funcId;
double power = 0;
wchar_t szName[MAX_PATH];

// Processor (i=0, j=1)
energyLib.GetMsrFunc(1, &funcId);
energyLib.GetMsrName(1, szName);

if (funcId != 1) {
continue;
}
energyLib.GetPowerData(0, 1, data, &nData);
power += data[0]; // power in W %6.2f

// Now check for DRAM and add it to total power (i=0, j=4)
energyLib.GetMsrFunc(4, &funcId);
energyLib.GetMsrName(4, szName);

if (funcId == 1) {
energyLib.GetPowerData(0, 4, data, &nData);
power += data[0]; // power in W %6.2f
}

cout << power << endl;

// Sleep for one second
Sleep(1000);
}
return 0;
/*
* Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU General Public License v3.0 only (GPL-3.0-only)
* which accompanies this distribution, and is available at
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* Author : Adel Noureddine
*/

#include <iostream>

#include <SDKDDKVer.h>

#include <stdio.h>
#include <tchar.h>
#include "IntelPowerGadgetLib.h"

using namespace std;

int main() {
CIntelPowerGadgetLib energyLib;

if (energyLib.IntelEnergyLibInitialize() == false) {
return 0;
}

int nNodes = 0;
int nMsrs = 0;

energyLib.GetNumNodes(&nNodes);
energyLib.GetNumMsrs(&nMsrs);

while (true) {
if (!energyLib.ReadSample()) {
return 0;
}

double data[3];
int nData, funcId;
double power = 0;
wchar_t szName[MAX_PATH];

// Processor (i=0, j=1)
energyLib.GetMsrFunc(1, &funcId);
energyLib.GetMsrName(1, szName);

if (funcId != 1) {
continue;
}
energyLib.GetPowerData(0, 1, data, &nData);
power += data[0]; // power in W %6.2f

// Now check for DRAM and add it to total power (i=0, j=4)
energyLib.GetMsrFunc(4, &funcId);
energyLib.GetMsrName(4, szName);

if (funcId == 1) {
energyLib.GetPowerData(0, 4, data, &nData);
power += data[0]; // power in W %6.2f
}

cout << power << endl;

// Sleep for one second
Sleep(1000);
}
return 0;
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ JoularJX depend on the following software or packages in order to get power read
- On Windows, JoularJX uses a custom power monitor program that uses Intel Power Gadget API on Windows, and therefore require installing the [Intel Power Gadget tool](https://www.intel.com/content/www/us/en/developer/articles/tool/power-gadget.html) and using a supported Intel CPU.
- On PC/server GNU/Linux, JoularJX uses Intel RAPL interface through powercap, and therefore requires running on an Intel CPU or an AMD Ryzen CPU.
- On macOS, JoularJX uses `powermetrics`, a tool bundled with macOS which requires running with `sudo` access. It is recommended to authorize the current users to run `/usr/bin/powermetrics` without requiring a password by making the proper modification to the `sudoers` file.
- On Raspberry Pi devices on GNU/Linux, JoularJX uses our own research-based regression models to estimate CPU power consumption with support for the following device models:
- On Raspberry Pi devices on GNU/Linux, JoularJX uses our own research-based regression models to estimate CPU power consumption with support for the following device models (we support all revisions of each model lineup. However, the model is generated and trained on a specific revision, listed between brackets, and the accuracy is best on this particular revision):
- Model Zero W (rev 1.1), for 32-bit OS
- Model 1 B (rev 2), for 32-bit OS
- Model 1 B+ (rev 1.2), for 32-bit OS
Expand All @@ -40,6 +40,7 @@ JoularJX depend on the following software or packages in order to get power read
- Model 3 B+ (rev 1.3), for 32-bit OS
- Model 4 B (rev 1.1, and rev 1.2), for both 32 bits and 64-bit OS
- Model 400 (rev 1.0), for 64-bit OS
- Model 5 B (rev 1.0), for 64 bits OS

We also support Asus Tinker Board (S).

Expand Down Expand Up @@ -156,7 +157,7 @@ To cite our work in a research paper, please cite our paper in the 18th Internat

JoularJX is licensed under the GNU GPL 3 license only (GPL-3.0-only).

Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
All rights reserved. This program and the accompanying materials are made available under the terms of the GNU General Public License v3.0 only (GPL-3.0-only) which accompanies this distribution, and is available at: https://www.gnu.org/licenses/gpl-3.0.en.html

Author : Adel Noureddine
50 changes: 25 additions & 25 deletions config-installer.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
:: Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
:: All rights reserved. This program and the accompanying materials
:: are made available under the terms of the
:: GNU General Public License v3.0 only (GPL-3.0-only)
:: which accompanies this distribution, and is available at
:: https://www.gnu.org/licenses/gpl-3.0.en.html
::
:: Author : Adel Noureddine

@echo off
title JoularJX Installer Configurator

echo Compiling and building JoularJX
call mvn clean install

echo Compiling ProgramMonitor on Windows x64
set DEVENV_COM=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.com
cd PowerMonitor
"%DEVENV_COM%" PowerMonitor.sln /Build "Release|x64"
cd ..

echo Copying files to install folder
copy config.properties install
copy target\joularjx-*.jar install
copy PowerMonitor\x64\Release\PowerMonitor.exe install
:: Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
:: All rights reserved. This program and the accompanying materials
:: are made available under the terms of the
:: GNU General Public License v3.0 only (GPL-3.0-only)
:: which accompanies this distribution, and is available at
:: https://www.gnu.org/licenses/gpl-3.0.en.html
::
:: Author : Adel Noureddine

@echo off
title JoularJX Installer Configurator

echo Compiling and building JoularJX
call mvn clean install

echo Compiling ProgramMonitor on Windows x64
set DEVENV_COM=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.com
cd PowerMonitor
"%DEVENV_COM%" PowerMonitor.sln /Build "Release|x64"
cd ..

echo Copying files to install folder
copy config.properties install
copy target\joularjx-*.jar install
copy PowerMonitor\x64\Release\PowerMonitor.exe install
pause
2 changes: 1 addition & 1 deletion config.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# GNU General Public License v3.0 only (GPL-3.0-only)
Expand Down
2 changes: 1 addition & 1 deletion install/config.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# GNU General Public License v3.0 only (GPL-3.0-only)
Expand Down
Binary file removed install/joularjx-2.8.1.jar
Binary file not shown.
Binary file added install/joularjx-2.8.2.jar
Binary file not shown.
44 changes: 22 additions & 22 deletions install/linux-install.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/sh

# Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# GNU General Public License v3.0 only (GPL-3.0-only)
# which accompanies this distribution, and is available at
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Author : Adel Noureddine

INSTALLATION_PATH=/opt/joularjx

read -p "Installation to $INSTALLATION_PATH. Continue ([y]/n)? " USER_CONFIRMATION
echo
if [ "$USER_CONFIRMATION" = "y" ]
then
mkdir $INSTALLATION_PATH
cp joularjx-*.jar $INSTALLATION_PATH
cp config.properties $INSTALLATION_PATH

echo "Installation complete. JoularJX files installed in $INSTALLATION_PATH"
#!/bin/sh

# Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# GNU General Public License v3.0 only (GPL-3.0-only)
# which accompanies this distribution, and is available at
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Author : Adel Noureddine

INSTALLATION_PATH=/opt/joularjx

read -p "Installation to $INSTALLATION_PATH. Continue ([y]/n)? " USER_CONFIRMATION
echo
if [ "$USER_CONFIRMATION" = "y" ]
then
mkdir $INSTALLATION_PATH
cp joularjx-*.jar $INSTALLATION_PATH
cp config.properties $INSTALLATION_PATH

echo "Installation complete. JoularJX files installed in $INSTALLATION_PATH"
fi
48 changes: 24 additions & 24 deletions install/windows-install.bat
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
:: Copyright (c) 2021-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
:: All rights reserved. This program and the accompanying materials
:: are made available under the terms of the
:: GNU General Public License v3.0 only (GPL-3.0-only)
:: which accompanies this distribution, and is available at
:: https://www.gnu.org/licenses/gpl-3.0.en.html
::
:: Author : Adel Noureddine

@echo off
title JoularJX Windows Installer

set INSTALLATION_PATH=C:\joularjx

set USER_CONFIRMATION=y
set /p USER_CONFIRMATION=Installation to %INSTALLATION_PATH%. Continue ([y]/n)?
if /i not "%USER_CONFIRMATION%" == "y" goto :eof

md %INSTALLATION_PATH%
copy joularjx-*.jar %INSTALLATION_PATH%
copy config.properties %INSTALLATION_PATH%
copy PowerMonitor.exe %INSTALLATION_PATH%

echo Installation complete. JoularJX files installed in %INSTALLATION_PATH%
:: Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour.
:: All rights reserved. This program and the accompanying materials
:: are made available under the terms of the
:: GNU General Public License v3.0 only (GPL-3.0-only)
:: which accompanies this distribution, and is available at
:: https://www.gnu.org/licenses/gpl-3.0.en.html
::
:: Author : Adel Noureddine

@echo off
title JoularJX Windows Installer

set INSTALLATION_PATH=C:\joularjx

set USER_CONFIRMATION=y
set /p USER_CONFIRMATION=Installation to %INSTALLATION_PATH%. Continue ([y]/n)?
if /i not "%USER_CONFIRMATION%" == "y" goto :eof

md %INSTALLATION_PATH%
copy joularjx-*.jar %INSTALLATION_PATH%
copy config.properties %INSTALLATION_PATH%
copy PowerMonitor.exe %INSTALLATION_PATH%

echo Installation complete. JoularJX files installed in %INSTALLATION_PATH%
pause
Loading

0 comments on commit 3ed30c0

Please sign in to comment.