Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
implement sg_platf_new_disk
[simgrid.git] / src / surf / sg_platf.cpp
index 3e41181..2e211f7 100644 (file)
@@ -19,6 +19,7 @@
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
@@ -167,6 +168,9 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
   sg_platf_new_Zone_begin(&zone);
   simgrid::kernel::routing::ClusterZone* current_as = static_cast<ClusterZone*>(routing_get_current());
   current_as->parse_specific_arguments(cluster);
+  if (cluster->properties != nullptr)
+    for (auto const& elm : *cluster->properties)
+      current_as->get_iface()->set_property(elm.first, elm.second);
 
   if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
     current_as->num_links_per_node_++;
@@ -328,6 +332,16 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet
   delete cabinet->radicals;
 }
 
+void sg_platf_new_disk(simgrid::kernel::routing::DiskCreationArgs* disk)
+{
+  auto s = surf_disk_model->createDisk(disk->id, disk->read_bw, disk->write_bw);
+
+  if (disk->properties) {
+    s->set_properties(*disk->properties);
+    delete disk->properties;
+  }
+}
+
 void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage)
 {
   xbt_assert(std::find(known_storages.begin(), known_storages.end(), storage->id) == known_storages.end(),