Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
codefactor: a few more annoying spaces
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 18 Dec 2019 15:22:34 +0000 (16:22 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 18 Dec 2019 15:22:34 +0000 (16:22 +0100)
13 files changed:
examples/s4u/energy-link/s4u-energy-link.cpp
src/bindings/lua/simgrid_lua.cpp
src/kernel/context/ContextSwapped.cpp
src/kernel/lmm/maxmin_test.cpp
src/mc/sosp/Snapshot_test.cpp
src/s4u/s4u_Disk.cpp
src/s4u/s4u_Storage.cpp
src/simdag/sd_global.cpp
src/smpi/bindings/smpi_f77_type.cpp
src/surf/cpu_interface.cpp
src/surf/network_constant.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp

index aba7a9d..f16d10e 100644 (file)
@@ -27,7 +27,6 @@ static void sender(std::vector<std::string> args)
   /* Sleep a while before starting the example */
   simgrid::s4u::this_actor::sleep_for(10);
 
-
   if (flow_amount == 1) {
     /* - Send the task to the @ref worker */
     char* payload = bprintf("%f", comm_size);
@@ -71,7 +70,6 @@ static void receiver(std::vector<std::string> args)
 
 int main(int argc, char* argv[])
 {
-
   simgrid::s4u::Engine e(&argc, argv);
 
   XBT_INFO("Activating the SimGrid link energy plugin");
@@ -92,6 +90,7 @@ int main(int argc, char* argv[])
     argSender.push_back("1"); // Default value
     argReceiver.push_back("1");
   }
+
   if (argc > 3) {
     if (strcmp(argv[3], "random") == 0) { // We're asked to get a random size
       /* Initialize the random number generator */
index 0711115..63d3dd9 100644 (file)
@@ -40,22 +40,22 @@ static int debug(lua_State* L) {
  *
  * - Argument 1 (string): the text to print
  */
-static int info(lua_State* L) {
-
+static int info(lua_State* L)
+{
   const char* str = luaL_checkstring(L, 1);
   XBT_INFO("%s", str);
   return 0;
 }
 
-static int error(lua_State* L) {
-
+static int error(lua_State* L)
+{
   const char* str = luaL_checkstring(L, 1);
   XBT_ERROR("%s", str);
   return 0;
 }
 
-static int critical(lua_State* L) {
-
+static int critical(lua_State* L)
+{
   const char* str = luaL_checkstring(L, 1);
   XBT_CRITICAL("%s", str);
   return 0;
@@ -67,7 +67,8 @@ static int critical(lua_State* L) {
  * This function can be called from within lua via "simgrid.dump(table)". It will
  * then dump the table via XBT_DEBUG
  */
-static int dump(lua_State* L) {
+static int dump(lua_State* L)
+{
   int argc = lua_gettop(L);
 
   for (int i = 1; i <= argc; i++) {
index fbecf2b..03a70bd 100644 (file)
@@ -53,7 +53,6 @@ SwappedContext::SwappedContext(std::function<void()>&& code, smx_actor_t actor,
   if (has_code()) {
     xbt_assert((smx_context_stack_size & 0xf) == 0, "smx_context_stack_size should be multiple of 16");
     if (smx_context_guard_size > 0 && not MC_is_active()) {
-
 #if !defined(PTH_STACKGROWTH) || (PTH_STACKGROWTH != -1)
       xbt_die(
           "Stack overflow protection is known to be broken on your system: you stacks grow upwards (or detection is "
index 79fc3c0..54ad4f4 100644 (file)
@@ -71,7 +71,6 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
 
   SECTION("Consumption weight + variable penalty")
   {
-
     /*
      * Resource proportionality between variable is kept while
      * varying consumption weight
@@ -101,7 +100,6 @@ TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-si
 
   SECTION("Multiple constraints systems")
   {
-
     /*
      * Multiple constraint systems can be solved with shared variables
      *
@@ -151,7 +149,6 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
 
   SECTION("Variable penalty")
   {
-
     /*
      * A variable with a penalty of two get half of the max_share
      *
@@ -181,7 +178,6 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
 
   SECTION("Consumption weight")
   {
-
     /*
      * In a given constraint with all variable penalty to 1,
      * the max_share is affected only by the maximum consumption weight
@@ -212,7 +208,6 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
 
   SECTION("Consumption weight + variable penalty")
   {
-
     /*
      * Resource proportionality between variable is kept but
      * constraint bound can be violated
@@ -243,7 +238,6 @@ TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshare
 
   SECTION("Multiple constraints systems")
   {
-
     /*
      * Multiple constraint systems can be solved with shared variables
      * on unshared constraints.
index cadb7bd..b9d2bde 100644 (file)
@@ -93,7 +93,6 @@ snap_test_helper::prologue_return snap_test_helper::prologue(int n)
 void snap_test_helper::read_whole_region()
 {
   for (int n = 1; n != 32; ++n) {
-
     prologue_return ret = prologue(n);
     const void* read    = ret.region->read(ret.dstn, ret.src, ret.size);
     INFO("Mismatch in MC_region_read()");
@@ -109,7 +108,6 @@ void snap_test_helper::read_whole_region()
 void snap_test_helper::read_region_parts()
 {
   for (int n = 1; n != 32; ++n) {
-
     prologue_return ret = prologue(n);
 
     for (int j = 0; j != 100; ++j) {
@@ -145,7 +143,6 @@ void snap_test_helper::compare_whole_region()
 void snap_test_helper::compare_region_parts()
 {
   for (int n = 1; n != 32; ++n) {
-
     prologue_return ret = prologue(n);
 
     for (int j = 0; j != 100; ++j) {
@@ -165,7 +162,6 @@ void snap_test_helper::compare_region_parts()
 
 void snap_test_helper::read_pointer()
 {
-
   prologue_return ret = prologue(1);
   memcpy(ret.src, &mc_model_checker, sizeof(void*));
   simgrid::mc::Region* region2 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, ret.src, ret.size);
@@ -183,7 +179,6 @@ void snap_test_helper::read_pointer()
 
 TEST_CASE("MC::Snapshot: A copy/snapshot of a given memory region", "MC::Snapshot")
 {
-
   INFO("Sparse snapshot (using pages)");
 
   snap_test_helper::Init();
index 153a65c..806e090 100644 (file)
@@ -67,7 +67,6 @@ sg_size_t Disk::read(sg_size_t size)
 
 IoPtr Disk::write_async(sg_size_t size)
 {
-
   return IoPtr(io_init(size, Io::OpType::WRITE)->start());
 }
 
index 59667fd..ba76eac 100644 (file)
@@ -73,7 +73,6 @@ sg_size_t Storage::read(sg_size_t size)
 
 IoPtr Storage::write_async(sg_size_t size)
 {
-
   return IoPtr(io_init(size, Io::OpType::WRITE)->start());
 }
 
index a862ecc..b092071 100644 (file)
@@ -33,7 +33,6 @@ std::set<SD_task_t>* simulate(double how_long){
   /* main loop */
   while (elapsed_time >= 0 && (how_long < 0 || 0.00001 < (how_long - total_time)) &&
          not sd_global->watch_point_reached) {
-
     XBT_DEBUG("Total time: %f", total_time);
 
     elapsed_time = surf_solve(how_long > 0 ? surf_get_clock() + how_long - total_time: -1.0);
index aefbf60..30792c7 100644 (file)
@@ -83,13 +83,14 @@ void mpi_type_free_keyval_ (int* keyval, int* ierr) {
  *ierr = MPI_Type_free_keyval( keyval);
 }
 
-void mpi_type_get_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
-
- *ierr = MPI_Type_get_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
+void mpi_type_get_extent_(int* datatype, MPI_Aint* lb, MPI_Aint* extent, int* ierr)
+{
 *ierr = MPI_Type_get_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
 }
 
-void mpi_type_get_true_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
- *ierr = MPI_Type_get_true_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
+void mpi_type_get_true_extent_(int* datatype, MPI_Aint* lb, MPI_Aint* extent, int* ierr)
+{
+  *ierr = MPI_Type_get_true_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
 }
 
 void mpi_type_commit_(int* datatype,  int* ierr){
index 606961a..5ecb98a 100644 (file)
@@ -25,7 +25,6 @@ namespace resource {
 void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
 {
   while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
-
     auto* action = static_cast<CpuAction*>(get_action_heap().pop());
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
 
index d13d0bc..4709ca2 100644 (file)
@@ -30,7 +30,6 @@ NetworkConstantModel::NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::F
 LinkImpl* NetworkConstantModel::create_link(const std::string& name, const std::vector<double>& /*bandwidth*/,
                                             double /*latency*/, s4u::Link::SharingPolicy)
 {
-
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
           "Please remove any link from your platform (and switch to routing='None')",
           name.c_str());
index 48d21ac..364b4e1 100644 (file)
@@ -23,10 +23,8 @@ static std::default_random_engine rnd_engine;
 
 static simgrid::mc::RemoteClient* process;
 
-static
-uintptr_t eval_binary_operation(
-  simgrid::dwarf::ExpressionContext& state, int op, uintptr_t a, uintptr_t b) {
-
+static uintptr_t eval_binary_operation(simgrid::dwarf::ExpressionContext& state, int op, uintptr_t a, uintptr_t b)
+{
   Dwarf_Op ops[15];
   ops[0].atom = DW_OP_const8u;
   ops[0].number = a;
@@ -45,105 +43,101 @@ uintptr_t eval_binary_operation(
   return stack.top();
 }
 
-static
-void basic_test(simgrid::dwarf::ExpressionContext const& state) {
+static void basic_test(simgrid::dwarf::ExpressionContext const& state)
+{
   try {
+    Dwarf_Op ops[60];
 
-  Dwarf_Op ops[60];
+    uintptr_t a = rnd_engine();
+    uintptr_t b = rnd_engine();
 
-  uintptr_t a = rnd_engine();
-  uintptr_t b = rnd_engine();
+    simgrid::dwarf::ExpressionStack stack;
 
-  simgrid::dwarf::ExpressionStack stack;
+    bool caught_ex = false;
+    try {
+      ops[0].atom = DW_OP_drop;
+      simgrid::dwarf::execute(ops, 1, state, stack);
+    } catch (const simgrid::dwarf::evaluation_error&) {
+      caught_ex = true;
+    }
+    if (not caught_ex)
+      fprintf(stderr, "Exception expected");
 
-  bool caught_ex = false;
-  try {
-    ops[0].atom = DW_OP_drop;
+    ops[0].atom = DW_OP_lit21;
     simgrid::dwarf::execute(ops, 1, state, stack);
-  } catch (const simgrid::dwarf::evaluation_error&) {
-    caught_ex = true;
-  }
-  if (not caught_ex)
-    fprintf(stderr, "Exception expected");
-
-  ops[0].atom = DW_OP_lit21;
-  simgrid::dwarf::execute(ops, 1, state, stack);
-  assert(stack.size() == 1);
-  assert(stack.top() == 21);
-
-  ops[0].atom = DW_OP_const8u;
-  ops[0].number = a;
-  simgrid::dwarf::execute(ops, 1, state, stack);
-  assert(stack.size() == 2);
-  assert(stack.top() == a);
-
-  ops[0].atom = DW_OP_drop;
-  ops[1].atom = DW_OP_drop;
-  simgrid::dwarf::execute(ops, 2, state, stack);
-  assert(stack.empty());
-
-  stack.clear();
-  ops[0].atom = DW_OP_lit21;
-  ops[1].atom = DW_OP_plus_uconst;
-  ops[1].number = a;
-  simgrid::dwarf::execute(ops, 2, state, stack);
-  assert(stack.size() == 1);
-  assert(stack.top() == a + 21);
-
-  stack.clear();
-  ops[0].atom = DW_OP_const8u;
-  ops[0].number = a;
-  ops[1].atom = DW_OP_dup;
-  ops[2].atom = DW_OP_plus;
-  simgrid::dwarf::execute(ops, 3, state, stack);
-  assert(stack.size() == 1);
-  assert(stack.top() == a + a);
+    assert(stack.size() == 1);
+    assert(stack.top() == 21);
 
-  stack.clear();
-  ops[0].atom = DW_OP_const8u;
-  ops[0].number = a;
-  ops[1].atom = DW_OP_const8u;
-  ops[1].number = b;
-  ops[2].atom = DW_OP_over;
-  simgrid::dwarf::execute(ops, 3, state, stack);
-  assert(stack.size() == 3);
-  assert(stack.top()  == a);
-  assert(stack.top(1) == b);
-  assert(stack.top(2) == a);
-
-  stack.clear();
-  ops[0].atom = DW_OP_const8u;
-  ops[0].number = a;
-  ops[1].atom = DW_OP_const8u;
-  ops[1].number = b;
-  ops[2].atom = DW_OP_swap;
-  simgrid::dwarf::execute(ops, 3, state, stack);
-  assert(stack.size() == 2);
-  assert(stack.top()  == a);
-  assert(stack.top(1) == b);
+    ops[0].atom   = DW_OP_const8u;
+    ops[0].number = a;
+    simgrid::dwarf::execute(ops, 1, state, stack);
+    assert(stack.size() == 2);
+    assert(stack.top() == a);
 
+    ops[0].atom = DW_OP_drop;
+    ops[1].atom = DW_OP_drop;
+    simgrid::dwarf::execute(ops, 2, state, stack);
+    assert(stack.empty());
+
+    stack.clear();
+    ops[0].atom   = DW_OP_lit21;
+    ops[1].atom   = DW_OP_plus_uconst;
+    ops[1].number = a;
+    simgrid::dwarf::execute(ops, 2, state, stack);
+    assert(stack.size() == 1);
+    assert(stack.top() == a + 21);
+
+    stack.clear();
+    ops[0].atom   = DW_OP_const8u;
+    ops[0].number = a;
+    ops[1].atom   = DW_OP_dup;
+    ops[2].atom   = DW_OP_plus;
+    simgrid::dwarf::execute(ops, 3, state, stack);
+    assert(stack.size() == 1);
+    assert(stack.top() == a + a);
+
+    stack.clear();
+    ops[0].atom   = DW_OP_const8u;
+    ops[0].number = a;
+    ops[1].atom   = DW_OP_const8u;
+    ops[1].number = b;
+    ops[2].atom   = DW_OP_over;
+    simgrid::dwarf::execute(ops, 3, state, stack);
+    assert(stack.size() == 3);
+    assert(stack.top() == a);
+    assert(stack.top(1) == b);
+    assert(stack.top(2) == a);
+
+    stack.clear();
+    ops[0].atom   = DW_OP_const8u;
+    ops[0].number = a;
+    ops[1].atom   = DW_OP_const8u;
+    ops[1].number = b;
+    ops[2].atom   = DW_OP_swap;
+    simgrid::dwarf::execute(ops, 3, state, stack);
+    assert(stack.size() == 2);
+    assert(stack.top() == a);
+    assert(stack.top(1) == b);
   } catch (const simgrid::dwarf::evaluation_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 }
 
-static
-void test_deref(simgrid::dwarf::ExpressionContext const& state) {
+static void test_deref(simgrid::dwarf::ExpressionContext const& state)
+{
   try {
+    uintptr_t foo = 42;
 
-  uintptr_t foo = 42;
+    Dwarf_Op ops[60];
+    ops[0].atom   = DW_OP_const8u;
+    ops[0].number = (uintptr_t)&foo;
+    ops[1].atom   = DW_OP_deref;
 
-  Dwarf_Op ops[60];
-  ops[0].atom = DW_OP_const8u;
-  ops[0].number = (uintptr_t) &foo;
-  ops[1].atom = DW_OP_deref;
-
-  simgrid::dwarf::ExpressionStack stack;
-
-  simgrid::dwarf::execute(ops, 2, state, stack);
-  assert(stack.size() == 1);
-  assert(stack.top()  == foo);
+    simgrid::dwarf::ExpressionStack stack;
 
+    simgrid::dwarf::execute(ops, 2, state, stack);
+    assert(stack.size() == 1);
+    assert(stack.top() == foo);
   } catch (const simgrid::dwarf::evaluation_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
index 4803505..79efb8a 100644 (file)
@@ -84,7 +84,6 @@ static void get_set_disk_data(simgrid::s4u::Disk* disk)
 
 static void dump_platform_disks()
 {
-
   for (auto const& h : simgrid::s4u::Engine::get_instance()->get_all_hosts())
     for (auto const& d : h->get_disks()) {
       if (h == d->get_host())