Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get rid of smx_file_t
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 4 Jul 2017 09:16:46 +0000 (11:16 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 4 Jul 2017 09:16:46 +0000 (11:16 +0200)
13 files changed:
include/simgrid/s4u/File.hpp
include/simgrid/simix.h
src/kernel/activity/SynchroIo.cpp
src/msg/msg_private.h
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/smx_io.cpp
src/simix/smx_io_private.h
src/simix/smx_private.h
src/surf/storage_n11.cpp

index 75050dd..189c703 100644 (file)
@@ -76,10 +76,10 @@ public:
   int desc_id = 0;
 
 private:
   int desc_id = 0;
 
 private:
-  smx_file_t pimpl_ = nullptr;
-  const char* path_ = nullptr;
-  void* userdata_   = nullptr;
-  sg_host_t host_   = nullptr;
+  surf_file_t pimpl_ = nullptr;
+  const char* path_  = nullptr;
+  void* userdata_    = nullptr;
+  sg_host_t host_    = nullptr;
 };
 }
 } // namespace simgrid::s4u
 };
 }
 } // namespace simgrid::s4u
index 45d1ab2..4fab7f8 100644 (file)
@@ -8,10 +8,10 @@
 
 #include "simgrid/datatypes.h"
 #include "simgrid/host.h"
 
 #include "simgrid/datatypes.h"
 #include "simgrid/host.h"
+#include "surf/surf.h"
 #include "xbt/ex.h"
 #include "xbt/parmap.h"
 
 #include "xbt/ex.h"
 #include "xbt/parmap.h"
 
-
 /* ******************************** Host ************************************ */
 /** @brief Host datatype
     @ingroup simix_host_management
 /* ******************************** Host ************************************ */
 /** @brief Host datatype
     @ingroup simix_host_management
@@ -52,9 +52,6 @@ typedef struct s_smx_cond *smx_cond_t;
  */
 typedef struct s_smx_sem *smx_sem_t;
 
  */
 typedef struct s_smx_sem *smx_sem_t;
 
