1 /* Copyright (c) 2010-2015. 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 /******************************************************************************/
12 #include <simgrid/msg.h>
13 #include <simgrid/modelchecker.h>
17 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
19 static int server(int argc, char *argv[])
21 msg_task_t task = NULL;
25 MSG_task_destroy(task);
28 MSG_task_receive(&task, "mymailbox");
31 MC_assert(xbt_str_parse_int(MSG_task_get_name(task), "Task names must be integers, not '%s'") == 3);
37 static int client(int argc, char *argv[])
39 msg_task_t task = MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , NULL /*arbitrary data */ );
41 MSG_task_send(task, "mymailbox");
47 int main(int argc, char *argv[])
49 MSG_init(&argc, argv);
51 MSG_create_environment("platform.xml");
53 MSG_function_register("server", server);
54 MSG_function_register("client", client);
55 MSG_launch_application("deploy_bugged1.xml");