Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Expetator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
Expetator
Merge requests
!3
Cleans moj plugins and do not install moj if already in the path
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cleans moj plugins and do not install moj if already in the path
moj
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Georges Da Costa
requested to merge
moj
into
master
3 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
bb6eccbb
1 commit,
3 months ago
1 file
+
21
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
expetator/monitors/mojitos.py
+
21
−
16
Options
import
os
import
stat
import
shutil
def
read_int
(
filename
):
"""
Read integer from file filename
"""
@@ -69,24 +70,28 @@ class Mojitos:
# '/usr/share/doc/libpowercap-dev',
# '/usr/share/doc/libpowercap0']]:
# executor.hosts('apt install -y libpowercap0 libpowercap-dev powercap-utils', root=True)
if
not
os
.
path
.
exists
(
'
/tmp/mojitos
'
):
executor
.
local
(
'
cd /tmp; git clone https://gitlab.irit.fr/sepia-pub/mojitos.git
'
)
else
:
executor
.
local
(
'
cd /tmp/mojitos; git pull
'
)
executor
.
local
(
'
cd /tmp/mojitos; ./configure.sh; make
'
)
executor
.
local
(
'
cp /tmp/mojitos/bin/mojitos /tmp/bin/
'
)
if
True
or
self
.
rapl
or
self
.
perf
:
executor
.
hosts
(
'
sudo-g5k modprobe msr
'
,
root
=
True
)
if
read_int
(
'
/proc/sys/kernel/perf_event_paranoid
'
)
!=
0
:
executor
.
hosts
(
"
sh -c
'
echo 0 >/proc/sys/kernel/perf_event_paranoid
'"
,
root
=
True
)
mode
=
os
.
stat
(
'
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_max_power_uw
'
)
if
not
mode
.
st_mode
&
stat
.
S_IWUSR
:
executor
.
hosts
(
"
chmod a+rw /sys/class/powercap/intel-rapl/*/*
"
,
root
=
True
)
executor
.
hosts
(
"
chmod a+rw /sys/class/powercap/intel-rapl/*/*/*
"
,
root
=
True
)
binary
=
shutil
.
which
(
'
mojitos
'
)
if
binary
is
None
:
if
not
os
.
path
.
exists
(
'
/tmp/mojitos
'
):
executor
.
local
(
'
cd /tmp; git clone https://gitlab.irit.fr/sepia-pub/mojitos.git
'
)
else
:
executor
.
local
(
'
cd /tmp/mojitos; git pull
'
)
executor
.
local
(
'
cd /tmp/mojitos; ./configure.sh; make
'
)
executor
.
local
(
'
cp /tmp/mojitos/bin/mojitos /tmp/bin/
'
)
if
self
.
rapl
or
self
.
perf
:
executor
.
hosts
(
'
modprobe msr
'
,
root
=
True
)
if
read_int
(
'
/proc/sys/kernel/perf_event_paranoid
'
)
!=
0
:
executor
.
hosts
(
"
sh -c
'
echo 0 >/proc/sys/kernel/perf_event_paranoid
'"
,
root
=
True
)
mode
=
os
.
stat
(
'
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_max_power_uw
'
)
if
not
mode
.
st_mode
&
stat
.
S_IWUSR
:
executor
.
hosts
(
"
chmod a+r /sys/class/powercap/intel-rapl/*/*
"
,
root
=
True
)
executor
.
hosts
(
"
chmod a+r /sys/class/powercap/intel-rapl/*/*/*
"
,
root
=
True
)
binary
=
'
/tmp/bin/mojitos
'
self
.
executor
=
executor
self
.
cmdline
=
'
/tmp/bin/mojitos
-t 0 -f
%s
'
%
self
.
frequency
self
.
cmdline
=
f
'
{
binary
}
-t 0 -f
{
self
.
frequency
}
'
if
self
.
perf
:
self
.
cmdline
+=
'
-p
'
+
'
,
'
.
join
(
self
.
names
&
perf_names
)
if
self
.
network
:
Loading