Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add MSG_host_get_process_list() function.
authorsuter <frederic.suter@cc.in2p3.fr>
Wed, 3 Jul 2013 13:45:23 +0000 (15:45 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Wed, 3 Jul 2013 13:45:41 +0000 (15:45 +0200)
ChangeLog
include/msg/msg.h
include/simgrid/simix.h
src/msg/msg_host.c
src/simix/smx_host.c
src/simix/smx_host_private.h
src/simix/smx_smurf_private.h
src/simix/smx_user.c

index a47f3a3..98b7afe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@ SimGrid (3.10) NOT RELEASED; urgency=low
  * Dramatically change the way files are handled. API and internals changed, but
    this part of MSG was not considered as production grade either.
  * Add explicit synchronization facilities through semaphores
+ * Add a new function MSG_host_get_process_list()
 
  SMPI:
  * SMPI is now included directly in the libsimgrid as the windows
index 7b4748d..d96ac02 100644 (file)
@@ -101,6 +101,7 @@ XBT_PUBLIC(int) MSG_get_host_msgload(msg_host_t host);
 /* int MSG_get_msgload(void); This function lacks specification; discard it */
 XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
+XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h);
 XBT_PUBLIC(void) __MSG_host_destroy(msg_host_priv_t host);
 
index 26983b7..034b6d4 100644 (file)
@@ -294,6 +294,7 @@ XBT_PUBLIC(smx_host_t) simcall_host_get_by_name(const char *name);
 XBT_PUBLIC(const char *) simcall_host_get_name(smx_host_t host);
 XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(smx_host_t host);
 XBT_PUBLIC(int) simcall_host_get_core(smx_host_t host);
+XBT_PUBLIC(xbt_swag_t) simcall_host_get_process_list(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_speed(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_available_speed(smx_host_t host);
 /* Two possible states, 1 - CPU ON and 0 CPU OFF */
index 5e60908..019f4f5 100644 (file)
@@ -204,7 +204,10 @@ double MSG_get_host_speed(msg_host_t h)
 
 
 /** \ingroup m_host_management
- * \brief Return the number of core.
+ * \brief Return the number of cores.
+ *
+ * \param host a host
+ * \return the number of cores
  */
 int MSG_host_get_core_number(msg_host_t h)
 {
@@ -213,6 +216,20 @@ int MSG_host_get_core_number(msg_host_t h)
   return (simcall_host_get_core(h));
 }
 
+/** \ingroup m_host_management
+ * \brief Return the list of processes attached to an host.
+ *
+ * \param host a host
+ * \return a swag with the attached processes
+ */
+xbt_swag_t MSG_host_get_process_list(msg_host_t h)
+{
+  xbt_assert((h != NULL), "Invalid parameters");
+
+  return (simcall_host_get_process_list(h));
+}
+
+
 /** \ingroup m_host_management
  * \brief Returns the value of a given host property
  *
index 72da17a..70b8fd5 100644 (file)
@@ -158,6 +158,16 @@ int SIMIX_host_get_core(smx_host_t host){
       get_core(host);
 }
 
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_process_list(host);
+}
+
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
+  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+  smx_host_priv_t host_priv = SIMIX_host_priv(host);
+
+  return host_priv->process_list;
+}
 
 
 double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
index adb53b8..089360e 100644 (file)
@@ -39,6 +39,7 @@ void SIMIX_host_restart_processes(smx_host_t host);
 void SIMIX_host_autorestart(smx_host_t host);
 xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
 int SIMIX_host_get_core(smx_host_t host);
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host);
 double SIMIX_host_get_speed(smx_host_t host);
 double SIMIX_host_get_available_speed(smx_host_t host);
 int SIMIX_host_get_state(smx_host_t host);
@@ -61,6 +62,7 @@ const char* SIMIX_pre_host_self_get_name(smx_simcall_t);
 const char* SIMIX_pre_host_get_name(smx_simcall_t, smx_host_t);
 xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_core(smx_simcall_t, smx_host_t);
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t, smx_host_t host);
 double SIMIX_pre_host_get_speed(smx_simcall_t, smx_host_t);
 double SIMIX_pre_host_get_available_speed(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_state(smx_simcall_t, smx_host_t);
index 49063b9..268ed6d 100644 (file)
@@ -263,6 +263,7 @@ ACTION(SIMCALL_HOST_GET_BY_NAME, host_get_by_name, WITH_ANSWER, TSPEC(result, sm
 ACTION(SIMCALL_HOST_GET_NAME, host_get_name, WITH_ANSWER, TSTRING(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_PROPERTIES, host_get_properties, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_CORE, host_get_core, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_GET_PROCESS_LIST, host_get_process_list, WITH_ANSWER, TSPEC(result, xbt_swag_t), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_SPEED, host_get_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_AVAILABLE_SPEED, host_get_available_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_STATE, host_get_state, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
index 611617f..46a2e86 100644 (file)
@@ -94,6 +94,17 @@ int simcall_host_get_core(smx_host_t host)
   return simcall_BODY_host_get_core(host);
 }
 
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the list of processes attached to the host.
+ *
+ * \param host A SIMIX host
+ * \return the swag of attached processes
+ */
+xbt_swag_t simcall_host_get_process_list(smx_host_t host)
+{
+  return simcall_BODY_host_get_process_list(host);
+}
 
 
 /**