-/********************************** File *************************************/
-typedef struct s_smx_file *smx_file_t;
-
 /* ****************************** Process *********************************** */
 
 typedef enum {
 /* ****************************** Process *********************************** */
 
 typedef enum {
@@ -298,17 +295,17 @@ XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem, double max_duration)
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
 /*****************************   File   **********************************/
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
 /*****************************   File   **********************************/
-XBT_PUBLIC(void *) simcall_file_get_data(smx_file_t fd);
-XBT_PUBLIC(void) simcall_file_set_data(smx_file_t fd, void *data);
-XBT_PUBLIC(sg_size_t) simcall_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PUBLIC(sg_size_t) simcall_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PUBLIC(smx_file_t) simcall_file_open(const char* mount, const char* path, sg_storage_t st);
-XBT_PUBLIC(int) simcall_file_close(smx_file_t fd, sg_host_t host);
-XBT_PUBLIC(int) simcall_file_unlink(smx_file_t fd, sg_host_t host);
-XBT_PUBLIC(sg_size_t) simcall_file_get_size(smx_file_t fd);
-XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd);
-XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin);
-XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
+XBT_PUBLIC(void*) simcall_file_get_data(surf_file_t fd);
+XBT_PUBLIC(void) simcall_file_set_data(surf_file_t fd, void* data);
+XBT_PUBLIC(sg_size_t) simcall_file_read(surf_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PUBLIC(sg_size_t) simcall_file_write(surf_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PUBLIC(surf_file_t) simcall_file_open(const char* mount, const char* path, sg_storage_t st);
+XBT_PUBLIC(int) simcall_file_close(surf_file_t fd, sg_host_t host);
+XBT_PUBLIC(int) simcall_file_unlink(surf_file_t fd, sg_host_t host);
+XBT_PUBLIC(sg_size_t) simcall_file_get_size(surf_file_t fd);
+XBT_PUBLIC(sg_size_t) simcall_file_tell(surf_file_t fd);
+XBT_PUBLIC(int) simcall_file_seek(surf_file_t fd, sg_offset_t offset, int origin);
+XBT_PUBLIC(int) simcall_file_move(surf_file_t fd, const char* fullpath);
 /************************** MC simcalls   **********************************/
 XBT_PUBLIC(int) simcall_mc_random(int min, int max);
 
 /************************** MC simcalls   **********************************/
 XBT_PUBLIC(int) simcall_mc_random(int min, int max);
 
index 012165b..30e5cdd 100644 (file)
@@ -4,8 +4,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/activity/SynchroIo.hpp"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/activity/SynchroIo.hpp"
-#include "src/surf/surf_interface.hpp"
 #include "src/simix/smx_private.h"
 #include "src/simix/smx_private.h"
+#include "src/surf/FileImpl.hpp"
+#include "src/surf/surf_interface.hpp"
 
 void simgrid::kernel::activity::IoImpl::suspend()
 {
 
 void simgrid::kernel::activity::IoImpl::suspend()
 {
@@ -24,13 +25,12 @@ void simgrid::kernel::activity::IoImpl::post()
   for (smx_simcall_t simcall : simcalls) {
     switch (simcall->call) {
     case SIMCALL_FILE_OPEN: {
   for (smx_simcall_t simcall : simcalls) {
     switch (simcall->call) {
     case SIMCALL_FILE_OPEN: {
-      smx_file_t tmp = xbt_new(s_smx_file_t,1);
-      tmp->surf_file = surf_storage_action_get_file(surf_io);
+      surf_file_t tmp = surf_storage_action_get_file(surf_io);
       simcall_file_open__set__result(simcall, tmp);
       break;
     }
     case SIMCALL_FILE_CLOSE:
       simcall_file_open__set__result(simcall, tmp);
       break;
     }
     case SIMCALL_FILE_CLOSE:
-      xbt_free(simcall_file_close__get__fd(simcall));
+      delete simcall_file_close__get__fd(simcall);
       simcall_file_close__set__result(simcall, 0);
       break;
     case SIMCALL_FILE_WRITE:
       simcall_file_close__set__result(simcall, 0);
       break;
     case SIMCALL_FILE_WRITE:
index e3f98d8..fb2ae08 100644 (file)
@@ -62,11 +62,6 @@ private:
   void reportMultipleUse() const;
 } s_simdata_task_t;
 
   void reportMultipleUse() const;
 } s_simdata_task_t;
 
-/********************************* File **************************************/
-typedef struct simdata_file {
-  smx_file_t smx_file;
-} s_simdata_file_t;
-
 /******************************* Process *************************************/
 
 namespace simgrid {
 /******************************* Process *************************************/
 
 namespace simgrid {
index cbb5bbb..4f93445 100644 (file)
@@ -657,7 +657,7 @@ int simcall_sem_get_capacity(smx_sem_t sem)
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-sg_size_t simcall_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
+sg_size_t simcall_file_read(surf_file_t fd, sg_size_t size, sg_host_t host)
 {
   return simcall_BODY_file_read(fd, size, host);
 }
 {
   return simcall_BODY_file_read(fd, size, host);
 }
@@ -666,7 +666,7 @@ sg_size_t simcall_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-sg_size_t simcall_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
+sg_size_t simcall_file_write(surf_file_t fd, sg_size_t size, sg_host_t host)
 {
   return simcall_BODY_file_write(fd, size, host);
 }
 {
   return simcall_BODY_file_write(fd, size, host);
 }
@@ -675,7 +675,7 @@ sg_size_t simcall_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
  * \ingroup simix_file_management
  * \brief
  */
  * \ingroup simix_file_management
  * \brief
  */
-smx_file_t simcall_file_open(const char* mount, const char* path, sg_storage_t st)
+surf_file_t simcall_file_open(const char* mount, const char* path, sg_storage_t st)
 {
   return simcall_BODY_file_open(mount, path, st);
 }
 {
   return simcall_BODY_file_open(mount, path, st);
 }
@@ -684,7 +684,7 @@ smx_file_t simcall_file_open(const char* mount, const char* path, sg_storage_t s
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-int simcall_file_close(smx_file_t fd, sg_host_t host)
+int simcall_file_close(surf_file_t fd, sg_host_t host)
 {
   return simcall_BODY_file_close(fd, host);
 }
 {
   return simcall_BODY_file_close(fd, host);
 }
@@ -693,7 +693,7 @@ int simcall_file_close(smx_file_t fd, sg_host_t host)
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-int simcall_file_unlink(smx_file_t fd, sg_host_t host)
+int simcall_file_unlink(surf_file_t fd, sg_host_t host)
 {
   return simcall_BODY_file_unlink(fd, host);
 }
 {
   return simcall_BODY_file_unlink(fd, host);
 }
@@ -702,7 +702,8 @@ int simcall_file_unlink(smx_file_t fd, sg_host_t host)
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-sg_size_t simcall_file_get_size(smx_file_t fd){
+sg_size_t simcall_file_get_size(surf_file_t fd)
+{
   return simcall_BODY_file_get_size(fd);
 }
 
   return simcall_BODY_file_get_size(fd);
 }
 
@@ -710,7 +711,8 @@ sg_size_t simcall_file_get_size(smx_file_t fd){
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-sg_size_t simcall_file_tell(smx_file_t fd){
+sg_size_t simcall_file_tell(surf_file_t fd)
+{
   return simcall_BODY_file_tell(fd);
 }
 
   return simcall_BODY_file_tell(fd);
 }
 
@@ -718,7 +720,8 @@ sg_size_t simcall_file_tell(smx_file_t fd){
  * \ingroup simix_file_management
  *
  */
  * \ingroup simix_file_management
  *
  */
-int simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin){
+int simcall_file_seek(surf_file_t fd, sg_offset_t offset, int origin)
+{
   return simcall_BODY_file_seek(fd, offset, origin);
 }
 
   return simcall_BODY_file_seek(fd, offset, origin);
 }
 
@@ -727,7 +730,7 @@ int simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin){
  * \brief Move a file to another location on the *same mount point*.
  *
  */
  * \brief Move a file to another location on the *same mount point*.
  *
  */
-int simcall_file_move(smx_file_t fd, const char* fullpath)
+int simcall_file_move(surf_file_t fd, const char* fullpath)
 {
   return simcall_BODY_file_move(fd, fullpath);
 }
 {
   return simcall_BODY_file_move(fd, fullpath);
 }
index 6232869..4e437e4 100644 (file)
@@ -1542,17 +1542,17 @@ static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall,
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_read__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_read__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_read__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_read__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_read__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_read__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_read__get__size(smx_simcall_t simcall)
 {
 }
 static inline sg_size_t simcall_file_read__get__size(smx_simcall_t simcall)
 {
@@ -1590,17 +1590,17 @@ static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_write__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_write__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_write__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_write__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_write__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_write__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_write__get__size(smx_simcall_t simcall)
 {
 }
 static inline sg_size_t simcall_file_write__get__size(smx_simcall_t simcall)
 {
@@ -1674,29 +1674,30 @@ static inline void simcall_file_open__set__st(smx_simcall_t simcall, sg_storage_
 {
   simgrid::simix::marshal<sg_storage_t>(simcall->args[2], arg);
 }
 {
   simgrid::simix::marshal<sg_storage_t>(simcall->args[2], arg);
 }
-static inline smx_file_t simcall_file_open__get__result(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_open__get__result(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->result);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->result);
 }
 }
-static inline smx_file_t simcall_file_open__getraw__result(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_open__getraw__result(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->result);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->result);
 }
 }
-static inline void simcall_file_open__set__result(smx_simcall_t simcall, smx_file_t result){
-    simgrid::simix::marshal<smx_file_t>(simcall->result, result);
+static inline void simcall_file_open__set__result(smx_simcall_t simcall, surf_file_t result)
+{
+  simgrid::simix::marshal<surf_file_t>(simcall->result, result);
 }
 
 }
 
-static inline smx_file_t simcall_file_close__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_close__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_close__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_close__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_close__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_close__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_host_t simcall_file_close__get__host(smx_simcall_t simcall)
 {
 }
 static inline sg_host_t simcall_file_close__get__host(smx_simcall_t simcall)
 {
@@ -1722,17 +1723,17 @@ static inline void simcall_file_close__set__result(smx_simcall_t simcall, int re
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_unlink__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_unlink__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_unlink__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_unlink__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_unlink__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_unlink__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_host_t simcall_file_unlink__get__host(smx_simcall_t simcall)
 {
 }
 static inline sg_host_t simcall_file_unlink__get__host(smx_simcall_t simcall)
 {
@@ -1758,17 +1759,17 @@ static inline void simcall_file_unlink__set__result(smx_simcall_t simcall, int r
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_get_size__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_get_size__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_get_size__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_get_size__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_get_size__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_get_size__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_get_size__get__result(smx_simcall_t simcall)
 {
 }
 static inline sg_size_t simcall_file_get_size__get__result(smx_simcall_t simcall)
 {
@@ -1782,17 +1783,17 @@ static inline void simcall_file_get_size__set__result(smx_simcall_t simcall, sg_
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_tell__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_tell__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_tell__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_tell__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_tell__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_tell__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_size_t simcall_file_tell__get__result(smx_simcall_t simcall)
 {
 }
 static inline sg_size_t simcall_file_tell__get__result(smx_simcall_t simcall)
 {
@@ -1806,17 +1807,17 @@ static inline void simcall_file_tell__set__result(smx_simcall_t simcall, sg_size
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
     simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_seek__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_seek__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_seek__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_seek__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_seek__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_seek__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline sg_offset_t simcall_file_seek__get__offset(smx_simcall_t simcall)
 {
 }
 static inline sg_offset_t simcall_file_seek__get__offset(smx_simcall_t simcall)
 {
@@ -1854,17 +1855,17 @@ static inline void simcall_file_seek__set__result(smx_simcall_t simcall, int res
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
     simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline smx_file_t simcall_file_move__get__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_move__get__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]);
 }
 }
-static inline smx_file_t simcall_file_move__getraw__fd(smx_simcall_t simcall)
+static inline surf_file_t simcall_file_move__getraw__fd(smx_simcall_t simcall)
 {
 {
-  return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<surf_file_t>(simcall->args[0]);
 }
 }
-static inline void simcall_file_move__set__fd(smx_simcall_t simcall, smx_file_t arg)
+static inline void simcall_file_move__set__fd(smx_simcall_t simcall, surf_file_t arg)
 {
 {
-  simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<surf_file_t>(simcall->args[0], arg);
 }
 static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall)
 {
 }
 static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall)
 {
@@ -2028,9 +2029,9 @@ XBT_PRIVATE int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t
 XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
 XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
 XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
 XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
-XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, surf_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, surf_file_t fd, sg_size_t size, sg_host_t host);
 XBT_PRIVATE void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* mount, const char* path, sg_storage_t st);
 XBT_PRIVATE void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* mount, const char* path, sg_storage_t st);
-XBT_PRIVATE void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host);
-XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
+XBT_PRIVATE void simcall_HANDLER_file_close(smx_simcall_t simcall, surf_file_t fd, sg_host_t host);
+XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, surf_file_t fd, const char* fullpath);
 XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
 XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
index 79a6d32..534c966 100644 (file)
@@ -331,63 +331,71 @@ inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
     return simcall<int, smx_sem_t>(SIMCALL_SEM_GET_CAPACITY, sem);
   }
 
     return simcall<int, smx_sem_t>(SIMCALL_SEM_GET_CAPACITY, sem);
   }
 
-inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
+  inline static sg_size_t simcall_BODY_file_read(surf_file_t fd, sg_size_t size, sg_host_t host)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size, host);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size, host);
-    return simcall<sg_size_t, smx_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_READ, fd, size, host);
+    return simcall<sg_size_t, surf_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_READ, fd, size, host);
   }
 
   }
 
-inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
+  inline static sg_size_t simcall_BODY_file_write(surf_file_t fd, sg_size_t size, sg_host_t host)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size, host);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size, host);
-    return simcall<sg_size_t, smx_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_WRITE, fd, size, host);
+    return simcall<sg_size_t, surf_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_WRITE, fd, size, host);
   }
 
   }
 
