From 95b5d463839f5e7ff285bcaa0ca749ed9fd7c2e0 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 7 May 2018 09:24:30 +0200 Subject: [PATCH] this parameter belongs to the plugin --- include/simgrid/msg.h | 3 --- include/simgrid/plugins/file_system.h | 1 + src/plugins/file_system/s4u_FileSystem.cpp | 7 ++++++- src/simgrid/sg_config.cpp | 6 ------ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 173a1de00e..93a9c97141 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -148,9 +148,6 @@ XBT_PUBLIC void MSG_process_killall(); XBT_PUBLIC void MSG_process_set_kill_time(msg_process_t process, double kill_time); XBT_PUBLIC void MSG_process_yield(); -/* ******************************** File ************************************ */ -typedef sg_file_t msg_file_t; -XBT_PUBLIC_DATA int sg_storage_max_file_descriptors; /** * \brief @brief Communication action. diff --git a/include/simgrid/plugins/file_system.h b/include/simgrid/plugins/file_system.h index 3b0de47c6f..429d1a62d0 100644 --- a/include/simgrid/plugins/file_system.h +++ b/include/simgrid/plugins/file_system.h @@ -12,6 +12,7 @@ // C interface //////////////// +typedef sg_file_t msg_file_t; // MSG backwards compatibility SG_BEGIN_DECL() XBT_PUBLIC void sg_storage_file_system_init(); diff --git a/src/plugins/file_system/s4u_FileSystem.cpp b/src/plugins/file_system/s4u_FileSystem.cpp index b1b6bafc55..d636541464 100644 --- a/src/plugins/file_system/s4u_FileSystem.cpp +++ b/src/plugins/file_system/s4u_FileSystem.cpp @@ -7,6 +7,7 @@ #include "simgrid/plugins/file_system.h" #include "simgrid/s4u/Actor.hpp" #include "src/surf/HostImpl.hpp" +#include "xbt/config.hpp" #include #include @@ -348,6 +349,10 @@ static void onHostCreation(simgrid::s4u::Host& host) /* **************************** Public interface *************************** */ void sg_storage_file_system_init() { + sg_storage_max_file_descriptors = 1024; + simgrid::config::bind_flag(sg_storage_max_file_descriptors, "storage/max_file_descriptors", + "Maximum number of concurrently opened files per host. Default is 1024"); + if (not FileSystemStorageExt::EXTENSION_ID.valid()) { FileSystemStorageExt::EXTENSION_ID = simgrid::s4u::Storage::extension_create(); simgrid::s4u::Storage::onCreation.connect(&onStorageCreation); @@ -407,7 +412,7 @@ void sg_file_set_data(sg_file_t fd, void* data) } /** - * \brief Set the file position indicator in the msg_file_t by adding offset bytes + * \brief Set the file position indicator in the sg_file_t by adding offset bytes * to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END). * * \param fd : file object that identifies the stream diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index dc79bbd0ff..b57ced9122 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -445,12 +445,6 @@ void sg_config_init(int *argc, char **argv) simgrid::config::declare_flag("smpi/reduce", "Which collective to use for reduce", ""); #endif // HAVE_SMPI - /* Storage */ - - sg_storage_max_file_descriptors = 1024; - simgrid::config::bind_flag(sg_storage_max_file_descriptors, "storage/max_file_descriptors", - "Maximum number of concurrently opened files per host. Default is 1024"); - /* Others */ simgrid::config::declare_flag( -- 2.20.1