Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'dev-mailbox-clear' into 'master'
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 29 Mar 2022 17:55:41 +0000 (17:55 +0000)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 29 Mar 2022 17:55:41 +0000 (17:55 +0000)
Expose MailboxImpl::clear() to improve handling of node faults

See merge request simgrid/simgrid!89

include/simgrid/s4u/Mailbox.hpp
src/s4u/s4u_Mailbox.cpp

index fe9f875..d48166d 100644 (file)
@@ -124,6 +124,9 @@ public:
   /** Blocking data reception with timeout */
   template <typename T> T* get(double timeout);
   template <typename T> std::unique_ptr<T> get_unique(double timeout) { return std::unique_ptr<T>(get<T>(timeout)); }
+
+  void clear();
+  
 };
 
 template <typename T> CommPtr Mailbox::get_async(T** data)
index a0c99e5..cd8da0d 100644 (file)
@@ -134,6 +134,11 @@ Mailbox::iprobe(int type, const std::function<bool(void*, void*, kernel::activit
   return kernel::actor::simcall_answered(
       [this, type, &match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
 }
+
+void Mailbox::clear() {
+    kernel::actor::simcall_answered([this]() { this->pimpl_->clear(); });
+}
+
 } // namespace s4u
 } // namespace simgrid