Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove host data and had JAVA_HOST_LEVEL
authorPaul Bédaride <paul.bedaride@gmail.com>
Thu, 13 Feb 2014 10:07:54 +0000 (11:07 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Thu, 13 Feb 2014 13:22:23 +0000 (14:22 +0100)
22 files changed:
examples/msg/bittorrent/bittorrent.c
examples/msg/bittorrent/tracker.c
include/msg/msg.h
include/simgrid/simix.h
src/bindings/java/jmsg.c
src/bindings/java/jmsg.h
src/bindings/java/jmsg_as.c
src/bindings/java/jmsg_host.c
src/bindings/java/jmsg_task.c
src/bindings/java/jmsg_vm.c
src/msg/msg_host.c
src/simix/simcalls.in
src/simix/simcalls_generated_args_getter_setter.h
src/simix/simcalls_generated_body.c
src/simix/simcalls_generated_case.c
src/simix/simcalls_generated_enum.h
src/simix/simcalls_generated_res_getter_setter.h
src/simix/simcalls_generated_string.c
src/simix/smx_host.c
src/simix/smx_host_private.h
src/simix/smx_user.c
src/surf/surf_interface.cpp

index 863a2b6..0ad4781 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
     RngStream stream;
     snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host));
     stream = RngStream_CreateStream(descr);
-    MSG_host_set_data(host, stream);
+    MSG_host_set_property_value(host, "stream", (char*)stream, NULL);
   }
 
   MSG_function_register("tracker", tracker);
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
   MSG_main();
 
   xbt_dynar_foreach(host_list, i, host) {
-    RngStream stream = MSG_host_get_data(host);
+    RngStream stream = (RngStream) MSG_host_get_property_value(host, "stream");
     RngStream_DeleteStream(&stream);
   }
   xbt_dynar_free(&host_list);
index e60ef77..631a456 100644 (file)
@@ -20,8 +20,7 @@ int tracker(int argc, char *argv[])
 {
   int i;
 
-  RngStream stream = MSG_host_get_data(MSG_host_self());
-
+  RngStream stream = (RngStream) MSG_host_get_property_value(MSG_host_self(), "stream");
   //Checking arguments
   xbt_assert(argc == 2, "Wrong number of arguments for the tracker.");
   //Retrieving end time
index 9845b3e..2c30c65 100644 (file)
@@ -116,14 +116,11 @@ XBT_PUBLIC(xbt_dict_t) MSG_as_router_get_properties(const char* asr);
 XBT_PUBLIC(void) MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn);
 
 /************************** Host handling ***********************************/
-XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data);
-XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
 XBT_PUBLIC(const char *) MSG_host_get_name(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_on(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_off(msg_host_t host);
 XBT_PUBLIC(msg_host_t) MSG_host_self(void);
 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);
index a50748b..938535a 100644 (file)
@@ -263,8 +263,6 @@ 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);
 XBT_PUBLIC(void*) SIMIX_host_self_get_data(void);
-XBT_PUBLIC(void*) SIMIX_host_get_data(smx_host_t host);
-XBT_PUBLIC(void) SIMIX_host_set_data(smx_host_t host, void *data);
 XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_storage_list(smx_host_t host);
 /********************************* Process ************************************/
 XBT_PUBLIC(int) SIMIX_process_count(void);
index b3ec27c..bfc4115 100644 (file)
@@ -33,6 +33,8 @@
 #endif
 /* end of eclipse-mandated pimple */
 
+int JAVA_HOST_LEVEL;
+
 static int create_jprocess(int argc, char *argv[]);
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
@@ -79,6 +81,10 @@ Java_org_simgrid_msg_Msg_getClock(JNIEnv * env, jclass cls)
   return (jdouble) MSG_get_clock();
 }
 
+static void __JAVA_host_priv_free(void *host)
+{
+}
+
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
 {
@@ -123,6 +129,8 @@ Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
 
   MSG_init(&argc, argv);
 
+  JAVA_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __JAVA_host_priv_free);
+
   for (index = 0; index < argc; index++)
     free(argv[index]);
 
