Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert one more simdag test
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 18 Feb 2021 08:31:34 +0000 (09:31 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 18 Feb 2021 10:15:57 +0000 (11:15 +0100)
teshsuite/models/ptask_L07/ptask_L07.cpp
teshsuite/models/ptask_L07/ptask_L07.tesh
teshsuite/simdag/CMakeLists.txt
teshsuite/simdag/basic6/basic6.c [deleted file]
teshsuite/simdag/basic6/basic6.tesh [deleted file]

index 750ce1f..c98ac08 100644 (file)
@@ -31,6 +31,21 @@ static void main_dispatcher()
 
   sg4::this_actor::sleep_for(5);
 
+  XBT_INFO("TEST: Create and run two concurrent sequential executions.");
+  XBT_INFO("------------------------------------------------------------");
+  XBT_INFO("Have to compute 2 x 1 flop on a 1 flop/s host.");
+  XBT_INFO("Should be done in exactly 2 seconds because of sharing.");
+  start_time = e->get_clock();
+  sg4::ExecPtr e1 = sg4::Exec::init()->set_flops_amount(1)->set_host(hosts[0])->start();
+  sg4::ExecPtr e2 = sg4::Exec::init()->set_flops_amount(1)->set_host(hosts[0])->start();
+  e1->wait();
+  e2->wait();
+  end_time = e->get_clock();
+  XBT_INFO("Actual result: computing 2x1 flop at 1 flop/s takes %.2f seconds.", end_time - start_time);
+  XBT_INFO("\n");
+
+  sg4::this_actor::sleep_for(5);
+
   XBT_INFO("TEST: Create and run a parallel execution on 2 homogeneous hosts.");
   XBT_INFO("------------------------------------------------------------");
   XBT_INFO("Have to compute 2 flops across two hosts running at 1 flop/s.");
index 7c0c9c1..2548b95 100644 (file)
@@ -10,6 +10,13 @@ $ ${bindir:=.}/ptask_L07 --cfg=host/model:ptask_L07 ${platfdir}/ptask_L07.xml --
 > Actual result: computing 1 flop at 1 flop/s takes 1.00 seconds.
 >
 >
+> TEST: Create and run two concurrent sequential executions.
+> ------------------------------------------------------------
+> Have to compute 2 x 1 flop on a 1 flop/s host.
+> Should be done in exactly 2 seconds because of sharing.
+> Actual result: computing 2x1 flop at 1 flop/s takes 2.00 seconds.
+>
+>
 > TEST: Create and run a parallel execution on 2 homogeneous hosts.
 > ------------------------------------------------------------
 > Have to compute 2 flops across two hosts running at 1 flop/s.
index 9aa903e..ee04ffd 100644 (file)
@@ -1,4 +1,4 @@
-foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 comm-p2p-latency-bound incomplete)
+foreach(x availability basic0 basic1 basic3 basic4 basic5 comm-p2p-latency-bound incomplete)
   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.c)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -56,7 +56,7 @@ set(txt_files     ${txt_files}      ${CMAKE_CURRENT_SOURCE_DIR}/platforms/carol.
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.fail
                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.lat                         PARENT_SCOPE)
 
-foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 flatifier comm-p2p-latency-bound incomplete)
+foreach(x availability basic0 basic1 basic3 basic4 basic5 flatifier comm-p2p-latency-bound incomplete)
   ADD_TESH(tesh-simdag-${x} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/${x} ${x}.tesh)
 endforeach()
 
diff --git a/teshsuite/simdag/basic6/basic6.c b/teshsuite/simdag/basic6/basic6.c
deleted file mode 100644 (file)
index 0f32374..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (c) 2007-2021. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/simdag.h"
-#include "xbt/asserts.h"
-#include "xbt/log.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic6, sd, "SimDag test basic6");
-/* test scheduling 2 tasks at the same time without artificial dependencies */
-
-/* Basic SimDag Test 6
- * Scenario:
- *   - Schedule two parallel tasks concurrently on a P2P platform
- *   - Hosts computes 1B per second
- * Computing power is shared between tasks.
- * Simulated time should be:
- *          1/(1/2) = 2 seconds
- */
-
-int main(int argc, char **argv)
-{
-  double comm_cost[] = { 0.0, 0.0, 0.0, 0.0 };
-  double comp_cost[] = { 1.0 };
-  xbt_dynar_t ret    = xbt_dynar_new(sizeof(SD_task_t), NULL);
-
-  SD_init(&argc, argv);
-  SD_create_environment(argv[1]);
-
-  SD_task_t taskA = SD_task_create("Task A", NULL, 1.0);
-  SD_task_t taskB = SD_task_create("Task B", NULL, 1.0);
-
-  sg_host_t *hosts = sg_host_list();
-  SD_task_schedule(taskA, 1, hosts, comp_cost, comm_cost, -1.0);
-  SD_task_schedule(taskB, 1, hosts, comp_cost, comm_cost, -1.0);
-  xbt_free(hosts);
-
-  SD_simulate_with_update(-1.0, ret);
-  xbt_assert(xbt_dynar_length(ret) == 2, "I was expecting the completion of 2 tasks, but I got %lu instead",
-             xbt_dynar_length(ret));
-  SD_task_destroy(taskA);
-  SD_task_destroy(taskB);
-  xbt_dynar_free(&ret);
-
-  XBT_INFO("Simulation time: %f", SD_get_clock());
-
-  return 0;
-}
diff --git a/teshsuite/simdag/basic6/basic6.tesh b/teshsuite/simdag/basic6/basic6.tesh
deleted file mode 100644 (file)
index c249b2a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-$ ${bindir:=.}/basic6 ../platforms/platform_2p_1sl.xml "--log=root.fmt:[%10.6r]%e%m%n"
-> [  0.000000] Switching to the L07 model to handle parallel tasks.
-> [  2.000000] Simulation time: 2.000000