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
Revert "platform change impacts java too"
[simgrid.git]
/
examples
/
msg
/
cloud-masterworker
/
cloud-masterworker.c
diff --git
a/examples/msg/cloud-masterworker/cloud-masterworker.c
b/examples/msg/cloud-masterworker/cloud-masterworker.c
index
a2ba395
..
41fa989
100644
(file)
--- a/
examples/msg/cloud-masterworker/cloud-masterworker.c
+++ b/
examples/msg/cloud-masterworker/cloud-masterworker.c
@@
-1,5
+1,4
@@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2017. 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. */
/* 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. */
@@
-47,14
+46,11
@@
static int worker_fun(int argc, char *argv[])
msg_task_t task = NULL;
msg_error_t res = MSG_task_receive(&task, mbox);
msg_task_t task = NULL;
msg_error_t res = MSG_task_receive(&task, mbox);
- if (res != MSG_OK) {
- XBT_CRITICAL("MSG_task_get failed");
- DIE_IMPOSSIBLE;
- }
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("%s received task(%s) from mailbox(%s)", pr_name, MSG_task_get_name(task), mbox);
XBT_INFO("%s received task(%s) from mailbox(%s)", pr_name, MSG_task_get_name(task), mbox);
- if (
!strcmp(MSG_task_get_name(task), "finalize")
) {
+ if (
strcmp(MSG_task_get_name(task), "finalize") == 0
) {
MSG_task_destroy(task);
break;
}
MSG_task_destroy(task);
break;
}
@@
-90,7
+86,7
@@
static int master_fun(int argc, char *argv[])
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
- MSG_
host
_set_params(vm, ¶ms);
+ MSG_
vm
_set_params(vm, ¶ms);
MSG_vm_start(vm);
xbt_dynar_push(vms, &vm);
MSG_vm_start(vm);
xbt_dynar_push(vms, &vm);
@@
-108,8
+104,7
@@
static int master_fun(int argc, char *argv[])
XBT_INFO("# Suspend all VMs");
xbt_dynar_foreach(vms, i, vm) {
XBT_INFO("# Suspend all VMs");
xbt_dynar_foreach(vms, i, vm) {
- const char *vm_name = MSG_host_get_name(vm);
- XBT_INFO("suspend %s", vm_name);
+ XBT_INFO("suspend %s", MSG_host_get_name(vm));
MSG_vm_suspend(vm);
}
MSG_vm_suspend(vm);
}
@@
-122,7
+117,7
@@
static int master_fun(int argc, char *argv[])
}
XBT_INFO("# Sleep long enough for everyone to be done with previous batch of work");
}
XBT_INFO("# Sleep long enough for everyone to be done with previous batch of work");
- MSG_process_sleep(10
00
- MSG_get_clock());
+ MSG_process_sleep(10 - MSG_get_clock());
XBT_INFO("# Add one more process on each VM");
xbt_dynar_foreach(vms, i, vm) {
XBT_INFO("# Add one more process on each VM");
xbt_dynar_foreach(vms, i, vm) {
@@
-153,10
+148,10
@@
static int master_fun(int argc, char *argv[])
MSG_vm_migrate(vm, worker_pm1);
}
MSG_vm_migrate(vm, worker_pm1);
}
- XBT_INFO("# Shutdown the half of worker processes gracefuly. The remaining half will be forcibly killed.");
+ XBT_INFO("# Shutdown the half of worker processes graceful
l
y. The remaining half will be forcibly killed.");
for (i = 0; i < nb_workers; i++) {
char mbox[MAXMBOXLEN];
for (i = 0; i < nb_workers; i++) {
char mbox[MAXMBOXLEN];
- snprintf(mbox, MAXMBOXLEN, "MBOX:WRK%02
d
", i);
+ snprintf(mbox, MAXMBOXLEN, "MBOX:WRK%02
u
", i);
msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
MSG_task_send(finalize, mbox);
}
msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
MSG_task_send(finalize, mbox);
}
@@
-183,7
+178,7
@@
int main(int argc, char *argv[])
const int nb_workers = 2;
MSG_init(&argc, argv);
const int nb_workers = 2;
MSG_init(&argc, argv);
- xbt_assert(argc >1,"Usage: %s example/
msg/msg_platform
.xml\n", argv[0]);
+ xbt_assert(argc >1,"Usage: %s example/
platforms/cluster
.xml\n", argv[0]);
/* Load the platform file */
MSG_create_environment(argv[1]);
/* Load the platform file */
MSG_create_environment(argv[1]);