Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
cab36e8f
Commit
cab36e8f
authored
Nov 28, 2020
by
Antoine Kaufmann
Browse files
experiments: set cpu frequency for synchronized qemu
parent
c5a28c04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
experiments/modes/simulators.py
experiments/modes/simulators.py
+13
-1
No files found.
experiments/modes/simulators.py
View file @
cab36e8f
import
math
class
Simulator
(
object
):
# number of cores required for this simulator
def
resreq_cores
(
self
):
...
...
@@ -103,7 +105,17 @@ class QemuHost(HostSim):
f
'-m
{
self
.
node_config
.
memory
}
-smp
{
self
.
node_config
.
cores
}
'
)
if
self
.
sync
:
cmd
+=
' -cpu Skylake-Server -icount shift=0,sleep=off '
unit
=
self
.
cpu_freq
[
-
3
:]
if
unit
.
lower
()
==
'ghz'
:
base
=
0
elif
unit
.
lower
()
==
'mhz'
:
base
=
3
else
:
raise
Exception
(
'cpu frequency specified in unsupported unit'
)
num
=
float
(
self
.
cpu_freq
[:
-
3
])
shift
=
base
-
int
(
math
.
ceil
(
math
.
log
(
num
,
2
)))
cmd
+=
f
' -cpu Skylake-Server -icount shift=
{
shift
}
,sleep=off '
else
:
cmd
+=
' -cpu host -enable-kvm '
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment