Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Coding style: prefer keyword "not" to "!".
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 4 Oct 2022 13:27:24 +0000 (15:27 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 4 Oct 2022 14:58:51 +0000 (16:58 +0200)
docs/source/tuto_network_calibration/dahu_platform_ckmeans.cpp
include/xbt/asserts.hpp
src/kernel/resource/CpuImpl.cpp
src/simgrid/sg_config.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/mpi/smpi_win.cpp

index d47c521..dc7f1f1 100644 (file)
@@ -88,7 +88,7 @@ static SegmentedRegression read_json_file(const std::string& jsonFile, std::mt19
     double max    = it.second.get_child("max_x").get_value<double>();
     coefs[max]    = it.second.get_child("coefficient").get_value<double>();
     auto& mixture = mixtures[max];
-    if (!mixture)
+    if (not mixture)
       mixture = std::make_shared<NormalMixture>(gen);
     mixture->append(it.second.get_child("mean").get_value<double>(), it.second.get_child("sd").get_value<double>(),
                     it.second.get_child("prob").get_value<double>());
@@ -138,4 +138,4 @@ void load_platform(const sg4::Engine& e)
   seg = read_json_file("recv_ckmeans.json", gen);
   smpi_register_op_cost_callback(SmpiOperation::RECV, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,
                                                                 std::placeholders::_2, std::placeholders::_3));
-}
\ No newline at end of file
+}
index 84f647a..9b50fd2 100644 (file)
@@ -27,7 +27,7 @@
 #define _xbt_enforce_ARG1(cond) _xbt_enforce_ARGN((cond), "Assertion %s failed", #cond)
 #define _xbt_enforce_ARGN(cond, ...)                                                                                   \
   do {                                                                                                                 \
-    if (!(cond)) {                                                                                                     \
+    if (not(cond)) {                                                                                                   \
       throw simgrid::AssertionError(XBT_THROW_POINT, xbt::string_printf(__VA_ARGS__));                                 \
     }                                                                                                                  \
   } while (0)
index 6a6deb4..38f6869 100644 (file)
@@ -112,7 +112,7 @@ CpuImpl* CpuImpl::set_core_count(int core_count)
 
 void CpuImpl::apply_sharing_policy_cfg() const
 {
-  if (!get_constraint())
+  if (not get_constraint())
     return;
 
   kernel::lmm::Constraint::SharingPolicy lmm_policy = kernel::lmm::Constraint::SharingPolicy::SHARED;
index 10d160a..415f267 100644 (file)
@@ -333,7 +333,7 @@ void sg_config_init(int *argc, char **argv)
       "contexts/nthreads", "Number of parallel threads used to execute user contexts", 1, [](int nthreads) {
 #if HAVE_MMALLOC
         xbt_assert(
-            nthreads == 1 || !malloc_use_mmalloc(),
+            nthreads == 1 || not malloc_use_mmalloc(),
             "Parallel simulation is forbidden in the verified program, as there is no protection against race "
             "conditions in mmalloc itself. Please don't be so greedy and show some mercy for our implementation.");
 #endif
index 723be24..8a46eed 100644 (file)
@@ -118,7 +118,7 @@ bool Request::match_types(MPI_Datatype stype, MPI_Datatype rtype){
      (stype->duplicated_datatype()!=MPI_DATATYPE_NULL && match_types(stype->duplicated_datatype(), rtype)) ||
      (rtype->duplicated_datatype()!=MPI_DATATYPE_NULL && match_types(stype, rtype->duplicated_datatype())))
     match = true;
-  if (!match)
+  if (not match)
     XBT_WARN("Mismatched datatypes : sending %s and receiving %s", stype->name().c_str(), rtype->name().c_str());
   return match;
 }
@@ -150,8 +150,7 @@ bool Request::match_common(MPI_Request req, MPI_Request sender, MPI_Request rece
       receiver->truncated_ = true;
     }
     //0-sized datatypes/counts should not interfere and match
-    if ( sender->real_size_ != 0 && receiver->real_size_ != 0 &&
-         !match_types(sender->type_, receiver->type_))
+    if (sender->real_size_ != 0 && receiver->real_size_ != 0 && not match_types(sender->type_, receiver->type_))
       receiver->unmatched_types_ = true;
     if (sender->detached_)
       receiver->detached_sender_ = sender; // tie the sender to the receiver, as it is detached and has to be freed in
@@ -506,7 +505,7 @@ void Request::start()
         XBT_DEBUG("yes there was something for us in the small mailbox");
       }
     }
-    if(!is_probe)
+    if (not is_probe)
       flags_ &= ~MPI_REQ_PROBE;
     kernel::actor::CommIrecvSimcall observer{process->get_actor()->get_impl(),
                                              mailbox->get_impl(),
@@ -607,7 +606,7 @@ void Request::start()
       } else {
         XBT_DEBUG("Yes there was something for us in the large mailbox");
       }
-      if(!is_probe)
+      if (not is_probe)
         flags_ &= ~MPI_REQ_PROBE;
     } else {
       mailbox = process->mailbox();
index c78dc3c..4540708 100644 (file)
@@ -90,7 +90,7 @@ int Win::del(Win* win){
 
   colls::barrier(win->comm_);
   Comm::unref(win->comm_);
-  if (!win->lockers_.empty() || win->opened_ < 0){
+  if (not win->lockers_.empty() || win->opened_ < 0) {
     XBT_WARN("Freeing a locked or opened window");
     return MPI_ERR_WIN;
   }