Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 16 Nov 2016 01:40:51 +0000 (02:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 16 Nov 2016 01:40:51 +0000 (02:40 +0100)
doc/doxygen/options.doc
src/msg/msg_host.cpp
src/msg/msg_vm.cpp
src/surf/surf_interface.hpp

index 5adc381..49fd264 100644 (file)
@@ -1019,7 +1019,9 @@ Here is an example:
     Internally, in order to speed up execution, we use a counter to keep track
     on how often we already checked if the handle is now valid or not. Hence, we
     actually use counter*SLEEP_TIME, that is, the time MPI_Test() causes the process
-    to sleep increases linearly with the number of previously failed testk.
+    to sleep increases linearly with the number of previously failed tests. This 
+    behavior can be disabled by setting smpi/grow-injected-times to no. This will
+    also disable this behavior for MPI_Iprobe.
 
 
 \subsection options_model_smpi_use_shared_malloc smpi/use-shared-malloc: Factorize malloc()s
@@ -1192,6 +1194,7 @@ silently overflow on other parts of the memory.
 - \c smpi/comp-adjustment-file: \ref options_model_smpi_adj_file
 - \c smpi/cpu-threshold: \ref options_smpi_bench
 - \c smpi/display-timing: \ref options_smpi_timing
+- \c smpi/grow-injected-times: \ref options_model_smpi_test
 - \c smpi/host-speed: \ref options_smpi_bench
 - \c smpi/IB-penalty-factors: \ref options_model_network_coefs
 - \c smpi/iprobe: \ref options_model_smpi_iprobe
index 856b7f8..28bd9bb 100644 (file)
@@ -29,13 +29,12 @@ msg_host_t __MSG_host_create(sg_host_t host) // FIXME: don't return our paramete
 {
   msg_host_priv_t priv = xbt_new0(s_msg_host_priv_t, 1);
 
-  priv->dp_objs = xbt_dict_new();
+  priv->dp_objs = nullptr;
   priv->dp_enabled = 0;
   priv->dp_updated_by_deleted_tasks = 0;
   priv->is_migrating = 0;
 
-  priv->file_descriptor_table = new std::vector<int>(sg_storage_max_file_descriptors);
-  std::iota (priv->file_descriptor_table->rbegin(), priv->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
+  priv->file_descriptor_table = nullptr;
 
   sg_host_msg_set(host,priv);
 
@@ -115,7 +114,7 @@ void __MSG_host_priv_free(msg_host_priv_t priv)
 {
   if (priv == nullptr)
     return;
-  unsigned int size = xbt_dict_size(priv->dp_objs);
+  unsigned int size = priv->dp_objs ? xbt_dict_size(priv->dp_objs) : 0;
   if (size > 0)
     XBT_WARN("dp_objs: %u pending task?", size);
   xbt_dict_free(&priv->dp_objs);
@@ -318,6 +317,10 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 
 int __MSG_host_get_file_descriptor_id(msg_host_t host){
   msg_host_priv_t priv = sg_host_msg(host);
+  if(!priv->file_descriptor_table){
+    priv->file_descriptor_table = new std::vector<int>(sg_storage_max_file_descriptors);
+    std::iota (priv->file_descriptor_table->rbegin(), priv->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
+  }
   xbt_assert(!priv->file_descriptor_table->empty(), "Too much files are opened! Some have to be closed.");
   int desc = priv->file_descriptor_table->back();
   priv->file_descriptor_table->pop_back();
index 0b985ba..21ec878 100644 (file)
@@ -442,6 +442,7 @@ static void reset_dirty_pages(msg_vm_t vm)
   char *key = nullptr;
   xbt_dict_cursor_t cursor = nullptr;
   dirty_page_t dp = nullptr;
+  if (!priv->dp_objs) return;
   xbt_dict_foreach(priv->dp_objs, cursor, key, dp) {
     double remaining = MSG_task_get_flops_amount(dp->task);
     dp->prev_clock = MSG_get_clock();
@@ -522,7 +523,7 @@ void MSG_host_add_task(msg_host_t host, msg_task_t task)
     dp->prev_clock = MSG_get_clock();
     dp->prev_remaining = remaining;
   }
-
+  if(!priv->dp_objs) priv->dp_objs = xbt_dict_new();
   xbt_assert(xbt_dict_get_or_null(priv->dp_objs, key) == nullptr);
   xbt_dict_set(priv->dp_objs, key, dp, nullptr);
   XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key, sg_host_get_name(host), remaining, priv->dp_enabled);
@@ -536,7 +537,7 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
 
   char *key = bprintf("%s-%p", task->name, task);
 
-  dirty_page_t dp = (dirty_page_t) xbt_dict_get_or_null(priv->dp_objs, key);
+  dirty_page_t dp = (dirty_page_t) (priv->dp_objs ? xbt_dict_get_or_null(priv->dp_objs, key) : NULL);
   xbt_assert(dp->task == task);
 
   /* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep
@@ -549,8 +550,8 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
 
     priv->dp_updated_by_deleted_tasks += updated;
   }
-
-  xbt_dict_remove(priv->dp_objs, key);
+  if(priv->dp_objs)
+    xbt_dict_remove(priv->dp_objs, key);
   xbt_free(dp);
 
   XBT_DEBUG("del %s on %s", key, sg_host_get_name(host));
index cdd4d58..a013167 100644 (file)
@@ -7,6 +7,7 @@
 #define SURF_MODEL_H_
 
 #include <cstddef>
+#include <string>
 
 #include <xbt.h>
 #include <memory>