Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New: s4u::Host.execute() for remote executions
[simgrid.git] / src / s4u / s4u_host.cpp
index 2bb3ab1..763fe98 100644 (file)
@@ -255,5 +255,14 @@ std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()
   return *mounts;
 }
 
+void Host::execute(double flops)
+{
+  Host* host_list[1]   = {this};
+  double flops_list[1] = {flops};
+  smx_activity_t s     = simcall_execution_parallel_start(nullptr /*name*/, 1, host_list, flops_list,
+                                                      nullptr /*comm_sizes */, -1.0, -1 /*timeout*/);
+  simcall_execution_wait(s);
+}
+
 } // namespace simgrid
 } // namespace s4u