Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 11 Mar 2014 12:35:19 +0000 (13:35 +0100)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 11 Mar 2014 12:35:19 +0000 (13:35 +0100)
include/msg/datatypes.h
src/msg/msg_io.c
src/simdag/sd_workstation.c
src/simix/smx_io.c
src/simix/smx_io_private.h

index 7a4bd0f..bd2ced1 100644 (file)
@@ -139,6 +139,7 @@ typedef s_xbt_dictelm_t s_msg_storage_t;
 
 typedef struct msg_storage_priv  {
   const char *host;
+  void *data;
 } s_msg_storage_priv_t, *msg_storage_priv_t;
 
 static inline msg_storage_priv_t MSG_storage_priv(msg_storage_t storage){
index d32b194..b5667c2 100644 (file)
@@ -368,8 +368,8 @@ xbt_dynar_t MSG_storages_as_dynar(void) {
  */
 msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
 {
-  SIMIX_storage_set_data(storage,data);
-
+  msg_storage_priv_t priv = MSG_storage_priv(storage);
+  priv->data = data;
   return MSG_OK;
 }
 
@@ -382,7 +382,9 @@ msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
  */
 void *MSG_storage_get_data(msg_storage_t storage)
 {
-  return SIMIX_storage_get_data(storage);
+  xbt_assert((storage != NULL), "Invalid parameters");
+  msg_storage_priv_t priv = MSG_storage_priv(storage);
+  return priv->data;
 }
 
 /** \ingroup msg_storage_management
index 7474bba..108e640 100644 (file)
@@ -45,8 +45,8 @@ SD_storage_t __SD_storage_create(void *surf_storage, void *data)
 
   storage = xbt_new(s_SD_storage_priv_t, 1);
   storage->data = data;     /* user data */
-  storage->host = surf_storage_get_host(surf_storage);
   name = surf_resource_name(surf_storage);
+  storage->host = surf_storage_get_host(surf_storage_resource_by_name(name));
   xbt_lib_set(storage_lib,name, SD_STORAGE_LEVEL, storage);
   return xbt_lib_get_elm_or_null(storage_lib, name);
 }
index 6833b8a..eee26b2 100644 (file)
@@ -49,26 +49,6 @@ void SIMIX_storage_destroy(void *s)
   free(storage);
 }
 
-void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd){
-  return SIMIX_file_get_data(fd);
-}
-
-void* SIMIX_file_get_data(smx_file_t fd){
-  xbt_assert((fd != NULL), "Invalid parameters (simix file is NULL)");
-
-  return fd->data;
-}
-
-void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data) {
-  SIMIX_file_set_data(fd, data);
-}
-
-void SIMIX_file_set_data(smx_file_t fd, void *data){
-  xbt_assert((fd != NULL), "Invalid parameter");
-
-  fd->data = data;
-}
-
 //SIMIX FILE READ
 void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size)
 {
@@ -361,26 +341,6 @@ const char* SIMIX_storage_get_name(smx_storage_t storage){
   return sg_storage_name(storage);
 }
 
-void SIMIX_pre_storage_set_data(smx_simcall_t simcall, smx_storage_t storage, void *data) {
-  SIMIX_storage_set_data(storage, data);
-}
-void SIMIX_storage_set_data(smx_storage_t storage, void *data){
-  xbt_assert((storage != NULL), "Invalid parameters");
-  xbt_assert((SIMIX_storage_priv(storage)->data == NULL), "Data already set");
-
-  SIMIX_storage_priv(storage)->data = data;
-}
-
-void* SIMIX_pre_storage_get_data(smx_simcall_t simcall,smx_storage_t storage){
-  return SIMIX_storage_get_data(storage);
-}
-
-void* SIMIX_storage_get_data(smx_storage_t storage){
-  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
-
-  return SIMIX_storage_priv(storage)->data;
-}
-
 xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage){
   return SIMIX_storage_get_content(storage);
 }
index f3f1058..ad7598d 100644 (file)
@@ -22,8 +22,6 @@ static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){
 
 smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
 void SIMIX_storage_destroy(void *s);
-void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd);
-void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data);
 void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size);
 void SIMIX_pre_file_write(smx_simcall_t simcall,smx_file_t fd, sg_size_t size);
 void SIMIX_pre_file_open(smx_simcall_t simcall, const char* mount,
@@ -38,8 +36,6 @@ xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_size_t offset, int origin);
 void SIMIX_pre_storage_file_rename(smx_simcall_t simcall,smx_storage_t storage, const char* src, const char* dest);
 
-void* SIMIX_file_get_data(smx_file_t fd);
-void SIMIX_file_set_data(smx_file_t fd, void *data);
 smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size);
 smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage,
@@ -63,9 +59,6 @@ sg_size_t SIMIX_storage_get_used_size(smx_process_t process,const char* name);
 xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
 xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t);
 
-void SIMIX_pre_storage_set_data(smx_simcall_t, smx_storage_t, void*);
-void* SIMIX_pre_storage_get_data(smx_simcall_t, smx_storage_t);
-
 xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
 xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);