Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
modernize two simcalls
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 30 Mar 2017 10:49:54 +0000 (12:49 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 30 Mar 2017 10:49:54 +0000 (12:49 +0200)
and use a third in msg_io

include/simgrid/simix.h
src/msg/msg_io.cpp
src/s4u/s4u_storage.cpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in

index 506b318..5c3cf43 100644 (file)
@@ -368,11 +368,7 @@ 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);
 /*****************************   Storage   **********************************/
 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);
 /*****************************   Storage   **********************************/
-XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (smx_storage_t storage);
-XBT_PUBLIC(sg_size_t) simcall_storage_get_used_size (smx_storage_t storage);
 XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage);
 XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage);
-XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage);
-XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data);
 XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_storage_t storage);
 
 /************************** MC simcalls   **********************************/
 XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_storage_t storage);
 
 /************************** MC simcalls   **********************************/
index 3b06812..0503108 100644 (file)
@@ -479,7 +479,7 @@ const char *MSG_storage_get_name(msg_storage_t storage) {
  * \return the free space size of the storage element (as a #sg_size_t)
  */
 sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
  * \return the free space size of the storage element (as a #sg_size_t)
  */
 sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
-  return simcall_storage_get_free_size(storage);
+  return simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getFreeSize(); });
 }
 
 /** \ingroup msg_storage_management
 }
 
 /** \ingroup msg_storage_management
@@ -488,7 +488,7 @@ sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
  * \return the used space size of the storage element (as a #sg_size_t)
  */
 sg_size_t MSG_storage_get_used_size(msg_storage_t storage){
  * \return the used space size of the storage element (as a #sg_size_t)
  */
 sg_size_t MSG_storage_get_used_size(msg_storage_t storage){
-  return simcall_storage_get_used_size(storage);
+  return simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getUsedSize(); });
 }
 
 /** \ingroup msg_storage_management
 }
 
 /** \ingroup msg_storage_management
@@ -587,7 +587,8 @@ void *MSG_storage_get_data(msg_storage_t storage)
  */
 xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
 {
  */
 xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
 {
-  std::map<std::string, sg_size_t*>* content = surf_storage_resource_priv(storage)->getContent();
+  std::map<std::string, sg_size_t*>* content =
+      simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getContent(); });
   xbt_dict_t content_dict = xbt_dict_new_homogeneous(nullptr);
 
   for (auto entry : *content) {
   xbt_dict_t content_dict = xbt_dict_new_homogeneous(nullptr);
 
   for (auto entry : *content) {
index 952ec8d..53cfb30 100644 (file)
@@ -59,12 +59,12 @@ const char* Storage::host()
 
 sg_size_t Storage::sizeFree()
 {
 
 sg_size_t Storage::sizeFree()
 {
-  return simcall_storage_get_free_size(pimpl_);
+  return simgrid::simix::kernelImmediate([this] { return surf_storage_resource_priv(pimpl_)->getFreeSize(); });
 }
 
 sg_size_t Storage::sizeUsed()
 {
 }
 
 sg_size_t Storage::sizeUsed()
 {
-  return simcall_storage_get_used_size(pimpl_);
+  return simgrid::simix::kernelImmediate([this] { return surf_storage_resource_priv(pimpl_)->getUsedSize(); });
 }
 
 sg_size_t Storage::size() {
 }
 
 sg_size_t Storage::size() {
index 3b63a27..098085a 100644 (file)
@@ -749,26 +749,6 @@ int simcall_file_move(smx_file_t fd, const char* fullpath)
   return simcall_BODY_file_move(fd, fullpath);
 }
 
   return simcall_BODY_file_move(fd, fullpath);
 }
 
-/**
- * \ingroup simix_storage_management
- * \brief Returns the free space size on a given storage element.
- * \param storage a storage
- * \return Return the free space size on a given storage element (as sg_size_t)
- */
-sg_size_t simcall_storage_get_free_size (smx_storage_t storage){
-  return simcall_BODY_storage_get_free_size(storage);
-}
-
-/**
- * \ingroup simix_storage_management
- * \brief Returns the used space size on a given storage element.
- * \param storage a storage
- * \return Return the used space size on a given storage element (as sg_size_t)
- */
-sg_size_t simcall_storage_get_used_size (smx_storage_t storage){
-  return simcall_BODY_storage_get_used_size(storage);
-}
-
 /**
  * \ingroup simix_storage_management
  * \brief Returns a dict of the properties assigned to a storage element.
 /**
  * \ingroup simix_storage_management
  * \brief Returns a dict of the properties assigned to a storage element.
index a49406a..343b8a1 100644 (file)
@@ -978,32 +978,6 @@ static inline void simcall_file_move__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_storage_t simcall_storage_get_free_size__get__storage(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
-}
-static inline void simcall_storage_get_free_size__set__storage(smx_simcall_t simcall, smx_storage_t arg) {
-    simgrid::simix::marshal<smx_storage_t>(simcall->args[0], arg);
-}
-static inline sg_size_t simcall_storage_get_free_size__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
-}
-static inline void simcall_storage_get_free_size__set__result(smx_simcall_t simcall, sg_size_t result){
-    simgrid::simix::marshal<sg_size_t>(simcall->result, result);
-}
-
-static inline smx_storage_t simcall_storage_get_used_size__get__name(smx_simcall_t simcall) {
-  return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
-}
-static inline void simcall_storage_get_used_size__set__name(smx_simcall_t simcall, smx_storage_t arg) {
-    simgrid::simix::marshal<smx_storage_t>(simcall->args[0], arg);
-}
-static inline sg_size_t simcall_storage_get_used_size__get__result(smx_simcall_t simcall){
-    return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
-}
-static inline void simcall_storage_get_used_size__set__result(smx_simcall_t simcall, sg_size_t result){
-    simgrid::simix::marshal<sg_size_t>(simcall->result, result);
-}
-
 static inline smx_storage_t simcall_storage_get_properties__get__storage(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
 }
 static inline smx_storage_t simcall_storage_get_properties__get__storage(smx_simcall_t simcall) {
   return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
 }
@@ -1103,6 +1077,4 @@ XBT_PRIVATE sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_
 XBT_PRIVATE int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
 XBT_PRIVATE xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
 XBT_PRIVATE int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
 XBT_PRIVATE xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
-XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage);
-XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name);
 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 85dead4..0268240 100644 (file)
@@ -347,18 +347,6 @@ inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
     return simcall<int, smx_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
   }
   
     return simcall<int, smx_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
   }
   
-inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_storage_get_free_size(&SIMIX_process_self()->simcall, storage);
-    return simcall<sg_size_t, smx_storage_t>(SIMCALL_STORAGE_GET_FREE_SIZE, storage);
-  }
-  
-inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_storage_get_used_size(&SIMIX_process_self()->simcall, name);
-    return simcall<sg_size_t, smx_storage_t>(SIMCALL_STORAGE_GET_USED_SIZE, name);
-  }
-  
 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_storage_get_properties(storage);
 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) SIMIX_storage_get_properties(storage);
index d9be9e8..205d92b 100644 (file)
@@ -70,8 +70,6 @@ typedef enum {
   SIMCALL_FILE_SEEK,
   SIMCALL_FILE_GET_INFO,
   SIMCALL_FILE_MOVE,
   SIMCALL_FILE_SEEK,
   SIMCALL_FILE_GET_INFO,
   SIMCALL_FILE_MOVE,
-  SIMCALL_STORAGE_GET_FREE_SIZE,
-  SIMCALL_STORAGE_GET_USED_SIZE,
   SIMCALL_STORAGE_GET_PROPERTIES,
   SIMCALL_MC_RANDOM,
   SIMCALL_SET_CATEGORY,
   SIMCALL_STORAGE_GET_PROPERTIES,
   SIMCALL_MC_RANDOM,
   SIMCALL_SET_CATEGORY,
index b1259c9..9e47729 100644 (file)
@@ -76,8 +76,6 @@ const char* simcall_names[] = {
     "SIMCALL_FILE_SEEK",
     "SIMCALL_FILE_GET_INFO",
     "SIMCALL_FILE_MOVE",
     "SIMCALL_FILE_SEEK",
     "SIMCALL_FILE_GET_INFO",
     "SIMCALL_FILE_MOVE",
-    "SIMCALL_STORAGE_GET_FREE_SIZE",
-    "SIMCALL_STORAGE_GET_USED_SIZE",
     "SIMCALL_STORAGE_GET_PROPERTIES",
     "SIMCALL_MC_RANDOM",
     "SIMCALL_SET_CATEGORY",
     "SIMCALL_STORAGE_GET_PROPERTIES",
     "SIMCALL_MC_RANDOM",
     "SIMCALL_SET_CATEGORY",
@@ -337,16 +335,6 @@ case SIMCALL_FILE_MOVE:
       SIMIX_simcall_answer(simcall);
       break;
 
       SIMIX_simcall_answer(simcall);
       break;
 
-case SIMCALL_STORAGE_GET_FREE_SIZE:
-      simgrid::simix::marshal<sg_size_t>(simcall->result, simcall_HANDLER_storage_get_free_size(simcall, simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
-
-case SIMCALL_STORAGE_GET_USED_SIZE:
-      simgrid::simix::marshal<sg_size_t>(simcall->result, simcall_HANDLER_storage_get_used_size(simcall, simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
-
 case SIMCALL_STORAGE_GET_PROPERTIES:
       simgrid::simix::marshal<xbt_dict_t>(simcall->result, SIMIX_storage_get_properties(simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
       SIMIX_simcall_answer(simcall);
 case SIMCALL_STORAGE_GET_PROPERTIES:
       simgrid::simix::marshal<xbt_dict_t>(simcall->result, SIMIX_storage_get_properties(simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
       SIMIX_simcall_answer(simcall);
index 4458171..31bc278 100644 (file)
@@ -96,8 +96,6 @@ int         file_seek(smx_file_t fd, sg_offset_t offset, int origin);
 xbt_dynar_t file_get_info(smx_file_t fd);
 int         file_move(smx_file_t fd, const char* fullpath);
 
 xbt_dynar_t file_get_info(smx_file_t fd);
 int         file_move(smx_file_t fd, const char* fullpath);
 
-sg_size_t  storage_get_free_size(smx_storage_t storage);
-sg_size_t  storage_get_used_size(smx_storage_t name);
 xbt_dict_t storage_get_properties(smx_storage_t storage) [[nohandler]];
 
 int        mc_random(int min, int max);
 xbt_dict_t storage_get_properties(smx_storage_t storage) [[nohandler]];
 
 int        mc_random(int min, int max);