A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
STFU you dawn VM - The lovingly handmade tests
[simgrid.git]
/
examples
/
msg
/
cloud
/
two_tasks_vm.c
diff --git
a/examples/msg/cloud/two_tasks_vm.c
b/examples/msg/cloud/two_tasks_vm.c
index
063eefe
..
15c9698
100644
(file)
--- a/
examples/msg/cloud/two_tasks_vm.c
+++ b/
examples/msg/cloud/two_tasks_vm.c
@@
-1,17
+1,12
@@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014
-2015
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <stdio.h>
-#include "msg/msg.h"
-#include "xbt/sysdep.h"
+#include "simgrid/msg.h"
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
- "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
msg_task_t atask = NULL;
msg_task_t atask = NULL;
@@
-64,18
+59,20
@@
static int master_main(int argc, char *argv[])
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
msg_vm_t vm0;
vm0 = MSG_vm_create_core(pm0, "VM0");
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
msg_vm_t vm0;
vm0 = MSG_vm_create_core(pm0, "VM0");
-
+ MSG_vm_start(vm0);
//MSG_process_sleep(1);
//MSG_process_sleep(1);
- launch_computation_worker(
p
m0);
+ launch_computation_worker(
v
m0);
while(MSG_get_clock()<100) {
while(MSG_get_clock()<100) {
-
if (atask != NULL)
-
XBT_INFO("aTask remaining duration: %g", MSG_task_get_remaining_computation
(atask));
-
MSG_process_sleep(1);
+ if (atask != NULL)
+
XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount
(atask));
+ MSG_process_sleep(1);
}
MSG_process_sleep(10000);
}
MSG_process_sleep(10000);
+ MSG_vm_destroy(vm0);
+ xbt_dynar_free(&hosts_dynar);
return 1;
}
return 1;
}
@@
-101,10
+98,8
@@
int main(int argc, char *argv[]){
int res = MSG_main();
XBT_INFO("Bye (simulation time %g)", MSG_get_clock());
int res = MSG_main();
XBT_INFO("Bye (simulation time %g)", MSG_get_clock());
+ xbt_dynar_free(&hosts_dynar);
return !(res == MSG_OK);
}
return !(res == MSG_OK);
}
-
-
-