Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix pip package generation
[simgrid.git] / src / s4u / s4u_Exec.cpp
index 918a705..17fa93c 100644 (file)
@@ -53,6 +53,14 @@ Exec* Exec::wait_for(double)
   THROW_UNIMPLEMENTED;
 }
 
+int Exec::wait_any_for(std::vector<ExecPtr>* execs, double timeout)
+{
+  std::unique_ptr<kernel::activity::ExecImpl* []> rexecs(new kernel::activity::ExecImpl*[execs->size()]);
+  std::transform(begin(*execs), end(*execs), rexecs.get(),
+                 [](const ExecPtr& exec) { return static_cast<kernel::activity::ExecImpl*>(exec->pimpl_.get()); });
+  return simcall_execution_waitany_for(rexecs.get(), execs->size(), timeout);
+}
+
 Exec* Exec::cancel()
 {
   simix::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
@@ -130,7 +138,7 @@ Exec* ExecSeq::start()
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_name(name_)
         .set_tracing_category(tracing_category_)
-        .set_priority(1. / priority_)
+        .set_sharing_penalty(1. / priority_)
         .set_bound(bound_)
         .set_flops_amount(flops_amount_)
         .start();
@@ -169,7 +177,7 @@ double ExecSeq::get_remaining()
       [this]() { return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_remaining(); });
 }
 
-/** @brief Returns the ratio of elements that are still to do
+/** @brief Returns the ratio of elements that are still to do
  *
  * The returned value is between 0 (completely done) and 1 (nothing done yet).
  */