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
Commits
abfdb0b4
Commit
abfdb0b4
authored
3 years ago
by
Georges Da Costa
Browse files
Options
Downloads
Patches
Plain Diff
Makes the project compatible with pdoc
parent
4a323674
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
expetator/monitors/laptop_power_monitor.py
+18
-17
18 additions, 17 deletions
expetator/monitors/laptop_power_monitor.py
tests/example.py
+0
-37
0 additions, 37 deletions
tests/example.py
tests/example_gpu.py
+0
-37
0 additions, 37 deletions
tests/example_gpu.py
with
18 additions
and
91 deletions
expetator/monitors/laptop_power_monitor.py
+
18
−
17
View file @
abfdb0b4
...
...
@@ -12,26 +12,27 @@ def read_int(filename):
def
handler
(
arg
):
stay
=
False
if
__name__
==
'
__main__
'
:
signal
.
signal
(
15
,
handler
)
signal
.
signal
(
15
,
handler
)
stay
=
True
stay
=
True
with
open
(
'
/dev/shm/power_measures
'
,
'
w
'
)
as
power_file
:
power_file
.
write
(
'
#timestamp power
\n
'
)
with
open
(
'
/dev/shm/power_measures
'
,
'
w
'
)
as
power_file
:
power_file
.
write
(
'
#timestamp power
\n
'
)
try
:
while
stay
:
mili_volt
=
read_int
(
'
/sys/class/power_supply/BAT0/voltage_now
'
)
mili_ampere
=
read_int
(
'
/sys/class/power_supply/BAT0/current_now
'
)
watt
=
mili_volt
*
mili_ampere
/
1000000000000
try
:
while
stay
:
mili_volt
=
read_int
(
'
/sys/class/power_supply/BAT0/voltage_now
'
)
mili_ampere
=
read_int
(
'
/sys/class/power_supply/BAT0/current_now
'
)
watt
=
mili_volt
*
mili_ampere
/
1000000000000
current_time
=
time
.
time
()
int_current_time
=
int
(
current_time
)
current_time
=
time
.
time
()
int_current_time
=
int
(
current_time
)
with
open
(
'
/dev/shm/power_measures
'
,
'
a
'
)
as
power_file
:
power_file
.
write
(
str
(
int_current_time
)
+
'
'
+
str
(
watt
)
+
'
\n
'
)
time
.
sleep
(
1
-
(
current_time
-
int_current_time
))
except
:
pass
with
open
(
'
/dev/shm/power_measures
'
,
'
a
'
)
as
power_file
:
power_file
.
write
(
str
(
int_current_time
)
+
'
'
+
str
(
watt
)
+
'
\n
'
)
time
.
sleep
(
1
-
(
current_time
-
int_current_time
))
except
:
pass
This diff is collapsed.
Click to expand it.
tests/example.py
deleted
100644 → 0
+
0
−
37
View file @
4a323674
#!/usr/bin/python3
"""
This script run HPC benchmarks with enabled monitoring
"""
import
os
import
sys
import
platform
import
expetator.experiment
as
experiment
from
expetator.benchmarks
import
sleepbench
from
expetator.monitors
import
mojitos
,
power
from
expetator.leverages
import
dvfs
,
pct
BENCHMARKS
=
[
sleepbench
.
SleepBench
(
default_time
=
5
)]
LEVERAGES
=
[
dvfs
.
Dvfs
(
dummy
=
True
),
pct
.
Pct
(
dummy
=
True
)]
hw_pct
=
{
'
instructions
'
,
'
cache_misses
'
}
MONITORS
=
[
mojitos
.
Mojitos
(
sensor_set
=
hw_pct
),
power
.
Power
()]
if
len
(
sys
.
argv
)
>
1
:
dest_dir
=
sys
.
argv
[
1
]
else
:
dest_dir
=
'
/tmp/demo
'
cluster
=
platform
.
node
().
split
(
'
-
'
)[
0
]
name
=
'
%s/%s/demo
'
%
(
dest_dir
,
cluster
)
os
.
makedirs
(
os
.
path
.
dirname
(
name
),
exist_ok
=
True
)
experiment
.
run_experiment
(
name
,
BENCHMARKS
,
leverages
=
LEVERAGES
,
monitors
=
MONITORS
,
sweep
=
True
,
times
=
1
)
This diff is collapsed.
Click to expand it.
tests/example_gpu.py
deleted
100644 → 0
+
0
−
37
View file @
4a323674
#!/usr/bin/python3
"""
This script run HPC benchmarks with enabled monitoring
"""
import
os
import
sys
import
platform
import
expetator.experiment
as
experiment
from
expetator.benchmarks
import
sleepbench
,
cpubench
,
mpibench
,
membench
,
npbbench
,
gpucpubench
,
gpumembench
from
expetator.monitors
import
mojitos
,
power
,
powergpu
from
expetator.leverages
import
dvfs
,
gpuclock
,
gpupow
BENCHMARKS
=
[
gpucpubench
.
GpuCpuBench
(),
gpumembench
.
GpuMemBench
()]
LEVERAGES
=
[
gpupow
.
GpuPower
(
steps
=
2
),
gpuclock
.
GpuClock
(
steps
=
2
)]
hw_pct
=
{
'
instructions
'
,
'
cache_misses
'
}
MONITORS
=
[
mojitos
.
Mojitos
(
sensor_set
=
hw_pct
),
power
.
Power
(),
powergpu
.
Power
()]
if
len
(
sys
.
argv
)
>
1
:
dest_dir
=
sys
.
argv
[
1
]
else
:
dest_dir
=
'
/tmp/demo
'
cluster
=
platform
.
node
().
split
(
'
-
'
)[
0
]
name
=
'
%s/%s/demo_gpu
'
%
(
dest_dir
,
cluster
)
os
.
makedirs
(
os
.
path
.
dirname
(
name
),
exist_ok
=
True
)
experiment
.
run_experiment
(
name
,
BENCHMARKS
,
leverages
=
LEVERAGES
,
monitors
=
MONITORS
,
sweep
=
True
,
times
=
1
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment