Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into 'master'
authorAugustin Degomme <adegomme@gmail.com>
Mon, 2 Dec 2019 12:39:45 +0000 (13:39 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Mon, 2 Dec 2019 12:39:45 +0000 (13:39 +0100)
Master

See merge request simgrid/simgrid!23

include/smpi/mpif.h.in
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin.hpp

index 019ee69..1dee531 100644 (file)
@@ -39,6 +39,8 @@
       parameter(MPI_SUBVERSION=1)
       parameter(MPI_LOCK_EXCLUSIVE=1)
       parameter(MPI_LOCK_SHARED=2)
+
+
       integer MPI_MODE_NOSTORE, MPI_MODE_NOPUT, MPI_MODE_NOPRECEDE
       integer MPI_MODE_NOSUCCEED, MPI_MODE_NOCHECK
       parameter(MPI_MODE_NOSTORE=1)
       integer MPI_MODE_RDONLY, MPI_MODE_RDWR, MPI_MODE_WRONLY
       integer MPI_MODE_CREATE, MPI_MODE_EXCL, MPI_MODE_DELETE_ON_CLOSE
       integer MPI_MODE_UNIQUE_OPEN, MPI_MODE_APPEND, MPI_MODE_SEQUENTIAL
+      integer MPI_FILE_NULL
+      integer MPI_DISPLACEMENT_CURRENT, MPI_SEEK_SET, MPI_SEEK_CUR
+      integer MPI_MAX_DATAREP_STRING
+      parameter(MPI_FILE_NULL=0)
+      parameter(MPI_DISPLACEMENT_CURRENT=-54278278)
+      parameter(MPI_SEEK_SET=600)
+      parameter(MPI_SEEK_CUR=602)
+      parameter(MPI_MAX_DATAREP_STRING=128)
 
       parameter( MPI_MODE_RDONLY=2)
       parameter( MPI_MODE_RDWR=8)
index 10499a0..4168178 100644 (file)
@@ -505,17 +505,9 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
   double min_bound = -1;
 
   XBT_DEBUG("Active constraints : %zu", cnst_list.size());
-  /* Init: Only modified code portions: reset the value of active variables */
-  for (Constraint const& cnst : cnst_list) {
-    for (Element const& elem : cnst.enabled_element_set_) {
-      xbt_assert(elem.variable->sharing_penalty_ > 0.0);
-      elem.variable->value_ = 0.0;
-    }
-  }
-
-  ConstraintLight* cnst_light_tab = new ConstraintLight[cnst_list.size()]();
+  cnst_light_vec.reserve(cnst_list.size());
+  ConstraintLight* cnst_light_tab = cnst_light_vec.data();
   int cnst_light_num              = 0;
-  dyn_light_t saturated_constraints;
 
   for (Constraint& cnst : cnst_list) {
     /* INIT: Collect constraints that actually need to be saturated (i.e remaining  and usage are strictly positive)
@@ -525,7 +517,8 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
       continue;
     cnst.usage_ = 0;
     for (Element& elem : cnst.enabled_element_set_) {
-      xbt_assert(elem.variable->sharing_penalty_ > 0);
+      xbt_assert(elem.variable->sharing_penalty_ > 0.0);
+      elem.variable->value_ = 0.0;
       if (elem.consumption_weight > 0) {
         if (cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE)
           cnst.usage_ += elem.consumption_weight / elem.variable->sharing_penalty_;
@@ -689,7 +682,6 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
 
   check_concurrency();
 
-  delete[] cnst_light_tab;
 }
 
 /** @brief Attribute the value bound to var->bound.
index cc4ed51..a473208 100644 (file)
@@ -531,6 +531,13 @@ public:
   resource::Action::ModifiedSet* modified_set_ = nullptr;
 
 private:
+
+  typedef std::vector<int> dyn_light_t;
+  
+  //Data used in lmm::solve
+  std::vector<ConstraintLight> cnst_light_vec;
+  dyn_light_t saturated_constraints;
+
   bool selective_update_active; /* flag to update partially the system only selecting changed portions */
   unsigned visited_counter_ = 1; /* used by System::update_modified_set() and System::remove_all_modified_set() to
                                   * cleverly (un-)flag the constraints (more details in these functions) */