Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more legacy MSG for processes/actors
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 23 Mar 2018 10:25:27 +0000 (11:25 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 23 Mar 2018 12:43:45 +0000 (13:43 +0100)
include/simgrid/actor.h
include/simgrid/msg.h
src/msg/msg_legacy.cpp
src/msg/msg_process.cpp
src/s4u/s4u_actor.cpp

index 23816c1..0cdb36f 100644 (file)
@@ -35,7 +35,9 @@ XBT_PUBLIC int sg_actor_is_suspended(sg_actor_t actor);
 XBT_PUBLIC sg_actor_t sg_actor_restart(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_daemonize(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_migrate(sg_actor_t process, sg_host_t host);
-
+XBT_PUBLIC void sg_actor_join(sg_actor_t actor, double timeout);
+XBT_PUBLIC void sg_actor_kill(sg_actor_t actor);
+XBT_PUBLIC void sg_actor_set_kill_time(sg_actor_t actor, double kill_time);
 SG_END_DECL()
 
 #endif /* INCLUDE_SIMGRID_ACTOR_H_ */
index 31ed124..0a3339e 100644 (file)
@@ -135,6 +135,9 @@ XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process);
 XBT_PUBLIC void MSG_process_restart(msg_process_t process);
 XBT_PUBLIC void MSG_process_daemonize(msg_process_t process);
 XBT_PUBLIC void MSG_process_migrate(msg_process_t process, msg_host_t host);
+XBT_PUBLIC void MSG_process_join(msg_process_t process, double timeout);
+XBT_PUBLIC void MSG_process_kill(msg_process_t process);
+XBT_PUBLIC void MSG_process_set_kill_time(msg_process_t process, double kill_time);
 
 /* ******************************** File ************************************ */
 typedef sg_file_t msg_file_t;
@@ -232,7 +235,6 @@ XBT_PUBLIC msg_process_t MSG_process_create_with_environment(const char* name, x
 XBT_PUBLIC msg_process_t MSG_process_attach(const char* name, void* data, msg_host_t host, xbt_dict_t properties);
 XBT_PUBLIC void MSG_process_detach();
 
-XBT_PUBLIC void MSG_process_kill(msg_process_t process);
 XBT_PUBLIC int MSG_process_killall();
 XBT_PUBLIC void MSG_process_yield();
 
@@ -245,8 +247,6 @@ XBT_PUBLIC msg_process_t MSG_process_self();
 XBT_PUBLIC xbt_dynar_t MSG_processes_as_dynar();
 XBT_PUBLIC int MSG_process_get_number();
 
-XBT_PUBLIC msg_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time);
-
 XBT_PUBLIC void* MSG_process_get_data(msg_process_t process);
 XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
 
@@ -276,7 +276,6 @@ XBT_PUBLIC msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, d
 XBT_PUBLIC void MSG_task_set_priority(msg_task_t task, double priority);
 XBT_PUBLIC void MSG_task_set_bound(msg_task_t task, double bound);
 
-XBT_PUBLIC msg_error_t MSG_process_join(msg_process_t process, double timeout);
 XBT_PUBLIC msg_error_t MSG_process_sleep(double nb_sec);
 
 XBT_PUBLIC void MSG_task_set_flops_amount(msg_task_t task, double flops_amount);
index 0f4e828..03d6773 100644 (file)
@@ -58,6 +58,14 @@ void MSG_process_migrate(sg_actor_t actor, sg_host_t host)
 {
   sg_actor_migrate(actor, host);
 }
+void MSG_process_join(sg_actor_t actor, double timeout)
+{
+  sg_actor_join(actor, timeout);
+}
+void MSG_process_kill(sg_actor_t actor)
+{
+  sg_actor_kill(actor);
+}
 
 /* ************************** NetZones *************************** */
 sg_netzone_t MSG_zone_get_root()
index 18cb6bc..cf0886d 100644 (file)
@@ -199,27 +199,6 @@ void MSG_process_detach()
   SIMIX_process_detach();
 }
 
-/** \ingroup m_process_management
- * \param process poor victim
- *
- * This function simply kills a \a process... scary isn't it ? :)
- */
-void MSG_process_kill(msg_process_t process)
-{
-  process->kill();
-}
-
-/**
-* \brief Wait for the completion of a #msg_process_t.
-*
-* \param process the process to wait for
-* \param timeout wait until the process is over, or the timeout occurs
-*/
-msg_error_t MSG_process_join(msg_process_t process, double timeout){
-  process->join(timeout);
-  return MSG_OK;
-}
-
 /** Yield the current actor; let the other actors execute first */
 void MSG_process_yield()
 {
@@ -295,19 +274,6 @@ int MSG_process_get_number()
   return SIMIX_process_count();
 }
 
-/** \ingroup m_process_management
- * \brief Set the kill time of a process.
- *
- * \param process a process
- * \param kill_time the time when the process is killed.
- */
-msg_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time)
-{
-  process->setKillTime(kill_time);
-  return MSG_OK;
-}
-
-
 /** \ingroup m_process_management
  * \brief Return the PID of the current process.
  *
index e8b3fdf..905532e 100644 (file)
@@ -396,6 +396,7 @@ void migrate(Host* new_host)
 {
   SIMIX_process_self()->iface()->migrate(new_host);
 }
+
 } // namespace this_actor
 } // namespace s4u
 } // namespace simgrid
@@ -519,7 +520,7 @@ void sg_actor_daemonize(sg_actor_t actor)
   actor->daemonize();
 }
 
-/** \ingroup m_process_management
+/** \ingroup m_actor_management
  * \brief Migrates an actor to another location.
  *
  * This function changes the value of the #sg_host_t on  which \a actor is running.
@@ -529,4 +530,31 @@ void sg_actor_migrate(sg_actor_t process, sg_host_t host)
   process->migrate(host);
 }
 
+/** \ingroup m_actor_management
+* \brief Wait for the completion of a #sg_actor_t.
+*
+* \param actor the actor to wait for
+* \param timeout wait until the actor is over, or the timeout expires
+*/
+void sg_actor_join(sg_actor_t actor, double timeout)
+{
+  actor->join(timeout);
+}
+
+void sg_actor_kill(sg_actor_t actor)
+{
+  actor->kill();
+}
+
+/** \ingroup m_actor_management
+ * \brief Set the kill time of an actor.
+ *
+ * \param actor an actor
+ * \param kill_time the time when the actor is killed.
+ */
+void sg_actor_set_kill_time(sg_actor_t actor, double kill_time)
+{
+  actor->setKillTime(kill_time);
+}
+
 SG_END_DECL()