Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics: fix "Malformed whitespace in C++" spotted by codefactor.io.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 31 Jan 2020 09:49:53 +0000 (10:49 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 31 Jan 2020 09:50:15 +0000 (10:50 +0100)
37 files changed:
contrib/benchmarking_code_block/bench.h
docs/source/tuto_s4u/master-workers-lab1.cpp
docs/source/tuto_s4u/master-workers-lab2.cpp
examples/deprecated/msg/dht-kademlia/node.h
examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
examples/s4u/app-bittorrent/s4u-peer.hpp
examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp
examples/s4u/async-waituntil/s4u-async-waituntil.cpp
examples/smpi/smpi_s4u_masterslave/masterslave_mailbox_smpi.cpp
include/simgrid/kernel/routing/NetPoint.hpp
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/simix/blocking_simcall.hpp
include/xbt/future.hpp
src/bindings/lua/lua_utils.cpp
src/bindings/lua/simgrid_lua.cpp
src/instr/instr_paje_containers.hpp
src/kernel/context/ContextBoost.cpp
src/kernel/resource/profile/Profile_test.cpp
src/kernel/routing/ClusterZone.cpp
src/mc/AddressSpace.hpp
src/mc/ModelChecker.hpp
src/mc/checker/Checker.hpp
src/mc/checker/CommunicationDeterminismChecker.hpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_global.cpp
src/mc/mc_record.cpp
src/mc/mc_smx.cpp
src/mc/sosp/ChunkedData.cpp
src/mc/sosp/Snapshot_test.cpp
src/msg/msg_global.cpp
src/surf/network_ib.hpp
src/surf/ns3/ns3_simulator.cpp
src/xbt/config_test.cpp
src/xbt/mmalloc/mmprivate.h
src/xbt/xbt_str_test.cpp
teshsuite/surf/surf_usage/surf_usage.cpp

index 81b862e..f458b60 100644 (file)
@@ -61,7 +61,6 @@ static inline void xbt_bench_init(char *tracefile)
        mybench->output = fopen(tracefile, "a+");
        if (mybench->output == NULL)
                printf("Error while opening the tracefile");
-
 }
 
 /* Initializing StarPU benchmarking */
@@ -72,7 +71,6 @@ static inline void bench_init_starpu(char *tracefile, bench_t *bench)
   mybench->output = fopen(tracefile, "a+");
   if (mybench->output == NULL)
                printf("Error while opening the tracefile");
-
 }
 
 /* Start benchmarking using macros */
index b6505ba..c71c60b 100644 (file)
@@ -64,7 +64,6 @@ static void worker(std::vector<std::string> args)
 
     if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
       simgrid::s4u::this_actor::execute(compute_cost);
-
   } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
 
   XBT_INFO("Exiting now.");
index 64176fa..573c5f3 100644 (file)
@@ -29,7 +29,6 @@ static void worker()
 
     if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
       simgrid::s4u::this_actor::execute(compute_cost);
-
   } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
 
   XBT_INFO("Exiting now.");
index 0a33730..f67f2cf 100644 (file)
@@ -32,7 +32,6 @@ typedef struct s_node {
   char mailbox[MAILBOX_NAME_SIZE];      //node mailbox
   unsigned int find_node_success;       //Number of find_node which have succeeded.
   unsigned int find_node_failed;        //Number of find_node which have failed.
-
 } s_node_t;
 
 typedef s_node_t *node_t;
