Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
427a891407ef856a8972a17161afc335920ae2a1
[simgrid.git] / examples / msg / tracing / trace_platform.c
1 /* Copyright (c) 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 /** @addtogroup MSG_examples
8  * 
9  * - <b>tracing/trace_platform.c</b>: This program demonstrates how a
10  * platform file is traced to a Paje trace file format using the tracing
11  * mechanism of Simgrid.
12  * You might want to run this program with the following parameters:
13  * --cfg=tracing:1
14  * --cfg=tracing/categorized:1
15  * (See \ref tracing_tracing_options for details)
16  */
17
18 #include <stdio.h>
19 #include "msg/msg.h"
20 #include "xbt/sysdep.h"         /* calloc, printf */
21
22 #include "xbt/log.h"
23 #include "xbt/asserts.h"
24 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
25
26 /** Main function */
27 int main(int argc, char *argv[])
28 {
29   MSG_init(&argc, argv);
30   if (argc < 2) {
31     printf("Usage: %s platform_file\n", argv[0]);
32     exit(1);
33   }
34
35   char *platform_file = argv[1];
36   MSG_create_environment(platform_file);
37   MSG_main();
38   return 0;
39 }