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
sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs
[simgrid.git]
/
teshsuite
/
msg
/
host_on_off
/
host_on_off.c
diff --git
a/teshsuite/msg/host_on_off/host_on_off.c
b/teshsuite/msg/host_on_off/host_on_off.c
index fb812dbc79129f07b8ab826c705bda364028a00e..1c6e376815d7bb0b7632329b4e962d76cd07c763 100644
(file)
--- a/
teshsuite/msg/host_on_off/host_on_off.c
+++ b/
teshsuite/msg/host_on_off/host_on_off.c
@@
-1,11
+1,11
@@
-/* Copyright (c) 2010-201
4
. The SimGrid Team.
+/* Copyright (c) 2010-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. */
#include <stdio.h>
* 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" /* Yeah! If you want to use msg, you need to include msg
/msg.h */
+#include "
simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid
/msg.h */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
@@
-25,7
+25,7
@@
int master(int argc, char *argv[])
char mailbox[256];
msg_task_t task = NULL;
char mailbox[256];
msg_task_t task = NULL;
- msg_host_t jupiter = MSG_
get_
host_by_name("Jupiter");
+ msg_host_t jupiter = MSG_host_by_name("Jupiter");
sprintf(mailbox, "jupi");
task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
sprintf(mailbox, "jupi");
task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
@@
-55,7
+55,7
@@
int master(int argc, char *argv[])
char **argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("slave");
char **argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("slave");
- MSG_process_create_with_arguments("slave", slave, NULL, MSG_
get_
host_by_name("Jupiter"), 1, argvF);
+ MSG_process_create_with_arguments("slave", slave, NULL, MSG_host_by_name("Jupiter"), 1, argvF);
task = MSG_task_create("task on with proc", task_comp_size, task_comm_size, NULL);
XBT_INFO("Sending \"%s\"", task->name);
task = MSG_task_create("task on with proc", task_comp_size, task_comm_size, NULL);
XBT_INFO("Sending \"%s\"", task->name);
@@
-75,7
+75,7
@@
int master(int argc, char *argv[])
int slave(int argc, char *argv[])
{
msg_task_t task = NULL;
int slave(int argc, char *argv[])
{
msg_task_t task = NULL;
-
_XBT_GNUC
_UNUSED int res;
+
XBT_ATTRIB
_UNUSED int res;
int id = -1;
char mailbox[80];
int id = -1;
char mailbox[80];
@@
-108,15
+108,13
@@
int main(int argc, char *argv[])
const char *application_file;
MSG_init(&argc, argv);
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
platform_file = argv[1];
application_file = argv[2];
- /* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
MSG_create_environment(platform_file);
}
{ /* Simulation setting */
MSG_create_environment(platform_file);
}
@@
-130,8
+128,5
@@
int main(int argc, char *argv[])
XBT_INFO("Simulation time %g", MSG_get_clock());
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
} /* end_of_main */