Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Wed, 18 Sep 2013 08:59:20 +0000 (10:59 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Wed, 18 Sep 2013 08:59:20 +0000 (10:59 +0200)
1  2 
src/include/surf/surf.h
src/msg/msg_global.c
src/simdag/sd_workstation.c
src/surf/surf_routing.c

diff --combined src/include/surf/surf.h
@@@ -237,7 -237,6 +237,7 @@@ typedef struct surf_storage_model_exten
    surf_action_t(*write) (void *storage, size_t size, surf_file_t fd);
    surf_action_t(*stat) (void *storage, surf_file_t fd);
    surf_action_t(*ls) (void *storage, const char *path);
 +  xbt_dict_t(*get_properties) (const void *resource);
  } s_surf_model_extension_storage_t;
  
       /** \ingroup SURF_models
@@@ -585,8 -584,6 +585,8 @@@ XBT_PUBLIC(void) surf_storage_model_ini
   */
  XBT_PUBLIC_DATA(s_surf_model_description_t) surf_storage_model_description[];
  
 +XBT_PUBLIC_DATA(surf_model_t) surf_storage_model;
 +
  /** \ingroup SURF_models
   *  \brief The workstation model
   *
@@@ -646,6 -643,16 +646,16 @@@ XBT_PUBLIC_DATA(s_surf_model_descriptio
   */
  XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
  
+ /** \ingroup SURF_simulation
+  *  \brief List of hosts that have juste restarted and whose autorestart process should be restarted.
+  */
+ XBT_PUBLIC_DATA(xbt_dynar_t) host_that_restart;
+ /** \ingroup SURF_simulation
+  *  \brief List of hosts for which one want to be notified if they ever restart.
+  */
+ XBT_PUBLIC(xbt_dict_t) watched_hosts_lib;
  /*******************************************/
  /*** SURF Platform *************************/
  /*******************************************/
@@@ -733,8 -740,6 +743,6 @@@ XBT_PUBLIC(xbt_dict_t) get_as_router_pr
  int surf_get_nthreads(void);
  void surf_set_nthreads(int nthreads);
  
- void surf_watched_hosts(void);
  /*
   * Returns the initial path. On Windows the initial path is
   * the current directory for the current process in the other
diff --combined src/msg/msg_global.c
@@@ -71,9 -71,8 +71,9 @@@ void MSG_init_nocheck(int *argc, char *
  
    XBT_DEBUG("ADD MSG LEVELS");
    MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_destroy);
 +  MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy);
  
-   atexit(MSG_exit);
+   if(sg_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
  }
  
  #ifdef MSG_USE_DEPRECATED
@@@ -37,29 -37,6 +37,29 @@@ SD_workstation_t __SD_workstation_creat
    return xbt_lib_get_elm_or_null(host_lib,name);
  }
  
 +/* Creates a storage and registers it in SD.
 + */
 +SD_storage_t __SD_storage_create(void *surf_storage, void *data)
 +{
 +
 +  SD_storage_priv_t storage;
 +  const char *name;
 +
 +  storage = xbt_new(s_SD_storage_priv_t, 1);
 +  storage->data = data;     /* user data */
 +
 +  name = surf_resource_name(surf_storage);
 +  xbt_lib_set(storage_lib,name, SD_STORAGE_LEVEL, storage);
 +  return xbt_lib_get_elm_or_null(storage_lib, name);
 +}
 +
 +/* Destroys a storage.
 + */
 +void __SD_storage_destroy(void *storage)
 +{
 +  xbt_free(storage);
 +}
 +
  /**
   * \brief Returns a workstation given its name
   *
@@@ -301,7 -278,7 +301,7 @@@ double SD_workstation_get_available_pow
   *
   * \param workstation a workstation
   * \param computation_amount the computation amount you want to evaluate (in flops)
-  * \return an approximative astimated computation time for the given computation amount on this workstation (in seconds)
+  * \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
   */
  double SD_workstation_get_computation_time(SD_workstation_t workstation,
                                             double computation_amount)
@@@ -380,7 -357,7 +380,7 @@@ double SD_route_get_current_bandwidth(S
   * \param src the first workstation
   * \param dst the second workstation
   * \param communication_amount the communication amount you want to evaluate (in bytes)
-  * \return an approximative astimated computation time for the given communication amount
+  * \return an approximative estimated computation time for the given communication amount
   * between the workstations (in seconds)
   */
  double SD_route_get_communication_time(SD_workstation_t src,
diff --combined src/surf/surf_routing.c
@@@ -19,17 -19,12 +19,15 @@@ xbt_lib_t host_lib
  int ROUTING_HOST_LEVEL;         //Routing level
  int SURF_CPU_LEVEL;             //Surf cpu level
  int SURF_WKS_LEVEL;             //Surf workstation level
 -int SIMIX_HOST_LEVEL;           //Simix level
 -int MSG_HOST_LEVEL;             //Msg level
 -int SD_HOST_LEVEL;              //Simdag level
 +int SIMIX_HOST_LEVEL;           //Simix host level
 +int SIMIX_STORAGE_LEVEL;        //Simix storage level
 +int MSG_HOST_LEVEL;             //Msg host level
 +int MSG_STORAGE_LEVEL;          //Msg storage level
 +int SD_HOST_LEVEL;              //Simdag host level
 +int SD_STORAGE_LEVEL;           //Simdag storage level
  int COORD_HOST_LEVEL=0;         //Coordinates level
  int NS3_HOST_LEVEL;             //host node for ns3
  
- xbt_dict_t watched_hosts_lib;
  /**
   * @ingroup SURF_build_api
   * @brief A library containing all known links
@@@ -1006,11 -1001,22 +1004,22 @@@ static void routing_parse_postparse(voi
  static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
  {
    char *host_id = NULL;
-   char *link_id;
+   char *link_id = NULL;
+   char *router_id = NULL;
  
    XBT_DEBUG(" ");
    host_id = HOST_PEER(peer->id);
    link_id = LINK_PEER(peer->id);
+   router_id = ROUTER_PEER(peer->id);
+   XBT_DEBUG("<AS id=\"%s\"\trouting=\"Cluster\">", peer->id);
+   s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER;
+   AS.id = peer->id;
+   AS.routing = A_surfxml_AS_routing_Cluster;
+   sg_platf_new_AS_begin(&AS);
+   current_routing->link_up_down_list
+             = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
  
    XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
    s_sg_platf_host_cbarg_t host;
    host.power_trace = peer->availability_trace;
    host.state_trace = peer->state_trace;
    host.core_amount = 1;
-   host.coord = peer->coord;
    sg_platf_new_host(&host);
  
    s_sg_platf_link_cbarg_t link;
    host_link.link_down= link_down;
    sg_platf_new_host_link(&host_link);
  
+   XBT_DEBUG("<router id=\"%s\"/>", router_id);
+   s_sg_platf_router_cbarg_t router;
+   memset(&router, 0, sizeof(router));
+   router.id = router_id;
+   router.coord = peer->coord;
+   sg_platf_new_router(&router);
+   ((as_cluster_t)current_routing)->router = xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
+   XBT_DEBUG("</AS>");
+   sg_platf_new_AS_end();
    XBT_DEBUG(" ");
  
    //xbt_dynar_free(&tab_elements_num);