Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add option to play with the max number of files opened on each host at the same time
authordegomme <augustin.degomme@unibas.ch>
Tue, 2 Aug 2016 08:34:47 +0000 (10:34 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 2 Aug 2016 08:34:54 +0000 (10:34 +0200)
include/simgrid/msg.h
src/msg/msg_host.cpp
src/simgrid/sg_config.cpp

index f12e73f..f66a337 100644 (file)
@@ -41,6 +41,8 @@ typedef struct s_msg_host_priv {
   xbt_dynar_t file_descriptor_table;
 } s_msg_host_priv_t;
 
+XBT_PUBLIC_DATA(int) sg_storage_max_file_descriptors;
+
 /* ******************************** Task ************************************ */
 
 typedef struct simdata_task *simdata_task_t;
index a6aae4a..367b649 100644 (file)
@@ -12,6 +12,8 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
+int sg_storage_max_file_descriptors = 1024;
+
 /** @addtogroup m_host_management
  * (#msg_host_t) and the functions for managing it.
  *  
@@ -34,7 +36,7 @@ msg_host_t __MSG_host_create(sg_host_t host) // FIXME: don't return our paramete
   priv->affinity_mask_db = xbt_dict_new_homogeneous(nullptr);
 
   priv->file_descriptor_table = xbt_dynar_new(sizeof(int), nullptr);
-  for (int i=1023; i>=0;i--)
+  for (int i=sg_storage_max_file_descriptors-1; i>=0;i--)
     xbt_dynar_push_as(priv->file_descriptor_table, int, i);
 
   sg_host_msg_set(host,priv);
index 63b3579..7cafc92 100644 (file)
@@ -620,6 +620,14 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_string("smpi/reduce",        nullptr, &_check_coll_reduce, "Which collective to use for reduce");
 #endif // HAVE_SMPI
 
+    /* Storage */
+
+    sg_storage_max_file_descriptors = 1024;
+    simgrid::config::bindFlag(sg_storage_max_file_descriptors, "storage/max_file_descriptors",
+      "Maximum number of concurrently opened files per host. Default is 1024");
+
+    /* Others */
+
     xbt_cfg_register_boolean("exception/cutpath", "no", nullptr,
         "Whether to cut all path information from call traces, used e.g. in exceptions.");