@@ -155,7 +163,7 @@ JNIEXPORT void JNICALL
   /* Cleanup java hosts */
   hosts = MSG_hosts_as_dynar();
   for (index = 0; index < xbt_dynar_length(hosts) - 1; index++) {
-    jhost = (jobject) MSG_host_get_data(xbt_dynar_get_as(hosts,index,msg_host_t));
+    jhost = (jobject) xbt_lib_get_level(xbt_dynar_get_as(hosts,index,msg_host_t), JAVA_HOST_LEVEL);
     if (jhost)
       jhost_unref(env, jhost);
 
index 2cf3f71..c6c8625 100644 (file)
@@ -11,6 +11,9 @@
 #include <msg/msg.h>
 #include <jni.h>
 
+extern int JAVA_HOST_LEVEL;
+extern xbt_lib_t host_lib;
+
 JavaVM *get_java_VM(void);
 JNIEnv *get_current_thread_env(void);
 /**
index 59a9698..a3daec6 100644 (file)
@@ -158,7 +158,7 @@ Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jobject jas)
 
     host = xbt_dynar_get_as(table,index,msg_host_t);
 
-    jhost = (jobject) (MSG_host_get_data(host));
+    jhost = (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL);
     if (!jhost) {
       jname = (*env)->NewStringUTF(env, MSG_host_get_name(host));
 
index 9b8181b..81ed7f7 100644 (file)
@@ -18,7 +18,6 @@ static jmethodID jhost_method_Host_constructor;
 static jfieldID jhost_field_Host_bind;
 static jfieldID jhost_field_Host_name;
 
-
 jobject jhost_new_instance(JNIEnv * env) {
   jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host");
   return (*env)->NewObject(env, cls, jhost_method_Host_constructor);
@@ -85,7 +84,7 @@ Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jclass cls,
   }
   (*env)->ReleaseStringUTFChars(env, jname, name);
 
-  if (!MSG_host_get_data(host)) {       /* native host not associated yet with java host */
+  if (!xbt_lib_get_level(host, JAVA_HOST_LEVEL)) {       /* native host not associated yet with java host */
 
     /* Instantiate a new java host */
     jhost = jhost_new_instance(env);
@@ -110,11 +109,11 @@ Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jclass cls,
     /* the native host data field is set with the global reference to the
      * java host returned by this function
      */
-    MSG_host_set_data(host, (void *) jhost);
+    xbt_lib_set(host_lib, host->key, JAVA_HOST_LEVEL, (void *) jhost);
   }
 
   /* return the global reference to the java host instance */
-  return (jobject) MSG_host_get_data(host);
+  return (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL);
 }
 
 JNIEXPORT jobject JNICALL
