From: degomme Date: Tue, 2 Aug 2016 08:34:47 +0000 (+0200) Subject: Add option to play with the max number of files opened on each host at the same time X-Git-Tag: v3_14~646^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c52c503d21e54cc4ff15a64060c2eb0b265f5f73?hp=ba15f0e8e5fe9918bad627ec253f3fcae8921432 Add option to play with the max number of files opened on each host at the same time --- diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index f12e73ff73..f66a3377ea 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -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; diff --git a/src/msg/msg_host.cpp b/src/msg/msg_host.cpp index a6aae4a402..367b64927c 100644 --- a/src/msg/msg_host.cpp +++ b/src/msg/msg_host.cpp @@ -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); diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 63b35791e6..7cafc923a7 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -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.");