Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function: MSG_parallel_task_execute_with_timeout
[simgrid.git] / src / simix / libsmx.cpp
index 4c4bf39..4686b80 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <xbt/functional.hpp>
 
+#include <simgrid/s4u/VirtualMachine.hpp>
 #include <simgrid/simix/blocking_simcall.hpp>
 
 #include "mc/mc.h"
@@ -96,15 +97,12 @@ smx_activity_t simcall_execution_start(const char *name,
  * amount between each pair of hosts
  * \param amount the SURF action amount
  * \param rate the SURF action rate
+ * \param timeout timeout
  * \return A new SIMIX execution synchronization
  */
-smx_activity_t simcall_execution_parallel_start(const char *name,
-                                         int host_nb,
-                                         sg_host_t *host_list,
-                                         double *flops_amount,
-                                         double *bytes_amount,
-                                         double amount,
-                                         double rate)
+smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
+                                                double* flops_amount, double* bytes_amount, double amount, double rate,
+                                                double timeout)
 {
   int i,j;
   /* checking for infinite values */
@@ -121,11 +119,8 @@ smx_activity_t simcall_execution_parallel_start(const char *name,
   xbt_assert(std::isfinite(amount), "amount is not finite!");
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
-  return simcall_BODY_execution_parallel_start(name, host_nb, host_list,
-                                            flops_amount,
-                                            bytes_amount,
-                                            amount, rate);
-
+  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate,
+                                               timeout);
 }
 
 /**
@@ -180,20 +175,19 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution)
   return (e_smx_state_t) simcall_BODY_execution_wait(execution);
 }
 
-
 /**
  * \ingroup simix_vm_management
  * \brief Create a VM on the given physical host.
  *
  * \param name VM name
- * \param host Physical host
+ * \param dest Physical host on which to create the VM
  *
  * \return The host object of the VM
  */
-sg_host_t simcall_vm_create(const char *name, sg_host_t phys_host)
+sg_host_t simcall_vm_create(const char* name, sg_host_t dest)
 {
-  return simgrid::simix::kernelImmediate([&name, &phys_host] {
-    sg_host_t host = surf_vm_model->createVM(name, phys_host);
+  return simgrid::simix::kernelImmediate([&name, &dest] {
+    sg_host_t host = new simgrid::s4u::VirtualMachine(name, dest);
     host->extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
     return host;