@@ -123,7 +122,7 @@ Java_org_simgrid_msg_Host_currentHost(JNIEnv * env, jclass cls) {
 
   msg_host_t host = MSG_host_self();
 
-  if (!MSG_host_get_data(host)) {
+  if (!xbt_lib_get_level(host, JAVA_HOST_LEVEL)) {
     /* the native host not yet associated with the java host instance */
 
     /* instanciate a new java host instance */
@@ -147,9 +146,9 @@ Java_org_simgrid_msg_Host_currentHost(JNIEnv * env, jclass cls) {
     (*env)->SetObjectField(env, jhost, jhost_field_Host_name, jname);
     /* Bind & store it */
     jhost_bind(jhost, host, env);
-    MSG_host_set_data(host, (void *) jhost);
+    xbt_lib_set(host_lib, host->key, JAVA_HOST_LEVEL, (void *) jhost);
   } else {
-    jhost = (jobject) MSG_host_get_data(host);
+    jhost = (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL);
   }
 
   return jhost;
@@ -291,7 +290,7 @@ Java_org_simgrid_msg_Host_all(JNIEnv * env, jclass cls_arg)
 
   for (index = 0; index < count; index++) {
     host = xbt_dynar_get_as(table,index,msg_host_t);
-    jhost = (jobject) (MSG_host_get_data(host));
+    jhost = (jobject) (xbt_lib_get_level(host, JAVA_HOST_LEVEL));
 
     if (!jhost) {
       jname = (*env)->NewStringUTF(env, MSG_host_get_name(host));
index ba640e4..77aa315 100644 (file)
@@ -285,12 +285,12 @@ Java_org_simgrid_msg_Task_getSource(JNIEnv * env,
   if (host == NULL) {
        return NULL;
   }
-  if (!MSG_host_get_data(host)) {
+  if (!xbt_lib_get_level(host, JAVA_HOST_LEVEL)) {
     jxbt_throw_jni(env, "MSG_task_get_source() failed");
     return NULL;
   }
 
-  return (jobject) MSG_host_get_data(host);
+  return (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL);
 }
 
 JNIEXPORT jdouble JNICALL
index 722c4b5..475cc91 100644 (file)
@@ -6,6 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "jmsg.h"
 #include "jmsg_vm.h"
 #include "jmsg_host.h"
 #include "jmsg_process.h"
@@ -157,7 +158,7 @@ Java_org_simgrid_msg_VM_get_pm(JNIEnv *env, jobject jvm) {
   msg_vm_t vm = jvm_get_native(env,jvm);
   msg_host_t host = MSG_vm_get_pm(vm);
 
-  if (!MSG_host_get_data(host)) {
+  if (!xbt_lib_get_level(host, JAVA_HOST_LEVEL)) {
     /* the native host not yet associated with the java host instance */
 
     /* instanciate a new java host instance */
@@ -183,7 +184,7 @@ Java_org_simgrid_msg_VM_get_pm(JNIEnv *env, jobject jvm) {
     jhost_bind(jhost, host, env);
     MSG_host_set_data(host, (void *) jhost);
   } else {
-    jhost = (jobject) MSG_host_get_data(host);
+    jhost = (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL);
   }
 
   return jhost;
index 670f820..627b1e6 100644 (file)
@@ -72,32 +72,6 @@ msg_host_t MSG_get_host_by_name(const char *name)
   return (msg_host_t) xbt_lib_get_elm_or_null(host_lib,name);
 }
 
-/** \ingroup m_host_management
- *
- * \brief Set the user data of a #msg_host_t.
- *
- * This functions checks whether some data has already been associated to \a host 
-   or not and attach \a data to \a host if it is possible.
- */
-msg_error_t MSG_host_set_data(msg_host_t host, void *data)
-{
-  SIMIX_host_set_data(host,data);
-
-  return MSG_OK;
-}
-
-/** \ingroup m_host_management
- *
- * \brief Return the user data of a #msg_host_t.
- *
- * This functions checks whether \a host is a valid pointer or not and return
-   the user data associated to \a host if it is possible.
- */
-void *MSG_host_get_data(msg_host_t host)
-{
-  return SIMIX_host_get_data(host);
-}
-
 /** \ingroup m_host_management
  *
  * \brief Return the name of the #msg_host_t.
index f34823e..29a13f5 100644 (file)
@@ -15,8 +15,6 @@ host_get_process_list True (void*, xbt_swag_t) (host, void*, smx_host_t)
 host_get_speed True (double) (host, void*, smx_host_t)
 host_get_available_speed True (double) (host, void*, smx_host_t)
 host_get_state True (int) (host, void*, smx_host_t)
-host_get_data True (void*) (host, void*, smx_host_t)
-host_set_data True (void) (host, void*, smx_host_t) (data, void*)
 host_get_current_power_peak True (double) (host, void*, smx_host_t)
 host_get_power_peak_at True (double) (host, void*, smx_host_t) (pstate_index, int)
 host_get_nb_pstates True (int) (host, void*, smx_host_t)
index 48a1241..4aa9855 100644 (file)
@@ -65,24 +65,6 @@ static inline smx_host_t simcall_host_get_state__get__host(smx_simcall_t simcall
 static inline void simcall_host_get_state__set__host(smx_simcall_t simcall, void* arg){
     simcall->args[0].dp = arg;
 }
-static inline smx_host_t simcall_host_get_data__get__host(smx_simcall_t simcall){
-  return (smx_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_get_data__set__host(smx_simcall_t simcall, void* arg){
-    simcall->args[0].dp = arg;
-}
-static inline smx_host_t simcall_host_set_data__get__host(smx_simcall_t simcall){
-  return (smx_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_set_data__set__host(smx_simcall_t simcall, void* arg){
-    simcall->args[0].dp = arg;
-}
-static inline void* simcall_host_set_data__get__data(smx_simcall_t simcall){
-  return  simcall->args[1].dp;
-}
-static inline void simcall_host_set_data__set__data(smx_simcall_t simcall, void* arg){
-    simcall->args[1].dp = arg;
-}
 static inline smx_host_t simcall_host_get_current_power_peak__get__host(smx_simcall_t simcall){
   return (smx_host_t) simcall->args[0].dp;
 }
index 7ad2b3a..f103ad6 100644 (file)
     }    
     return self->simcall.result.i;
   }
-  inline static void* simcall_BODY_host_get_data(smx_host_t host) {
-    smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_HOST_GET_DATA;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) host;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_pre(&self->simcall, 0);
-    }    
-    return self->simcall.result.dp;
-  }
-  inline static void simcall_BODY_host_set_data(smx_host_t host, void* data) {
-    smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_HOST_SET_DATA;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) host;
-    self->simcall.args[1].dp = (void*) data;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_pre(&self->simcall, 0);
-    }    
-    
-  }
   inline static double simcall_BODY_host_get_current_power_peak(smx_host_t host) {
     smx_process_t self = SIMIX_process_self();
     self->simcall.call = SIMCALL_HOST_GET_CURRENT_POWER_PEAK;
index 9e3a364..906cf65 100644 (file)
@@ -55,16 +55,6 @@ case SIMCALL_HOST_GET_STATE:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_HOST_GET_DATA:
-      simcall->result.dp = SIMIX_pre_host_get_data(simcall , (smx_host_t) simcall->args[0].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
-case SIMCALL_HOST_SET_DATA:
-       SIMIX_pre_host_set_data(simcall , (smx_host_t) simcall->args[0].dp,  simcall->args[1].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_HOST_GET_CURRENT_POWER_PEAK:
       simcall->result.d = SIMIX_pre_host_get_current_power_peak(simcall , (smx_host_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
index 06c77a9..9156eca 100644 (file)
@@ -15,8 +15,6 @@ SIMCALL_HOST_GET_PROCESS_LIST,
 SIMCALL_HOST_GET_SPEED,
 SIMCALL_HOST_GET_AVAILABLE_SPEED,
 SIMCALL_HOST_GET_STATE,
-SIMCALL_HOST_GET_DATA,
-SIMCALL_HOST_SET_DATA,
 SIMCALL_HOST_GET_CURRENT_POWER_PEAK,
 SIMCALL_HOST_GET_POWER_PEAK_AT,
 SIMCALL_HOST_GET_NB_PSTATES,
index 0c79e3a..5c6df78 100644 (file)
@@ -57,14 +57,6 @@ static inline int simcall_host_get_state__get__result(smx_simcall_t simcall){
 static inline void simcall_host_get_state__set__result(smx_simcall_t simcall, int result){
     simcall->result.i = result;
 }
-static inline void* simcall_host_get_data__get__result(smx_simcall_t simcall){
-  return  simcall->result.dp;
-}
-static inline void simcall_host_get_data__set__result(smx_simcall_t simcall, void* result){
-    simcall->result.dp = result;
-}
-
-
 static inline double simcall_host_get_current_power_peak__get__result(smx_simcall_t simcall){
   return  simcall->result.d;
 }
index de3896a..461d7fe 100644 (file)
@@ -15,8 +15,6 @@
 [SIMCALL_HOST_GET_SPEED] = "SIMCALL_HOST_GET_SPEED",
 [SIMCALL_HOST_GET_AVAILABLE_SPEED] = "SIMCALL_HOST_GET_AVAILABLE_SPEED",
 [SIMCALL_HOST_GET_STATE] = "SIMCALL_HOST_GET_STATE",
-[SIMCALL_HOST_GET_DATA] = "SIMCALL_HOST_GET_DATA",
-[SIMCALL_HOST_SET_DATA] = "SIMCALL_HOST_SET_DATA",
 [SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
 [SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
 [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
index 2ff44aa..2f88f82 100644 (file)
@@ -28,7 +28,6 @@ smx_host_t SIMIX_host_create(const char *name,
   s_smx_process_t proc;
 
   /* Host structure */
-  smx_host->data = data;
   smx_host->process_list =
       xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
 
@@ -310,30 +309,6 @@ int SIMIX_host_get_state(smx_host_t host){
   return surf_resource_get_state(surf_workstation_resource_priv(host));
 }
 
-void* SIMIX_pre_host_self_get_data(smx_simcall_t simcall){
-  return SIMIX_host_self_get_data();
-}
-void* SIMIX_host_self_get_data(void)
-{
-  smx_host_t self = SIMIX_host_self();
-  return SIMIX_host_get_data(self);
-}
-
-void SIMIX_host_self_set_data(void *data)
-{
-  smx_host_t self = SIMIX_host_self();
-  SIMIX_host_set_data(self, data);
-}
-
-void* SIMIX_pre_host_get_data(smx_simcall_t simcall,smx_host_t host){
-  return SIMIX_host_get_data(host);
-}
-void* SIMIX_host_get_data(smx_host_t host){
-  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
-
-  return SIMIX_host_priv(host)->data;
-}
-
 void _SIMIX_host_free_process_arg(void *data)
 {
   smx_process_arg_t arg = *(void**)data;
@@ -447,16 +422,6 @@ void SIMIX_host_autorestart(smx_host_t host)
     xbt_die("No function for simix_global->autorestart");
 }
 
-void SIMIX_pre_host_set_data(smx_simcall_t simcall, smx_host_t host, void *data) {
-  SIMIX_host_set_data(host, data);
-}
-void SIMIX_host_set_data(smx_host_t host, void *data){
-  xbt_assert((host != NULL), "Invalid parameters");
-  xbt_assert((SIMIX_host_priv(host)->data == NULL), "Data already set");
-
-  SIMIX_host_priv(host)->data = data;
-}
-
 smx_action_t SIMIX_pre_host_execute(smx_simcall_t simcall,const char *name,
     smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask){
   return SIMIX_host_execute(name, host, computation_amount, priority, bound, affinity_mask);
index c3e5d64..677cdde 100644 (file)
@@ -17,7 +17,6 @@ typedef struct s_smx_host_priv {
   xbt_swag_t process_list;
   xbt_dynar_t auto_restart_processes;
   xbt_dynar_t boot_processes; 
-  void *data;              /**< @brief user data */
 } s_smx_host_priv_t;
 
 static inline smx_host_priv_t SIMIX_host_priv(smx_host_t host){
@@ -87,8 +86,6 @@ int SIMIX_pre_host_get_nb_pstates(smx_simcall_t, smx_host_t host);
 void SIMIX_pre_host_set_power_peak_at(smx_simcall_t, smx_host_t host, int pstate_index);
 double SIMIX_pre_host_get_consumed_energy(smx_simcall_t, smx_host_t);
 void* SIMIX_pre_host_self_get_data(smx_simcall_t);
-void* SIMIX_pre_host_get_data(smx_simcall_t, smx_host_t);
-void SIMIX_pre_host_set_data(smx_simcall_t, smx_host_t, void*);
 smx_action_t SIMIX_pre_host_execute(smx_simcall_t, const char*, smx_host_t, double, double, double, unsigned long);
 smx_action_t SIMIX_pre_host_parallel_execute(smx_simcall_t, const char*, int, smx_host_t*,
                                              double*, double*, double, double);
index 5e1d9d8..63d8f4a 100644 (file)
@@ -154,31 +154,6 @@ int simcall_host_get_state(smx_host_t host)
   return simcall_BODY_host_get_state(host);
 }
 
-/**
- * \ingroup simix_host_management
- * \brief Returns the user data associated to a host.
- *
- * \param host SIMIX host
- * \return the user data of this host
- */
-void* simcall_host_get_data(smx_host_t host)
-{
-  return simcall_BODY_host_get_data(host);
-}
-
-/**
- * \ingroup simix_host_management
- * \brief Sets the user data associated to a host.
- *
- * The host must not have previous user data associated to it.
- * \param host A SIMIX host
- * \param data The user data to set
- */
-void simcall_host_set_data(smx_host_t host, void *data)
-{
-  simcall_host_set_data(host, data);
-}
-
 /**
  * \ingroup simix_host_management
  * \brief Returns the power peak of a host.
index 4378973..b59b7b0 100644 (file)
@@ -724,6 +724,8 @@ const char *Resource::getName() {
 }
 
 xbt_dict_t Resource::getProperties() {
+  if (p_properties==NULL)
+       p_properties = xbt_dict_new();
   return p_properties;
 }