include teshsuite/s4u/wait-any-for/wait-any-for.tesh
include teshsuite/simdag/availability/availability.c
include teshsuite/simdag/availability/availability.tesh
-include teshsuite/simdag/basic0/basic0.c
-include teshsuite/simdag/basic0/basic0.tesh
include teshsuite/simdag/basic1/basic1.c
include teshsuite/simdag/basic1/basic1.tesh
include teshsuite/simdag/basic3/basic3.c
<host id="cpu4" speed="1f" />
<host id="cpu5" speed="2f" />
<host id="cpu6" speed="2f" />
+ <host id="cpu7" speed="2f" />
<link id="switch" bandwidth="2Bps" latency="1s" sharing_policy="FATPIPE"/>
<link id="link0" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED"/>
max bw = TCP_gamma / ( 2 * latency ) which is then 1Bps (half the nominal bandwidth) -->
<link id="link5" bandwidth="1Bps" latency="2097152s" sharing_policy="FATPIPE" />
+ <link id="link6" bandwidth="125MBps" latency="100us" sharing_policy="SHARED"/>
+
<route src="cpu0" dst="cpu1">
<link_ctn id="link0"/>
<link_ctn id="switch"/>
<route src="cpu0" dst="cpu6">
<link_ctn id="link5" />
</route>
+ <route src="cpu0" dst="cpu7">
+ <link_ctn id="link6" />
+ </route>
</zone>
</platform>
XBT_INFO("Actual result: 1-byte all-too-all in a parallel communication takes %.2f seconds.",
end_time - start_time);
XBT_INFO("\n");
+
+ sg4::this_actor::sleep_for(5);
+
+ XBT_INFO("TEST: Two concurrent communications, 1 large and 1 small.");
+ XBT_INFO("------------------------------------------------------------");
+ XBT_INFO("A host sends two messages of 100MB and 1B to the other host.");
+ XBT_INFO("Should be done in 0.8001 seconds: 1e8/1.25e8 for transfer + 1e-4 of latency");
+ XBT_INFO("The small communication has a negligible impact on the large one.");
+ XBT_INFO("This corresponds to paying latency once and having the full bandwidth for the large communication.");
+
+ start_time = sg4::Engine::get_clock();
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[7], 1e8);
+ c2 = sg4::Comm::sendto_async(hosts[0], hosts[7], 1.0);
+ c1->wait();
+ c2->wait();
+ end_time = sg4::Engine::get_clock();
+ XBT_INFO("Actual result: 1 small and 1 large concurrent communication takes %.4f seconds.",
+ end_time - start_time);
+ XBT_INFO("\n");
}
int main(int argc, char** argv)
> Each SHARED link is traversed by 6 flows (3 in and 3 out).
> Each 1B transfer thus takes 6 seconds on a 1Bps link
> Actual result: 1-byte all-too-all in a parallel communication takes 8.00 seconds.
+>
+>
+> TEST: Two concurrent communications, 1 large and 1 small.
+> ------------------------------------------------------------
+> A host sends two messages of 100MB and 1B to the other host.
+> Should be done in 0.8001 seconds: 1e8/1.25e8 for transfer + 1e-4 of latency
+> The small communication has a negligible impact on the large one.
+> This corresponds to paying latency once and having the full bandwidth for the large communication.
+> Actual result: 1 small and 1 large concurrent communication takes 0.8001 seconds.
-foreach(x availability basic0 basic1 basic3 basic4 basic5 incomplete)
+foreach(x availability basic1 basic3 basic4 basic5 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})
${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.fail
${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.lat PARENT_SCOPE)
-foreach(x availability basic0 basic1 basic3 basic4 basic5 flatifier incomplete)
+foreach(x availability basic1 basic3 basic4 basic5 flatifier 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()
+++ /dev/null
-/* 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/log.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic0, sd, "SimDag test basic0");
-
-/* Basic SimDag Test 0
- * Scenario:
- * - Create a no-op Init task
- * - Create two communication tasks: 100MB and 1B
- * - Schedule them concurrently on the two hosts of the platform
- * The two communications occur simultaneously but one is so short that it has no impact on the other.
- * Simulated time should be:
- * 1e8/1.25e8 + 1e-4 = 0.8001 seconds
- * This corresponds to paying latency once and having the full bandwidth for the big message.
- */
-int main(int argc, char **argv)
-{
- /* scheduling parameters */
- double communication_amount1[] = { 0, 1e8, 0, 0 };
- double communication_amount2[] = { 0, 1, 0, 0 };
- const double no_cost[] = { 0.0, 0.0 };
-
- /* initialization of SD */
- SD_init(&argc, argv);
-
- /* creation of the environment */
- SD_create_environment(argv[1]);
-
- /* creation of the tasks and their dependencies */
- SD_task_t taskInit = SD_task_create("Init", NULL, 1.0);
- SD_task_t taskA = SD_task_create("Task Comm 1", NULL, 1.0);
- SD_task_t taskB = SD_task_create("Task Comm 2", NULL, 1.0);
-
- SD_task_dependency_add(taskInit, taskA);
- SD_task_dependency_add(taskInit, taskB);
-
- sg_host_t *hosts = sg_host_list();
- SD_task_schedule(taskInit, 1, hosts, no_cost, no_cost, -1.0);
- SD_task_schedule(taskA, 2, hosts, no_cost, communication_amount1, -1.0);
- SD_task_schedule(taskB, 2, hosts, no_cost, communication_amount2, -1.0);
- xbt_free(hosts);
-
- /* let's launch the simulation! */
- SD_simulate(-1.0);
- SD_task_destroy(taskInit);
- SD_task_destroy(taskA);
- SD_task_destroy(taskB);
-
- XBT_INFO("Simulation time: %f", SD_get_clock());
-
- return 0;
-}
+++ /dev/null
-$ ${bindir:=.}/basic0 ../../../examples/platforms/two_hosts_platform_shared.xml "--log=root.fmt:[%10.6r]%e%m%n"
-> [ 0.000000] Switching to the L07 model to handle parallel tasks.
-> [ 0.800100] Simulation time: 0.800100