index d53a4ad..00c1ea4 100644 (file)
@@ -12,7 +12,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific for this s4u example");
 
 /* This actor just sleeps until termination */
 class sleeper {
-
 public:
   explicit sleeper(std::vector<std::string> /*args*/)
   {
index e828e1d..9b912bb 100644 (file)
@@ -44,6 +44,7 @@ class Peer {
 
   simgrid::s4u::CommPtr comm_received = nullptr; // current comm
   Message* message                    = nullptr; // current message being received
+
 public:
   explicit Peer(std::vector<std::string> args);
   Peer(const Peer&) = delete;
index cf43661..d37a880 100644 (file)
@@ -73,7 +73,6 @@ public:
 
       if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
         simgrid::s4u::this_actor::execute(compute_cost);
-
     } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
 
     XBT_INFO("Exiting now.");
index 3b2975b..ae9039f 100644 (file)
@@ -28,11 +28,11 @@ static int sender(int argc, char** argv)
 
   /* Start dispatching all messages to receivers, in a round robin fashion */
   for (int i = 0; i < messages_count; i++) {
-
     std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
     simgrid::s4u::Mailbox* mbox   = simgrid::s4u::Mailbox::by_name(mboxName);
     std::string msgName           = std::string("Message ") + std::to_string(i);
     std::string* payload          = new std::string(msgName); // copy the data we send:
+
     // 'msgName' is not a stable storage location
     XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
     /* Create a communication representing the ongoing communication */
index 1e583ce..14d72a3 100644 (file)
@@ -56,7 +56,6 @@ static void worker(std::vector<std::string> args)
 
     if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
       simgrid::s4u::this_actor::execute(compute_cost);
-
   } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
 
   XBT_INFO("Exiting now.");
index bddc556..39b74e3 100644 (file)
@@ -25,7 +25,6 @@ namespace routing {
  * @details This represents a position in the network. One can send information between two netpoints
  */
 class NetPoint : public simgrid::xbt::Extendable<NetPoint> {
-
 public:
   enum class Type { Host, Router, NetZone };
 
index 33753de..1757964 100644 (file)
@@ -115,6 +115,7 @@ public:
   }
   friend void intrusive_ptr_add_ref(Activity* a) { a->refcount_.fetch_add(1, std::memory_order_relaxed); }
 #endif
+
 private:
   kernel::activity::ActivityImplPtr pimpl_ = nullptr;
   Activity::State state_                   = Activity::State::INITED;
index 3247dff..9d4c46d 100644 (file)
@@ -38,6 +38,7 @@ public:
 
 protected:
   virtual ~Storage() = default;
+
 public:
   /** @brief Callback signal fired when a new Storage is created */
   static xbt::signal<void(Storage&)> on_creation;
index 973ead8..c4d550d 100644 (file)
@@ -135,6 +135,7 @@ public:
         },
         nullptr);
   }
+
 private:
   // We wrap an event-based kernel future:
   simgrid::kernel::Future<T> future_;
index 1dccc74..ac75bf6 100644 (file)
@@ -70,6 +70,7 @@ public:
         throw std::future_error(std::future_errc::no_state);
     }
   }
+
 private:
   boost::variant<boost::blank, T, std::exception_ptr> value_;
 };
