1 /* Copyright (c) 2010-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /******************** Non-deterministic message ordering *********************/
8 /* Server assumes a fixed order in the reception of messages from its clients */
9 /* which is incorrect because the message ordering is non-deterministic */
10 /******************************************************************************/
13 #include <simgrid/modelchecker.h>
17 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
19 int server(int argc, char *argv[]);
20 int client(int argc, char *argv[]);
22 int server(int argc, char *argv[])
24 msg_task_t task = NULL;
28 MSG_task_destroy(task);
31 MSG_task_receive(&task, "mymailbox");
34 MC_assert(atoi(MSG_task_get_name(task)) == 3);
40 int client(int argc, char *argv[])
44 MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ ,
45 NULL /*arbitrary data */ );
47 MSG_task_send(task, "mymailbox");
53 int main(int argc, char *argv[])
56 MSG_init(&argc, argv);
58 MSG_create_environment("platform.xml");
60 MSG_function_register("server", server);
62 MSG_function_register("client", client);
64 MSG_launch_application("deploy_bugged1.xml");