-  inline static smx_file_t simcall_BODY_file_open(const char* mount, const char* path, sg_storage_t st)
+  inline static surf_file_t simcall_BODY_file_open(const char* mount, const char* path, sg_storage_t st)
   {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       simcall_HANDLER_file_open(&SIMIX_process_self()->simcall, mount, path, st);
   {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       simcall_HANDLER_file_open(&SIMIX_process_self()->simcall, mount, path, st);
-    return simcall<smx_file_t, const char*, const char*, sg_storage_t>(SIMCALL_FILE_OPEN, mount, path, st);
+    return simcall<surf_file_t, const char*, const char*, sg_storage_t>(SIMCALL_FILE_OPEN, mount, path, st);
   }
 
   }
 
-inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
+  inline static int simcall_BODY_file_close(surf_file_t fd, sg_host_t host)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_close(&SIMIX_process_self()->simcall, fd, host);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_close(&SIMIX_process_self()->simcall, fd, host);
-    return simcall<int, smx_file_t, sg_host_t>(SIMCALL_FILE_CLOSE, fd, host);
+    return simcall<int, surf_file_t, sg_host_t>(SIMCALL_FILE_CLOSE, fd, host);
   }
 
   }
 
-inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
+  inline static int simcall_BODY_file_unlink(surf_file_t fd, sg_host_t host)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_file_unlink(fd, host);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_file_unlink(fd, host);
-    return simcall<int, smx_file_t, sg_host_t>(SIMCALL_FILE_UNLINK, fd, host);
+    return simcall<int, surf_file_t, sg_host_t>(SIMCALL_FILE_UNLINK, fd, host);
   }
 
   }
 
-inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
+  inline static sg_size_t simcall_BODY_file_get_size(surf_file_t fd)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_get_size(fd);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_get_size(fd);
-    return simcall<sg_size_t, smx_file_t>(SIMCALL_FILE_GET_SIZE, fd);
+    return simcall<sg_size_t, surf_file_t>(SIMCALL_FILE_GET_SIZE, fd);
   }
 
   }
 
-inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
+  inline static sg_size_t simcall_BODY_file_tell(surf_file_t fd)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_tell(fd);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_tell(fd);
-    return simcall<sg_size_t, smx_file_t>(SIMCALL_FILE_TELL, fd);
+    return simcall<sg_size_t, surf_file_t>(SIMCALL_FILE_TELL, fd);
   }
 
   }
 
-inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
+  inline static int simcall_BODY_file_seek(surf_file_t fd, sg_offset_t offset, int origin)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_seek(fd, offset, origin);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0)
       SIMIX_file_seek(fd, offset, origin);
-    return simcall<int, smx_file_t, sg_offset_t, int>(SIMCALL_FILE_SEEK, fd, offset, origin);
+    return simcall<int, surf_file_t, sg_offset_t, int>(SIMCALL_FILE_SEEK, fd, offset, origin);
   }
 
   }
 
-inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
+  inline static int simcall_BODY_file_move(surf_file_t fd, const char* fullpath)
+  {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_move(&SIMIX_process_self()->simcall, fd, fullpath);
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_file_move(&SIMIX_process_self()->simcall, fd, fullpath);
-    return simcall<int, smx_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
+    return simcall<int, surf_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
   }
 
 inline static int simcall_BODY_mc_random(int min, int max) {
   }
 
 inline static int simcall_BODY_mc_random(int min, int max) {
index 3837fc8..b997150 100644 (file)
@@ -339,12 +339,16 @@ case SIMCALL_SEM_GET_CAPACITY:
       break;
 
 case SIMCALL_FILE_READ:
       break;
 
 case SIMCALL_FILE_READ:
-      simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]));
-      break;
+  simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
+                            simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]),
+                            simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]));
+  break;
 
 case SIMCALL_FILE_WRITE:
 
 case SIMCALL_FILE_WRITE:
