Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tansiv
TANSIV
Commits
8070d3b5
Verified
Commit
8070d3b5
authored
Apr 24, 2020
by
SIMONIN Matthieu
Browse files
Add an initial bench
parent
7057d35c
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
8070d3b5
...
...
@@ -41,6 +41,14 @@ configure_file(examples/send/deployment.xml examples/send/deployment.xml)
configure_file
(
examples/send/nova_cluster.xml examples/send/nova_cluster.xml
)
add_dependencies
(
send fake-vm
)
# Bench (with vsg)
add_executable
(
gettimeofday examples/benchs/gettimeofday.cpp
)
set_target_properties
(
gettimeofday PROPERTIES RUNTIME_OUTPUT_DIRECTORY examples/benchs
)
target_link_libraries
(
gettimeofday PUBLIC
${
FAKEVM_LIBS
}
vsg
)
configure_file
(
examples/benchs/deployment.xml examples/benchs/deployment.xml
)
configure_file
(
examples/benchs/nova_cluster.xml examples/benchs/nova_cluster.xml
)
add_dependencies
(
gettimeofday fake-vm
)
# Unit tests
add_executable
(
tests src/tests/tests.cpp
)
target_link_libraries
(
tests PUBLIC
${
FAKEVM_LIBS
}
vsg
${
SimGrid_LIBRARY
}
)
...
...
@@ -49,4 +57,7 @@ target_compile_options(tests PUBLIC -fexceptions)
add_dependencies
(
tests fake-vm
)
install
(
TARGETS tansiv DESTINATION bin
)
install
(
TARGETS vsg DESTINATION lib
)
install
(
FILES src/vsg/vsg.h DESTINATION include
)
install
(
CODE
"MESSAGE(
\"
-- Installing libfake_vm
\"
)"
)
install
(
CODE
"execute_process(COMMAND make install WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/fake-vm )"
)
\ No newline at end of file
src/simgrid/VmsCoordinator.cpp
View file @
8070d3b5
...
...
@@ -15,9 +15,13 @@ static std::vector<simgrid::s4u::ActorPtr> receivers;
const
std
::
string
vsg_vm_name
=
"vsg_vm"
;
double
force_min_latency
=
-
1
;
static
double
compute_min_latency
()
{
if
(
force_min_latency
>=
0
)
{
return
force_min_latency
;
}
double
min_latency
=
std
::
numeric_limits
<
double
>::
infinity
();
for
(
simgrid
::
s4u
::
ActorPtr
sender
:
receivers
)
{
...
...
@@ -35,7 +39,6 @@ static double compute_min_latency()
xbt_assert
(
min_latency
>
0
,
"error with the platform file : the minimum latency between hosts is %f <= 0"
,
min_latency
);
XBT_INFO
(
"the minimum latency on the network is %f sec"
,
min_latency
);
return
min_latency
;
}
...
...
@@ -200,10 +203,23 @@ static void vm_coordinator()
XBT_INFO
(
"end of simulation"
);
}
double
parse_args_force
(
int
argc
,
char
*
argv
[])
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
std
::
string
(
argv
[
i
])
==
"--force"
)
{
return
std
::
stod
(
argv
[
i
+
1
]);
}
}
return
-
1
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
xbt_assert
(
argc
>
2
,
"Usage: %s platform_file deployment_file
\n
"
,
argv
[
0
]);
force_min_latency
=
parse_args_force
(
argc
,
argv
);
XBT_DEBUG
(
"Forcing the minimum latency to %d"
,
force_min_latency
);
simgrid
::
s4u
::
Engine
e
(
&
argc
,
argv
);
e
.
load_platform
(
argv
[
1
]);
...
...
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