From: Frederic Suter Date: Sun, 9 Jul 2017 19:46:15 +0000 (+0200) Subject: cleanups X-Git-Tag: v3_17~416^2~13 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/46109c5a5df3d073bdab7caf6736bc410d41beaa cleanups --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index d691b543ed..fa9a3967d9 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -138,27 +138,6 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_failed_action_set(surf_model_t mode */ XBT_PUBLIC(int) surf_model_running_action_set_size(surf_model_t model); -/** @brief Create a file closing action on the given host */ -XBT_PUBLIC(surf_action_t) surf_host_close(sg_host_t host, surf_file_t fd); - -/** @brief Create a file reading action on the given host */ -XBT_PUBLIC(surf_action_t) surf_host_read(sg_host_t host, surf_file_t fd, sg_size_t size); - -/** @brief Create a file writing action on the given host */ -XBT_PUBLIC(surf_action_t) surf_host_write(sg_host_t host, surf_file_t fd, sg_size_t size); - -/** - * @brief Move a file to another location on the *same mount point*. - * @details [long description] - * - * @param host The surf host - * @param fd The file descriptor - * @param fullpath The new full path - * - * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED - */ -XBT_PUBLIC(int) surf_host_file_move(sg_host_t host, surf_file_t fd, const char* fullpath); - /** * @brief [brief description] * @details [long description] diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index cfd7f33179..5bc58f7017 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -6,16 +6,14 @@ #include #include #include -#include #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/Storage.hpp" #include "src/surf/FileImpl.hpp" +#include "src/surf/HostImpl.hpp" #include "src/surf/StorageImpl.hpp" #include "surf/surf.h" -#include - #include "src/surf/surf_interface.hpp" #include "smx_private.h" @@ -39,7 +37,7 @@ smx_activity_t SIMIX_file_read(surf_file_t file, sg_size_t size, sg_host_t host) simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl(); synchro->host = host; - synchro->surf_io = surf_host_read(host, file, size); + synchro->surf_io = host->pimpl_->read(file, size); synchro->surf_io->setData(synchro); XBT_DEBUG("Create io synchro %p", synchro); @@ -62,7 +60,7 @@ smx_activity_t SIMIX_file_write(surf_file_t file, sg_size_t size, sg_host_t host simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl(); synchro->host = host; - synchro->surf_io = surf_host_write(host, file, size); + synchro->surf_io = host->pimpl_->write(file, size); synchro->surf_io->setData(synchro); XBT_DEBUG("Create io synchro %p", synchro); @@ -106,7 +104,7 @@ smx_activity_t SIMIX_file_close(surf_file_t file, sg_host_t host) simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl(); synchro->host = host; - synchro->surf_io = surf_host_close(host, file); + synchro->surf_io = host->pimpl_->close(file); synchro->surf_io->setData(synchro); XBT_DEBUG("Create io synchro %p", synchro); diff --git a/src/simix/smx_io_private.h b/src/simix/smx_io_private.h index 13f8145e9b..e4689f7298 100644 --- a/src/simix/smx_io_private.h +++ b/src/simix/smx_io_private.h @@ -15,8 +15,6 @@ XBT_PRIVATE smx_activity_t SIMIX_file_read(surf_file_t fd, sg_size_t size, sg_ho 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_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 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); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index ab9f20b72d..9ca5f1df0b 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -165,18 +165,6 @@ int surf_model_running_action_set_size(surf_model_t model){ return model->getRunningActionSet()->size(); } -surf_action_t surf_host_close(sg_host_t host, surf_file_t fd){ - return host->pimpl_->close(fd); -} - -surf_action_t surf_host_read(sg_host_t host, surf_file_t fd, sg_size_t size){ - return host->pimpl_->read(fd, size); -} - -surf_action_t surf_host_write(sg_host_t host, surf_file_t fd, sg_size_t size){ - return host->pimpl_->write(fd, size); -} - void surf_cpu_action_set_bound(surf_action_t action, double bound) { static_cast(action)->setBound(bound); }