index 1bb9e9c..952f4de 100644 (file)
  */
 const char* sglua_tostring(lua_State* L, int index)
 {
-
   static char buff[64];
 
   switch (lua_type(L, index)) {
-
     case LUA_TNIL:
       snprintf(buff, 4, "nil");
       break;
@@ -87,7 +85,6 @@ const char* sglua_tostring(lua_State* L, int index)
  */
 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index)
 {
-
   static char buff[64];
   /* value_tostring also always returns the same pointer */
   int len = snprintf(buff, 63, "[%s] -> ", sglua_tostring(L, key_index));
index e96c079..7a0f6f9 100644 (file)
@@ -26,8 +26,8 @@ extern "C" int luaopen_simgrid(lua_State* L);
  *
  * - Argument 1 (string): the text to print
  */
-static int debug(lua_State* L) {
-
+static int debug(lua_State* L)
+{
   const char* str = luaL_checkstring(L, 1);
   XBT_DEBUG("%s", str);
   return 0;
index 4a76b0c..952f7d9 100644 (file)
@@ -19,6 +19,7 @@ class VariableType;
 class Container {
   long long int id_;
   std::string name_; /* Unique name of this container */
+
 public:
   Container(const std::string& name, const std::string& type_name, Container* father);
   Container(const Container&) = delete;
index 9d275c2..d79a549 100644 (file)
@@ -24,7 +24,6 @@ BoostContext* BoostContextFactory::create_context(std::function<void()>&& code,
 BoostContext::BoostContext(std::function<void()>&& code, actor::ActorImpl* actor, SwappedContextFactory* factory)
     : SwappedContext(std::move(code), actor, factory)
 {
-
   /* if the user provided a function for the process then use it, otherwise it is the context for maestro */
   if (has_code()) {
 #if BOOST_VERSION < 106100
index c60517a..5243791 100644 (file)
@@ -65,7 +65,6 @@ static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char
 
 TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
 {
-
   SECTION("No event, no loop")
   {
     std::vector<simgrid::kernel::profile::DatedValue> got = trace2vector("");
@@ -96,7 +95,6 @@ TEST_CASE("kernel::profile: Resource profiles, defining the external load", "ker
 
   SECTION("Three events, no loop")
   {
-
     std::vector<simgrid::kernel::profile::DatedValue> got = trace2vector("3.0 1.0\n"
                                                                          "5.0 2.0\n"
                                                                          "9.0 3.0\n");
index 860786e..21c4b65 100644 (file)
@@ -62,9 +62,9 @@ void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
   }
 
   if (not dst->is_router()) { // No specific link for router
-
     std::pair<resource::LinkImpl*, resource::LinkImpl*> info =
         private_links_.at(node_pos_with_loopback_limiter(dst->id()));
+
     if (info.second) { // link down
       route->link_list.push_back(info.second);
       if (lat)
index 8701fa2..6a5392c 100644 (file)
@@ -21,6 +21,7 @@ namespace mc {
 class ReadOptions {
   std::uint32_t value_ = 0;
   constexpr explicit ReadOptions(std::uint32_t value) : value_(value) {}
+
 public:
   constexpr ReadOptions() {}
 
@@ -132,7 +133,6 @@ public:
     this->read_bytes(&res[0], len, address);
     return res;
   }
-
 };
 
 }
index 53ff36b..0f33b43 100644 (file)
@@ -30,8 +30,8 @@ class ModelChecker {
   PageStore page_store_{500};
   std::unique_ptr<RemoteClient> process_;
   Checker* checker_ = nullptr;
-public:
 
+public:
   ModelChecker(ModelChecker const&) = delete;
   ModelChecker& operator=(ModelChecker const&) = delete;
   explicit ModelChecker(std::unique_ptr<RemoteClient> process);
index 8527b76..c9ff833 100644 (file)
@@ -29,6 +29,7 @@ namespace mc {
 // abstract
 class Checker {
   Session* session_;
+
 public:
   explicit Checker(Session& session);
 
index a9d50e6..1701a28 100644 (file)
@@ -30,6 +30,7 @@ private:
   void log_state() override;
   void deterministic_comm_pattern(int process, const simgrid::mc::PatternCommunication* comm, int backtracking);
   void restoreState();
+
 public:
   // These are used by functions which should be moved in CommunicationDeterminismChecker:
   void get_comm_pattern(smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
index db46857..9a3d3b5 100644 (file)
@@ -78,5 +78,4 @@ void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t req, int v
   default:
     xbt_die("Unexpected call type %i", (int)call_type);
   }
-
 }
index 2bfdb0c..4d6c6e3 100644 (file)
@@ -69,7 +69,6 @@ void MC_init_dot_output()
 
   fprintf(dot_output,
           "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
-
 }
 
 /*******************************  Core of MC *******************************/
index bdd03aa..78e34fe 100644 (file)
@@ -63,9 +63,9 @@ RecordTrace parseRecordTrace(const char* data)
 
   const char* current = data;
   while (*current) {
-
     simgrid::mc::Transition item;
     int count = sscanf(current, "%d/%d", &item.pid_, &item.argument_);
+
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
     res.push_back(item);
index af66ee9..f72a03b 100644 (file)
@@ -45,8 +45,8 @@ static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteClient
 
   // Load each element of the vector from the MCed process:
   for (unsigned int i = 0; i < dynar.used; ++i) {
-
     simgrid::mc::ActorInformation info;
+
     info.address  = simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl>(data[i]);
     info.hostname = nullptr;
     process->read_bytes(&info.copy, sizeof(info.copy), remote(data[i]));
index ef35495..f93c4e2 100644 (file)
@@ -22,7 +22,6 @@ ChunkedData::ChunkedData(PageStore& store, const AddressSpace& as, RemotePtr<voi
   std::vector<char> buffer(xbt_pagesize);
 
   for (size_t i = 0; i != page_count; ++i) {
-
     RemotePtr<void> page = remote((void*)simgrid::mc::mmu::join(i, addr.address()));
     xbt_assert(simgrid::mc::mmu::split(page.address()).second == 0, "Not at the beginning of a page");
 
index 942e88f..36a7298 100644 (file)
@@ -127,7 +127,6 @@ void snap_test_helper::read_region_parts()
 void snap_test_helper::compare_whole_region()
 {
   for (int n = 1; n != 32; ++n) {
-
     prologue_return ret = prologue(n);
 
     INFO("Unexpected match in MC_snapshot_region_memcmp() with previous snapshot");
index 6d4b18e..c5004ba 100644 (file)
@@ -26,8 +26,8 @@ static void MSG_exit();
  * @brief Initialize MSG with less verifications
  * You should use the MSG_init() function instead. Failing to do so may turn into PEBKAC some day. You've been warned.
  */
-void MSG_init_nocheck(int *argc, char **argv) {
-
+void MSG_init_nocheck(int* argc, char** argv)
+{
   TRACE_global_init();
 
   if (not msg_global) {
@@ -58,12 +58,14 @@ void MSG_init_nocheck(int *argc, char **argv) {
     atexit(MSG_exit);
 }
 
-void MSG_config(const char *key, const char *value){
+void MSG_config(const char* key, const char* value)
+{
   xbt_assert(msg_global,"ERROR: Please call MSG_init() before using MSG_config()");
   simgrid::config::set_as_string(key, value);
 }
 
-static void MSG_exit() {
+static void MSG_exit()
+{
   delete msg_global;
   msg_global = nullptr;
 }
index 8df5bc0..4b14ff2 100644 (file)
@@ -54,7 +54,6 @@ public:
 
   std::unordered_map<std::string, IBNode> active_nodes;
   std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
-
 };
 } // namespace resource
 } // namespace kernel
index 180d0a4..ebff56b 100644 (file)
@@ -67,9 +67,9 @@ static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t txSpace)
 
   /* While not all is buffered and there remain space in the buffers */
   while (flow->buffered_bytes_ < flow->total_bytes_ && sock->GetTxAvailable() > 0) {
-
     // Send at most 1040 bytes (data size in a TCP packet), as ns-3 seems to not split correctly by itself
     uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable(), std::uint32_t(1040)});
+
     if (toWrite == 0) { // buffer full
       XBT_DEBUG("%f: buffer full on flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), flow,
                 flow->remaining_);
index e9c2856..b480f5b 100644 (file)
@@ -25,7 +25,6 @@ static void make_set()
 
 TEST_CASE("xbt::config: Configuration support", "config")
 {
-
   SECTION("Alloc and free a config set")
   {
     auto temp = simgrid_config;
index 63ccf0f..2d7af4a 100644 (file)
@@ -176,7 +176,6 @@ typedef struct {
  * if such a file exists.
  * */
 struct mdesc {
-
   /** @brief Mutex locking the access to the heap */
   pthread_mutex_t mutex;
 
@@ -261,7 +260,6 @@ struct mdesc {
 
   /* @brief Instrumentation */
   struct mstats heapstats;
-
 };
 
 /* Bits to look at in the malloc descriptor flags word */
index e7d70b0..6a3bc60 100644 (file)
@@ -43,7 +43,6 @@ template <typename F, typename T> void test_parse_ok(F function, const std::stri
 
 TEST_CASE("xbt::str: String Handling", "xbt_str")
 {
-
   SECTION("Test the function xbt_str_split_quoted")
   {
     test_split_quoted("Empty", "", {});
index e1b96f9..35009f9 100644 (file)
@@ -99,7 +99,6 @@ int main(int argc, char **argv)
       XBT_DEBUG("\t * Done : %p", &action);
       action.unref();
     }
-
   } while (
       (surf_network_model->get_started_action_set()->size() || surf_cpu_model_pm->get_started_action_set()->size()) &&
       surf_solve(-1.0) >= 0.0);