Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tiny small cleanup of a messssy code
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 11 Jun 2015 18:02:46 +0000 (20:02 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 11 Jun 2015 18:02:46 +0000 (20:02 +0200)
include/simgrid/simix.h
src/simix/smx_host.c
src/surf/workstation_interface.hpp

index 6eb6aaa..c16e39d 100644 (file)
@@ -264,7 +264,7 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host,
 XBT_PUBLIC(smx_host_t) SIMIX_host_get_by_name(const char *name);
 XBT_PUBLIC(smx_host_t) SIMIX_host_self(void);
 XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
-XBT_PUBLIC(const char*) SIMIX_host_get_name(smx_host_t host); /* FIXME: make private: only the name of SIMIX_host_self() should be public without request */
+#define SIMIX_host_get_name(h) sg_host_name(h)  /* DEPRECATED: SIMIX_host_get_name */
 XBT_PUBLIC(void) SIMIX_host_on(smx_host_t host);
 XBT_PUBLIC(void) SIMIX_host_off(smx_host_t host, smx_process_t issuer);
 XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
index c11c704..4d4818e 100644 (file)
@@ -177,31 +177,19 @@ const char* SIMIX_host_self_get_name(void)
   return SIMIX_host_get_name(host);
 }
 
-const char* SIMIX_host_get_name(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters");
-
-  return sg_host_name(host);
-}
-
 xbt_dict_t SIMIX_host_get_properties(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
   return surf_resource_get_properties(surf_workstation_resource_priv(host));
 }
 
 double SIMIX_host_get_speed(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
   return surf_workstation_get_speed(host, 1.0);
 }
 
 int SIMIX_host_get_core(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
   return surf_workstation_get_core(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;
@@ -209,32 +197,23 @@ xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
 
 
 double SIMIX_host_get_available_speed(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
   return surf_workstation_get_available_speed(host);
 }
 
 double SIMIX_host_get_current_power_peak(smx_host_t host) {
-         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
          return surf_workstation_get_current_power_peak(host);
 }
 
 double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index) {
-         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
          return surf_workstation_get_power_peak_at(host, pstate_index);
 }
 
 int SIMIX_host_get_nb_pstates(smx_host_t host) {
-         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
          return surf_workstation_get_nb_pstates(host);
 }
 
 
 void SIMIX_host_set_pstate(smx_host_t host, int pstate_index) {
-         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
          surf_workstation_set_pstate(host, pstate_index);
 }
 int SIMIX_host_get_pstate(smx_host_t host) {
@@ -242,7 +221,6 @@ int SIMIX_host_get_pstate(smx_host_t host) {
 }
 
 double SIMIX_host_get_consumed_energy(smx_host_t host) {
-         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
          return surf_workstation_get_consumed_energy(host);
 }
 double SIMIX_host_get_wattmin_at(smx_host_t host,int pstate) {
@@ -253,8 +231,6 @@ double SIMIX_host_get_wattmax_at(smx_host_t host,int pstate) {
 }
 
 int SIMIX_host_get_state(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
   return surf_resource_get_state(surf_workstation_resource_priv(host));
 }
 
index eb6c8dc..63943e4 100644 (file)
@@ -137,7 +137,7 @@ public:
 class Workstation : public Resource {
 public:
   /**
-   * @brief Workstation consrtuctor
+   * @brief Workstation constructor
    */
   Workstation();