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
guess what? more refactoring!
[simgrid.git]
/
examples
/
msg
/
cloud
/
migrate_vm.c
diff --git
a/examples/msg/cloud/migrate_vm.c
b/examples/msg/cloud/migrate_vm.c
index
9bd4b36
..
1c92fb5
100644
(file)
--- a/
examples/msg/cloud/migrate_vm.c
+++ b/
examples/msg/cloud/migrate_vm.c
@@
-1,19
+1,12
@@
-/* Copyright (c) 2007-201
4
. The SimGrid Team.
+/* Copyright (c) 2007-201
5
. 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 "simgrid/msg.h"
#include "simgrid/msg.h"
-#include "xbt/sysdep.h" /* calloc, printf */
-
-/* Create a log channel to have nice outputs. */
-#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");
static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
{
static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
{
@@
-23,8
+16,8
@@
static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
double mig_end = MSG_get_clock();
XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm),
double mig_end = MSG_get_clock();
XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm),
-
MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
-
mig_end - mig_sta);
+ MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
+ mig_end - mig_sta);
}
static int migration_worker_main(int argc, char *argv[])
}
static int migration_worker_main(int argc, char *argv[])
@@
-67,8
+60,6
@@
static int master_main(int argc, char *argv[])
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
-
-
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
MSG_host_set_params(vm0, ¶ms);
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
MSG_host_set_params(vm0, ¶ms);
@@
-79,8
+70,6
@@
static int master_main(int argc, char *argv[])
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm0);
-
-
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 100; // 100Mbytes
MSG_host_set_params(vm0, ¶ms);
vm0 = MSG_vm_create_core(pm0, "VM0");
params.ramsize = 1L * 1000 * 1000 * 100; // 100Mbytes
MSG_host_set_params(vm0, ¶ms);
@@
-91,8
+80,6
@@
static int master_main(int argc, char *argv[])
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm0);
-
-
vm0 = MSG_vm_create_core(pm0, "VM0");
vm1 = MSG_vm_create_core(pm0, "VM1");
vm0 = MSG_vm_create_core(pm0, "VM0");
vm1 = MSG_vm_create_core(pm0, "VM1");
@@
-110,8
+97,6
@@
static int master_main(int argc, char *argv[])
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm1);
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm1);
-
-
vm0 = MSG_vm_create_core(pm0, "VM0");
vm1 = MSG_vm_create_core(pm0, "VM1");
vm0 = MSG_vm_create_core(pm0, "VM0");
vm1 = MSG_vm_create_core(pm0, "VM1");
@@
-129,7
+114,6
@@
static int master_main(int argc, char *argv[])
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm1);
MSG_vm_destroy(vm0);
MSG_vm_destroy(vm1);
-
return 0;
}
return 0;
}
@@
-143,7
+127,6
@@
static void launch_master(msg_host_t host)
MSG_process_create_with_arguments(pr_name, master_main, NULL, host, 1, argv);
}
MSG_process_create_with_arguments(pr_name, master_main, NULL, host, 1, argv);
}
-
int main(int argc, char *argv[])
{
/* Get the arguments */
int main(int argc, char *argv[])
{
/* Get the arguments */
@@
-159,6
+142,5
@@
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());
-
return !(res == MSG_OK);
}
return !(res == MSG_OK);
}