Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Group simcall_process_create()
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 16 Jun 2016 08:57:39 +0000 (10:57 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 16 Jun 2016 08:58:30 +0000 (10:58 +0200)
src/simix/libsmx.cpp
src/simix/smx_process.cpp

index 8e07b0c..e731708 100644 (file)
@@ -351,44 +351,6 @@ void simcall_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t d
     SIMIX_vm_migratefrom_resumeto, vm, src_pm, dst_pm));
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Creates and runs a new SIMIX process.
- *
- * The structure and the corresponding thread are created and put in the list of ready processes.
- *
- * \param name a name for the process. It is for user-level information and can be nullptr.
- * \param code the main function of the process
- * \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can be nullptr.
- * It can be retrieved with the function \ref simcall_process_get_data.
- * \param hostname name of the host where the new agent is executed.
- * \param kill_time time when the process is killed
- * \param argc first argument passed to \a code
- * \param argv second argument passed to \a code
- * \param properties the properties of the process
- * \param auto_restart either it is autorestarting or not.
- */
-smx_process_t simcall_process_create(const char *name,
-                              xbt_main_func_t code,
-                              void *data,
-                              const char *hostname,
-                              double kill_time,
-                              int argc, char **argv,
-                              xbt_dict_t properties,
-                              int auto_restart)
-{
-  if (name == nullptr)
-    name = "";
-  auto wrapped_code = simgrid::xbt::wrapMain(code, argc, argv);
-  for (int i = 0; i != argc; ++i)
-    xbt_free(argv[i]);
-  xbt_free(argv);
-  smx_process_t res = simcall_process_create(name,
-    std::move(wrapped_code),
-    data, hostname, kill_time, properties, auto_restart);
-  return res;
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Kills a SIMIX process.
index bcd0600..d7654ef 100644 (file)
@@ -6,6 +6,8 @@
 
 #include <boost/range/algorithm.hpp>
 
+#include <xbt/functional.hpp>
+
 #include "src/surf/surf_interface.hpp"
 #include "smx_private.h"
 #include "xbt/sysdep.h"
@@ -993,6 +995,44 @@ void SIMIX_segment_index_set(smx_process_t proc, int index){
   proc->segment_index = index;
 }
 
+/**
+ * \ingroup simix_process_management
+ * \brief Creates and runs a new SIMIX process.
+ *
+ * The structure and the corresponding thread are created and put in the list of ready processes.
+ *
+ * \param name a name for the process. It is for user-level information and can be nullptr.
+ * \param code the main function of the process
+ * \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can be nullptr.
+ * It can be retrieved with the function \ref simcall_process_get_data.
+ * \param hostname name of the host where the new agent is executed.
+ * \param kill_time time when the process is killed
+ * \param argc first argument passed to \a code
+ * \param argv second argument passed to \a code
+ * \param properties the properties of the process
+ * \param auto_restart either it is autorestarting or not.
+ */
+smx_process_t simcall_process_create(const char *name,
+                              xbt_main_func_t code,
+                              void *data,
+                              const char *hostname,
+                              double kill_time,
+                              int argc, char **argv,
+                              xbt_dict_t properties,
+                              int auto_restart)
+{
+  if (name == nullptr)
+    name = "";
+  auto wrapped_code = simgrid::xbt::wrapMain(code, argc, argv);
+  for (int i = 0; i != argc; ++i)
+    xbt_free(argv[i]);
+  xbt_free(argv);
+  smx_process_t res = simcall_process_create(name,
+    std::move(wrapped_code),
+    data, hostname, kill_time, properties, auto_restart);
+  return res;
+}
+
 smx_process_t simcall_process_create(
   const char *name, std::function<void()> code, void *data,
   const char *hostname, double kill_time,
@@ -1007,4 +1047,4 @@ smx_process_t simcall_process_create(
           kill_time, properties, auto_restart,
           self);
   });
-}
\ No newline at end of file
+}