Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge if statements.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Oct 2017 14:35:39 +0000 (16:35 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Oct 2017 14:35:39 +0000 (16:35 +0200)
src/kernel/routing/FloydZone.cpp
src/mc/compare.cpp
src/smpi/mpi/smpi_request.cpp

index b434384..4162fa4 100644 (file)
@@ -191,12 +191,11 @@ void FloydZone::seal()
   for (unsigned int c = 0; c < table_size; c++) {
     for (unsigned int a = 0; a < table_size; a++) {
       for (unsigned int b = 0; b < table_size; b++) {
   for (unsigned int c = 0; c < table_size; c++) {
     for (unsigned int a = 0; a < table_size; a++) {
       for (unsigned int b = 0; b < table_size; b++) {
-        if (TO_FLOYD_COST(a, c) < DBL_MAX && TO_FLOYD_COST(c, b) < DBL_MAX) {
-          if (fabs(TO_FLOYD_COST(a, b) - DBL_MAX) < std::numeric_limits<double>::epsilon() ||
-              (TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b) < TO_FLOYD_COST(a, b))) {
-            TO_FLOYD_COST(a, b) = TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b);
-            TO_FLOYD_PRED(a, b) = TO_FLOYD_PRED(c, b);
-          }
+        if (TO_FLOYD_COST(a, c) < DBL_MAX && TO_FLOYD_COST(c, b) < DBL_MAX &&
+            (fabs(TO_FLOYD_COST(a, b) - DBL_MAX) < std::numeric_limits<double>::epsilon() ||
+             (TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b) < TO_FLOYD_COST(a, b)))) {
+          TO_FLOYD_COST(a, b) = TO_FLOYD_COST(a, c) + TO_FLOYD_COST(c, b);
+          TO_FLOYD_PRED(a, b) = TO_FLOYD_PRED(c, b);
         }
       }
     }
         }
       }
     }
index 0e3887d..386e017 100644 (file)
@@ -1031,14 +1031,12 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
       return 0;
     }
 
       return 0;
     }
 
-    if (type_size != -1) {
-      if (type_size != (ssize_t) heapinfo1->busy_block.busy_size
-          && type_size != (ssize_t)   heapinfo2->busy_block.busy_size
-          && (type->name.empty() || type->name == "struct s_smx_context")) {
-        if (match_pairs)
-          state.match_equals(previous);
-        return -1;
-      }
+    if (type_size != -1 && type_size != (ssize_t)heapinfo1->busy_block.busy_size &&
+        type_size != (ssize_t)heapinfo2->busy_block.busy_size &&
+        (type->name.empty() || type->name == "struct s_smx_context")) {
+      if (match_pairs)
+        state.match_equals(previous);
+      return -1;
     }
 
     if (heapinfo1->busy_block.size != heapinfo2->busy_block.size)
     }
 
     if (heapinfo1->busy_block.size != heapinfo2->busy_block.size)
@@ -1098,12 +1096,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
     }
 
     // Check if the blocks are already matched together:
     }
 
     // Check if the blocks are already matched together:
-    if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_) {
-      if (offset1==offset2 && state.fragmentsEqual(block1, frag1, block2, frag2)) {
-        if (match_pairs)
-          state.match_equals(previous);
-        return 0;
-      }
+    if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_ && offset1 == offset2 &&
+        state.fragmentsEqual(block1, frag1, block2, frag2)) {
+      if (match_pairs)
+        state.match_equals(previous);
+      return 0;
     }
     // Compare the size of both fragments:
     if (heapinfo1->busy_frag.frag_size[frag1] != heapinfo2->busy_frag.frag_size[frag2]) {
     }
     // Compare the size of both fragments:
     if (heapinfo1->busy_frag.frag_size[frag1] != heapinfo2->busy_frag.frag_size[frag2]) {
index 10a6da2..0ed24fa 100644 (file)
@@ -692,12 +692,11 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status)
     if (((req->flags_ & ACCUMULATE) != 0) ||
         (datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
 
     if (((req->flags_ & ACCUMULATE) != 0) ||
         (datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
 
-      if (not smpi_process()->replaying()) {
-        if (smpi_privatize_global_variables != 0 && (static_cast<char*>(req->old_buf_) >= smpi_data_exe_start) &&
-            ((char*)req->old_buf_ < smpi_data_exe_start + smpi_data_exe_size)) {
-          XBT_VERB("Privatization : We are unserializing to a zone in global memory  Switch data segment ");
-          smpi_switch_data_segment(smpi_process()->index());
-        }
+      if (not smpi_process()->replaying() && smpi_privatize_global_variables != 0 &&
+          static_cast<char*>(req->old_buf_) >= smpi_data_exe_start &&
+          static_cast<char*>(req->old_buf_) < smpi_data_exe_start + smpi_data_exe_size) {
+        XBT_VERB("Privatization : We are unserializing to a zone in global memory  Switch data segment ");
+        smpi_switch_data_segment(smpi_process()->index());
       }
 
       if(datatype->flags() & DT_FLAG_DERIVED){
       }
 
       if(datatype->flags() & DT_FLAG_DERIVED){