Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to add a disk to a host after a load_platform from xml
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 15 Feb 2023 15:51:00 +0000 (16:51 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 15 Feb 2023 15:51:04 +0000 (16:51 +0100)
Fix https://github.com/simgrid/simgrid/issues/383

ChangeLog
src/surf/HostImpl.cpp

index 99a7e6a..89aeda6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,7 +48,8 @@ Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  (FG: issues on Framagit; GH: issues on GitHub)
  - FG#18: Java bindings should be redone or removed
  - FG!118: Wi-Fi callback mechanism
- - FG!119: SMPI: add option to inject a barrier before every collective call, to allow...
+ - FG!119: SMPI: add option to inject a barrier before every collective call
+ - GH#383: Segfault when adding a disk after load_platform(xml)
 
 ----------------------------------------------------------------------------
 
index 8f3925b..f07e935 100644 (file)
@@ -207,6 +207,8 @@ s4u::Disk* HostImpl::create_disk(const std::string& name, double read_bandwidth,
 {
   auto disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth,
                                                                                           write_bandwidth);
+  if (sealed_)
+    disk->seal();
   return disk->set_host(&piface_)->get_iface();
 }