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
vacation commit
[simgrid.git]
/
examples
/
msg
/
cloud-two-tasks
/
cloud-two-tasks.c
diff --git
a/examples/msg/cloud-two-tasks/cloud-two-tasks.c
b/examples/msg/cloud-two-tasks/cloud-two-tasks.c
index
dbb462e
..
c9afd7c
100644
(file)
--- a/
examples/msg/cloud-two-tasks/cloud-two-tasks.c
+++ b/
examples/msg/cloud-two-tasks/cloud-two-tasks.c
@@
-14,12
+14,11
@@
static int computation_fun(int argc, char *argv[])
{
const char *pr_name = MSG_process_get_name(MSG_process_self());
const char *host_name = MSG_host_get_name(MSG_host_self());
- double clock_sta, clock_end;
atask = MSG_task_create("Task1", 1e9, 1e9, NULL);
- clock_sta = MSG_get_clock();
+
double
clock_sta = MSG_get_clock();
XBT_INFO("%s:%s task 1 created %g", host_name, pr_name, clock_sta);
MSG_task_execute(atask);
- clock_end = MSG_get_clock();
+
double
clock_end = MSG_get_clock();
XBT_INFO("%s:%s task 1 executed %g", host_name, pr_name, clock_end - clock_sta);
@@
-56,12
+55,9
@@
static void launch_computation_worker(msg_host_t host)
static int master_main(int argc, char *argv[])
{
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
- msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
- xbt_dynar_free(&hosts_dynar);
- msg_vm_t vm0;
- vm0 = MSG_vm_create_core(pm0, "VM0");
+ msg_host_t pm0 = MSG_host_by_name("Fafard");
+ msg_vm_t vm0 = MSG_vm_create_core(pm0, "VM0");
MSG_vm_start(vm0);
- //MSG_process_sleep(1);
launch_computation_worker(vm0);
@@
-93,13
+89,10
@@
int main(int argc, char *argv[]){
xbt_assert(argc == 2);
MSG_create_environment(argv[1]);
- xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
- launch_master(xbt_dynar_get_as(hosts_dynar, 0, msg_host_t));
- xbt_dynar_free(&hosts_dynar);
+ launch_master(MSG_host_by_name("Fafard"));
int res = MSG_main();
XBT_INFO("Bye (simulation time %g)", MSG_get_clock());
- xbt_dynar_free(&hosts_dynar);
return !(res == MSG_OK);
}