-      simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]));
-      break;
+  simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
+                             simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]),
+                             simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]));
+  break;
 
 case SIMCALL_FILE_OPEN:
   simcall_HANDLER_file_open(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
 
 case SIMCALL_FILE_OPEN:
   simcall_HANDLER_file_open(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
@@ -353,38 +357,43 @@ case SIMCALL_FILE_OPEN:
   break;
 
 case SIMCALL_FILE_CLOSE:
   break;
 
 case SIMCALL_FILE_CLOSE:
-      simcall_HANDLER_file_close(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
-      break;
+  simcall_HANDLER_file_close(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
+                             simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
+  break;
 
 case SIMCALL_FILE_UNLINK:
 
 case SIMCALL_FILE_UNLINK:
-      simgrid::simix::marshal<int>(simcall->result, SIMIX_file_unlink(simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(simcall->result,
+                               SIMIX_file_unlink(simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
+                                                 simgrid::simix::unmarshal<sg_host_t>(simcall->args[1])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_FILE_GET_SIZE:
   simgrid::simix::marshal<sg_size_t>(simcall->result,
 
 case SIMCALL_FILE_GET_SIZE:
   simgrid::simix::marshal<sg_size_t>(simcall->result,
-                                     SIMIX_file_get_size(simgrid::simix::unmarshal<smx_file_t>(simcall->args[0])));
+                                     SIMIX_file_get_size(simgrid::simix::unmarshal<surf_file_t>(simcall->args[0])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_TELL:
   simgrid::simix::marshal<sg_size_t>(simcall->result,
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_TELL:
   simgrid::simix::marshal<sg_size_t>(simcall->result,
-                                     SIMIX_file_tell(simgrid::simix::unmarshal<smx_file_t>(simcall->args[0])));
+                                     SIMIX_file_tell(simgrid::simix::unmarshal<surf_file_t>(simcall->args[0])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_SEEK:
   simgrid::simix::marshal<int>(simcall->result,
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_SEEK:
   simgrid::simix::marshal<int>(simcall->result,
-                               SIMIX_file_seek(simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]),
+                               SIMIX_file_seek(simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
                                                simgrid::simix::unmarshal<sg_offset_t>(simcall->args[1]),
                                                simgrid::simix::unmarshal<int>(simcall->args[2])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_MOVE:
                                                simgrid::simix::unmarshal<sg_offset_t>(simcall->args[1]),
                                                simgrid::simix::unmarshal<int>(simcall->args[2])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_FILE_MOVE:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_file_move(simcall, simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(
+      simcall->result, simcall_HANDLER_file_move(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
+                                                 simgrid::simix::unmarshal<const char*>(simcall->args[1])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_MC_RANDOM:
       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
 
 case SIMCALL_MC_RANDOM:
       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
index 469e761..b740222 100644 (file)
@@ -85,15 +85,15 @@ void      sem_acquire(smx_sem_t sem) [[block]];
 void      sem_acquire_timeout(smx_sem_t sem, double timeout) [[block]];
 int       sem_get_capacity(smx_sem_t sem);
 
 void      sem_acquire_timeout(smx_sem_t sem, double timeout) [[block]];
 int       sem_get_capacity(smx_sem_t sem);
 
-sg_size_t   file_read(smx_file_t fd, sg_size_t size, sg_host_t host) [[block]];
-sg_size_t   file_write(smx_file_t fd, sg_size_t size, sg_host_t host) [[block]];
-smx_file_t  file_open(const char* mount, const char* path, sg_storage_t st) [[block]];
-int         file_close(smx_file_t fd, sg_host_t host) [[block]];
-int         file_unlink(smx_file_t fd, sg_host_t host) [[nohandler]];
-sg_size_t   file_get_size(smx_file_t fd) [[nohandler]];
-sg_size_t   file_tell(smx_file_t fd) [[nohandler]];
-int         file_seek(smx_file_t fd, sg_offset_t offset, int origin) [[nohandler]];
-int         file_move(smx_file_t fd, const char* fullpath);
+sg_size_t   file_read(surf_file_t fd, sg_size_t size, sg_host_t host) [[block]];
+sg_size_t   file_write(surf_file_t fd, sg_size_t size, sg_host_t host) [[block]];
+surf_file_t  file_open(const char* mount, const char* path, sg_storage_t st) [[block]];
+int         file_close(surf_file_t fd, sg_host_t host) [[block]];
+int         file_unlink(surf_file_t fd, sg_host_t host) [[nohandler]];
+sg_size_t   file_get_size(surf_file_t fd) [[nohandler]];
+sg_size_t   file_tell(surf_file_t fd) [[nohandler]];
+int         file_seek(surf_file_t fd, sg_offset_t offset, int origin) [[nohandler]];
+int         file_move(surf_file_t fd, const char* fullpath);
 
 int        mc_random(int min, int max);
 void       set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category) [[nohandler]];
 
 int        mc_random(int min, int max);
 void       set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category) [[nohandler]];
index 91690a9..5f40cb9 100644 (file)
@@ -12,6 +12,7 @@
 #include "simgrid/s4u/Storage.hpp"
 #include "src/surf/FileImpl.hpp"
 #include "src/surf/StorageImpl.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "src/surf/FileImpl.hpp"
 #include "src/surf/StorageImpl.hpp"
+#include "surf/surf.h"
 
 #include <mc/mc.h>
 
 
 #include <mc/mc.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io)");
 
 //SIMIX FILE READ
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io)");
 
 //SIMIX FILE READ
-void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host)
+void simcall_HANDLER_file_read(smx_simcall_t simcall, surf_file_t fd, sg_size_t size, sg_host_t host)
 {
   smx_activity_t synchro = SIMIX_file_read(fd, size, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
 {
   smx_activity_t synchro = SIMIX_file_read(fd, size, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
+smx_activity_t SIMIX_file_read(surf_file_t file, sg_size_t size, sg_host_t host)
 {
   /* check if the host is active */
   if (host->isOff())
 {
   /* check if the host is active */
   if (host->isOff())
@@ -38,7 +39,7 @@ smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
-  synchro->surf_io = surf_host_read(host, fd->surf_file, size);
+  synchro->surf_io                           = surf_host_read(host, file, size);
 
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
@@ -47,21 +48,21 @@ smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
 }
 
 //SIMIX FILE WRITE
 }
 
 //SIMIX FILE WRITE
-void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host)
+void simcall_HANDLER_file_write(smx_simcall_t simcall, surf_file_t fd, sg_size_t size, sg_host_t host)
 {
   smx_activity_t synchro = SIMIX_file_write(fd,  size, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
 {
   smx_activity_t synchro = SIMIX_file_write(fd,  size, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
+smx_activity_t SIMIX_file_write(surf_file_t file, sg_size_t size, sg_host_t host)
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
-  synchro->surf_io = surf_host_write(host, fd->surf_file, size);
+  synchro->surf_io                           = surf_host_write(host, file, size);
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
@@ -91,21 +92,21 @@ smx_activity_t SIMIX_file_open(const char* mount, const char* path, sg_storage_t
 }
 
 //SIMIX FILE CLOSE
 }
 
 //SIMIX FILE CLOSE
-void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host)
+void simcall_HANDLER_file_close(smx_simcall_t simcall, surf_file_t fd, sg_host_t host)
 {
   smx_activity_t synchro = SIMIX_file_close(fd, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
 {
   smx_activity_t synchro = SIMIX_file_close(fd, host);
   synchro->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = synchro;
 }
 
-smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
+smx_activity_t SIMIX_file_close(surf_file_t file, sg_host_t host)
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
   synchro->host = host;
-  synchro->surf_io = surf_host_close(host, fd->surf_file);
+  synchro->surf_io                           = surf_host_close(host, file);
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
   synchro->surf_io->setData(synchro);
   XBT_DEBUG("Create io synchro %p", synchro);
 
@@ -113,38 +114,38 @@ smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
 }
 
 //SIMIX FILE UNLINK
 }
 
 //SIMIX FILE UNLINK
-int SIMIX_file_unlink(smx_file_t fd, sg_host_t host)
+int SIMIX_file_unlink(surf_file_t file, sg_host_t host)
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
 {
   if (host->isOff())
     THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
-  return surf_host_unlink(host, fd->surf_file);
+  return surf_host_unlink(host, file);
 }
 
 }
 
-sg_size_t SIMIX_file_get_size(smx_file_t fd)
+sg_size_t SIMIX_file_get_size(surf_file_t fd)
 {
 {
-  return fd->surf_file->size();
+  return fd->size();
 }
 
 }
 
-sg_size_t SIMIX_file_tell(smx_file_t fd)
+sg_size_t SIMIX_file_tell(surf_file_t fd)
 {
 {
-  return fd->surf_file->tell();
+  return fd->tell();
 }
 
 }
 
-int SIMIX_file_seek(smx_file_t fd, sg_offset_t offset, int origin)
+int SIMIX_file_seek(surf_file_t fd, sg_offset_t offset, int origin)
 {
 {
-  return fd->surf_file->seek(offset, origin);
+  return fd->seek(offset, origin);
 }
 
 }
 
-int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t file, const char* fullpath)
+int simcall_HANDLER_file_move(smx_simcall_t simcall, surf_file_t file, const char* fullpath)
 {
   return SIMIX_file_move(simcall->issuer, file, fullpath);
 }
 
 {
   return SIMIX_file_move(simcall->issuer, file, fullpath);
 }
 
-int SIMIX_file_move(smx_actor_t process, smx_file_t file, const char* fullpath)
+int SIMIX_file_move(smx_actor_t process, surf_file_t file, const char* fullpath)
 {
   sg_host_t host = process->host;
 {
   sg_host_t host = process->host;
-  return  surf_host_file_move(host, file->surf_file, fullpath);
+  return surf_host_file_move(host, file, fullpath);
 }
 
 void SIMIX_io_destroy(smx_activity_t synchro)
 }
 
 void SIMIX_io_destroy(smx_activity_t synchro)
index a63e7e1..f862638 100644 (file)
 #include "simgrid/simix.h"
 #include "popping_private.h"
 
 #include "simgrid/simix.h"
 #include "popping_private.h"
 
-XBT_PRIVATE smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_read(surf_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_write(surf_file_t fd, sg_size_t size, sg_host_t host);
 XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* mount, const char* path, sg_storage_t st);
 XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* mount, const char* path, sg_storage_t st);
-XBT_PRIVATE smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
-XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host);
-XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_file_t fd);
-XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_file_t fd);
-XBT_PRIVATE int SIMIX_file_seek(smx_file_t fd, sg_offset_t offset, int origin);
-XBT_PRIVATE int SIMIX_file_move(smx_actor_t process, smx_file_t fd, const char* fullpath);
+XBT_PRIVATE smx_activity_t SIMIX_file_close(surf_file_t fd, sg_host_t host);
+XBT_PRIVATE int SIMIX_file_unlink(surf_file_t fd, sg_host_t host);
+XBT_PRIVATE sg_size_t SIMIX_file_get_size(surf_file_t fd);
+XBT_PRIVATE sg_size_t SIMIX_file_tell(surf_file_t fd);
+XBT_PRIVATE int SIMIX_file_seek(surf_file_t fd, sg_offset_t offset, int origin);
+XBT_PRIVATE int SIMIX_file_move(smx_actor_t process, surf_file_t fd, const char* fullpath);
 
 XBT_PRIVATE void SIMIX_io_destroy(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_io_finish(smx_activity_t synchro);
 
 XBT_PRIVATE void SIMIX_io_destroy(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_io_finish(smx_activity_t synchro);
index 85d9107..a0c713e 100644 (file)
@@ -76,11 +76,6 @@ XBT_PUBLIC(void) SIMIX_clean();
   _smx_throw_issuer->exception = std::make_exception_ptr(e); \
   } else ((void)0)
 
   _smx_throw_issuer->exception = std::make_exception_ptr(e); \
   } else ((void)0)
 
-typedef struct s_smx_file {
-  surf_file_t surf_file;
-} s_smx_file_t;
-
-
 SG_END_DECL()
 
 #endif
 SG_END_DECL()
 
 #endif
index 579ea96..dfe6fcc 100644 (file)
@@ -183,7 +183,6 @@ StorageAction *StorageN11::close(surf_file_t fd)
       ++it;
     }
   }
       ++it;
     }
   }
-  delete fd;
   StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, CLOSE);
   return action;
 }
   StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, CLOSE);
   return action;
 }