Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / examples / simdag / io / sd_io.c
1 /* Copyright (c) 2013-2015. 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 "simgrid/simdag.h"
8 #include "xbt/log.h"
9
10 XBT_LOG_NEW_DEFAULT_CATEGORY(sd_io, "Logging specific to this SimDag example");
11
12 int main(int argc, char **argv)
13 {
14   unsigned int ctr;
15   const sg_host_t *workstations;
16   int total_nworkstations;
17   xbt_dict_t current_storage_list;
18   char *mount_name;
19   char *storage_name;
20   xbt_dict_cursor_t cursor = NULL;
21
22   SD_init(&argc, argv);
23   /* Set the workstation model to default, as storage is not supported by the ptask_L07 model yet. */
24   SD_config("host/model", "default");
25   SD_create_environment(argv[1]);
26   workstations = sg_host_list();
27   total_nworkstations = sg_host_count();
28
29   for (ctr=0; ctr<total_nworkstations;ctr++){
30     current_storage_list = sg_host_get_mounted_storage_list(workstations[ctr]);
31     xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name)
32       XBT_INFO("Workstation '%s' mounts '%s'", sg_host_get_name(workstations[ctr]), mount_name);
33     xbt_dict_free(&current_storage_list);
34   }
35
36   SD_exit();
37   return 0;
38 }