Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a53e51fb15296a02ac8dfd5208ab0b0973bcb55d
[simgrid.git] / examples / msg / trace-simple / trace-simple.c
1 /* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "simgrid/msg.h"
7
8 static int simple_func(int argc, char *argv[])
9 {
10   msg_task_t task = MSG_task_create("task", 100, 0, NULL);
11   MSG_task_execute (task);
12   MSG_task_destroy (task);
13   return 0;
14 }
15
16 int main(int argc, char *argv[])
17 {
18   MSG_init(&argc, argv);
19   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
20
21   MSG_create_environment(argv[1]);
22   MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Tremblay"));
23   MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Fafard"));
24
25   MSG_main();
26   return 0;
27 }