1 /* Copyright (c) 2010-2012. 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. */
8 /******************** Non-deterministic message ordering *********************/
9 /* Server assumes a fixed order in the reception of messages from its clients */
10 /* which is incorrect because the message ordering is non-deterministic */
11 /******************************************************************************/
14 #include <simgrid/modelchecker.h>
18 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
20 int server(int argc, char *argv[]);
21 int client(int argc, char *argv[]);
23 int server(int argc, char *argv[])
25 msg_task_t task = NULL;
29 MSG_task_destroy(task);
32 MSG_task_receive(&task, "mymailbox");
35 MC_assert(atoi(MSG_task_get_name(task)) == 3);
41 int client(int argc, char *argv[])
45 MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ ,
46 NULL /*arbitrary data */ );
48 MSG_task_send(task, "mymailbox");
54 int main(int argc, char *argv[])
57 MSG_init(&argc, argv);
59 MSG_create_environment("platform.xml");
61 MSG_function_register("server", server);
63 MSG_function_register("client", client);
65 MSG_launch_application("deploy_bugged1.xml");