+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <string>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
-XBT_PRIVATE xbt_dynar_t mount_list = nullptr;
+XBT_PRIVATE std::vector<s_mount_t> mount_list;
namespace simgrid {
namespace surf {
routing_get_current()->createHost(args->id, &args->speed_per_pstate, args->core_amount, &props);
host->pimpl_->storage_ = mount_list;
- xbt_lib_set(storage_lib, args->id, ROUTING_STORAGE_HOST_LEVEL, static_cast<void*>(mount_list));
- mount_list = nullptr;
+ mount_list.clear();
/* Change from the defaults */
if (args->state_trace)
xbt_dict_foreach(cluster->properties,cursor,key,data) {
xbt_dict_set(host.properties, key, xbt_strdup(data), nullptr);
}
+ xbt_dict_free(&cluster->properties);
}
host.speed_per_pstate = cluster->speeds;
(void *) stype);
}
-static void mount_free(void *p)
-{
- mount_t mnt = (mount_t) p;
- xbt_free(mnt->name);
-}
-
void sg_platf_new_mount(sg_platf_mount_cbarg_t mount){
xbt_assert(xbt_lib_get_or_null(storage_lib, mount->storageId, ROUTING_STORAGE_LEVEL),
"Cannot mount non-existent disk \"%s\"", mount->storageId);
mnt.storage = surf_storage_resource_priv(surf_storage_resource_by_name(mount->storageId));
mnt.name = xbt_strdup(mount->name);
- if(!mount_list){
- XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
- mount_list = xbt_dynar_new(sizeof(s_mount_t), mount_free);
- }
- xbt_dynar_push(mount_list, &mnt);
+ if (mount_list.empty())
+ XBT_DEBUG("Create a Mount list for %s", A_surfxml_host_id);
+ mount_list.push_back(mnt);
}
void sg_platf_new_route(sg_platf_route_cbarg_t route)
if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::recursive;
/* add to the sons dictionary */
- xbt_dict_set(current_routing->children(), AS->id, (void *) new_as, nullptr);
+ current_routing->children()->push_back(static_cast<simgrid::s4u::NetZone*>(new_as));
}
/* set the new current component of the tree */