Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / simdag / platforms / basic_tracing.c
1 /* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "msg/msg.h"
10 #include "surf/surf_private.h"
11
12 int host(int argc, char *argv[]);
13
14 XBT_LOG_NEW_DEFAULT_CATEGORY(basic_tracing,"Messages specific for this example");
15
16 int host(int argc, char *argv[])
17 {
18   XBT_INFO("Sleep for 1s");
19   MSG_process_sleep(1);
20   return 0;
21 }
22
23 int main(int argc, char **argv)
24 {
25   int res;
26   MSG_global_init(&argc, argv);
27   MSG_create_environment(argv[1]);
28   MSG_function_register("host", host);
29   MSG_process_create( "host", host, NULL, MSG_get_host_table()[0] );
30
31   res = MSG_main();
32   XBT_INFO("Simulation time %g", MSG_get_clock());
33   MSG_clean();
34   if (res == MSG_OK)
35     return 0;
36   else
37     return 1;
38 }