include teshsuite/simdag/basic5/basic5.tesh
include teshsuite/simdag/basic6/basic6.c
include teshsuite/simdag/basic6/basic6.tesh
-include teshsuite/simdag/comm-mxn-all2all/comm-mxn-all2all.c
-include teshsuite/simdag/comm-mxn-all2all/comm-mxn-all2all.tesh
-include teshsuite/simdag/comm-mxn-independent/comm-mxn-independent.c
-include teshsuite/simdag/comm-mxn-independent/comm-mxn-independent.tesh
-include teshsuite/simdag/comm-mxn-scatter/comm-mxn-scatter.c
-include teshsuite/simdag/comm-mxn-scatter/comm-mxn-scatter.tesh
include teshsuite/simdag/comm-p2p-latency-bound/comm-p2p-latency-bound.c
include teshsuite/simdag/comm-p2p-latency-bound/comm-p2p-latency-bound.tesh
include teshsuite/simdag/flatifier/bogus_missing_gateway.tesh
<zone id="AS0" routing="Full">
<host id="cpu0" speed="1f" />
<host id="cpu1" speed="1f" />
- <host id="cpu2" speed="2f" />
+ <host id="cpu2" speed="1f"/>
+ <host id="cpu3" speed="1f"/>
+ <host id="cpu4" speed="1f" />
+ <host id="cpu5" speed="2f" />
<link id="switch" bandwidth="2Bps" latency="1s" sharing_policy="FATPIPE"/>
- <link id="link0" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED" />
- <link id="link1" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED" />
- <link id="link2" bandwidth="1Bps" latency="500ms" sharing_policy="FATPIPE" />
+ <link id="link0" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED"/>
+ <link id="link1" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED"/>
+ <link id="link2" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED"/>
+ <link id="link3" bandwidth="1Bps" latency="500ms" sharing_policy="SHARED"/>
+ <link id="link4" bandwidth="1Bps" latency="500ms" sharing_policy="FATPIPE" />
<route src="cpu0" dst="cpu1">
- <link_ctn id="link0" />
+ <link_ctn id="link0"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link1"/>
</route>
<route src="cpu0" dst="cpu2">
- <link_ctn id="link2" />
+ <link_ctn id="link0"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link2"/>
+ </route>
+ <route src="cpu0" dst="cpu3">
+ <link_ctn id="link0"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link3"/>
</route>
<route src="cpu1" dst="cpu2">
+ <link_ctn id="link1"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link2"/>
+ </route>
+ <route src="cpu1" dst="cpu3">
+ <link_ctn id="link1"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link3"/>
+ </route>
+ <route src="cpu2" dst="cpu3">
+ <link_ctn id="link2"/>
+ <link_ctn id="switch"/>
+ <link_ctn id="link3"/>
+ </route>
+
+ <route src="cpu0" dst="cpu4">
<link_ctn id="link0" />
- <link_ctn id="switch" />
- <link_ctn id="link1" />
+ </route>
+ <route src="cpu0" dst="cpu5">
+ <link_ctn id="link4" />
</route>
</zone>
</platform>
XBT_INFO("Should be done in exactly one second.");
start_time = e->get_clock();
sg4::Exec::init()->set_flops_amounts(std::vector<double>({1.0, 1.0}))
- ->set_hosts(std::vector<sg4::Host*>({hosts[1], hosts[2]}))
+ ->set_hosts(std::vector<sg4::Host*>({hosts[0], hosts[5]}))
->wait();
end_time = e->get_clock();
XBT_INFO("Actual result: computing 2 flops on 2 heterogeneous hosts takes %.2f seconds.", end_time - start_time);
XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert).");
start_time = e->get_clock();
- sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0)->wait();
+ sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0)->wait();
end_time = e->get_clock();
XBT_INFO("Actual result: sending 1 byte on a shared link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time);
XBT_INFO("\n");
XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert).");
start_time = e->get_clock();
- sg4::Comm::sendto_async(hosts[0], hosts[2], 1.0)->wait();
+ sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0)->wait();
end_time = e->get_clock();
XBT_INFO("Actual result: sending 1 byte on a fatpipe link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time);
XBT_INFO("\n");
XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 2 x 500ms + 1s.");
XBT_INFO("Should be done in 3 seconds (2 x 500ms + 1s latency + 1s transfert).");
start_time = e->get_clock();
- sg4::Comm::sendto_async(hosts[1], hosts[2], 1.0)->wait();
+ sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0)->wait();
end_time = e->get_clock();
XBT_INFO("Actual result: sending 1 byte on a 3-link route at 1Bps + 2,500ms takes %.2f seconds.", end_time - start_time);
XBT_INFO("\n");
XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 2.5 seconds (500ms latency + 2s transfert).");
start_time = e->get_clock();
- sg4::CommPtr c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
- sg4::CommPtr c2 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
+ sg4::CommPtr c1 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0);
+ sg4::CommPtr c2 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert).");
start_time = e->get_clock();
- c1 = sg4::Comm::sendto_async(hosts[0], hosts[2], 1.0);
- c2 = sg4::Comm::sendto_async(hosts[0], hosts[2], 1.0);
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0);
+ c2 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 2 x 500ms + 1s.");
XBT_INFO("Should be done in 4 seconds (2 x 500ms + 1s latency + 2s transfert).");
start_time = e->get_clock();
- c1 = sg4::Comm::sendto_async(hosts[1], hosts[2], 1.0);
- c2 = sg4::Comm::sendto_async(hosts[1], hosts[2], 1.0);
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
+ c2 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 2.5 seconds (500ms latency + 2s transfert).");
start_time = e->get_clock();
- c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
- c2 = sg4::Comm::sendto_async(hosts[1], hosts[0], 1.0);
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0);
+ c2 = sg4::Comm::sendto_async(hosts[4], hosts[0], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 500ms.");
XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert).");
start_time = e->get_clock();
- c1 = sg4::Comm::sendto_async(hosts[0], hosts[2], 1.0);
- c2 = sg4::Comm::sendto_async(hosts[2], hosts[0], 1.0);
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0);
+ c2 = sg4::Comm::sendto_async(hosts[5], hosts[0], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 2 x 500ms + 1s.");
XBT_INFO("Should be done in 4 seconds (2 x 500ms + 1s latency + 2s transfert).");
start_time = e->get_clock();
- c1 = sg4::Comm::sendto_async(hosts[1], hosts[2], 1.0);
- c2 = sg4::Comm::sendto_async(hosts[2], hosts[1], 1.0);
+ c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0);
+ c2 = sg4::Comm::sendto_async(hosts[1], hosts[0], 1.0);
c1->wait();
c2->wait();
end_time = e->get_clock();
XBT_INFO("Actual result: sending 1 byte in both directions on a 3-link route at 1Bps + 2,500ms takes %.2f seconds.",
end_time - start_time);
XBT_INFO("\n");
+
+ sg4::this_actor::sleep_for(5);
+
+ XBT_INFO("TEST: 4-host parallel communication with independent transfers.");
+ XBT_INFO("------------------------------------------------------------");
+ XBT_INFO("'cpu0' sends 1B to 'cpu1' and 'cpu2' sends 1B to 'cpu3'. The only shared link is the fatpipe switch.");
+ XBT_INFO("Should be done in 3 seconds (2 x 500ms + 1s latency + 1s transfert).");
+ start_time = e->get_clock();
+ sg4::Exec::init()->set_bytes_amounts(std::vector<double>({0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0,
+ 0.0, 0.0, 0.0, 0.0 }))
+ ->set_hosts(std::vector<sg4::Host*>({hosts[0], hosts[1], hosts[2], hosts[3]}))
+ ->wait();
+ end_time = e->get_clock();
+ XBT_INFO("Actual result: sending 2 x 1 byte in a parallel communication without interference takes %.2f seconds.",
+ end_time - start_time);
+ XBT_INFO("\n");
+
+ sg4::this_actor::sleep_for(5);
+
+ XBT_INFO("TEST: 4-host parallel communication with scatter pattern.");
+ XBT_INFO("------------------------------------------------------------");
+ XBT_INFO("'cpu0' sends 1B to 'cpu1', 2B to 'cpu2' and 3B to 'cpu3'.");
+ XBT_INFO("Should be done in 8 seconds: 2 x 500ms + 1s of initial latency and :");
+ XBT_INFO(" - For 3 seconds, three flows share a link to transfer 3 x 1B. 'cpu1' received its payload");
+ XBT_INFO(" - For 2 seconds, two lows share a link to transfer 1 x 1B. 'cpu2' received is payload");
+ XBT_INFO(" - For 1 second, one flow has the full bandwidth to transfer 1B. 'cpu3' received is payload");
+
+ start_time = e->get_clock();
+ sg4::Exec::init()->set_bytes_amounts(std::vector<double>({0.0, 1.0, 2.0, 3.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0 }))
+ ->set_hosts(std::vector<sg4::Host*>({hosts[0], hosts[1], hosts[2], hosts[3]}))
+ ->wait();
+ end_time = e->get_clock();
+ XBT_INFO("Actual result: scattering an increasing number of bytes to 3 hosts takes %.2f seconds.",
+ end_time - start_time);
+ XBT_INFO("\n");
+
+ sg4::this_actor::sleep_for(5);
+
+ XBT_INFO("TEST: 4-host parallel communication with all-to-all pattern.");
+ XBT_INFO("------------------------------------------------------------");
+ XBT_INFO("Each host sends 1B to every other hosts.");
+ XBT_INFO("Should be done in 8 seconds: 2 x 500ms + 1s of initial latency and 6 seconds for transfer");
+ XBT_INFO("Each SHARED link is traversed by 6 flows (3 in and 3 out). ");
+ XBT_INFO("Each 1B transfer thus takes 6 seconds on a 1Bps link");
+
+ start_time = e->get_clock();
+ sg4::Exec::init()->set_bytes_amounts(std::vector<double>({0.0, 1.0, 1.0, 1.0,
+ 1.0, 0.0, 1.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 1.0, 1.0, 1.0, 0.0 }))
+ ->set_hosts(std::vector<sg4::Host*>({hosts[0], hosts[1], hosts[2], hosts[3]}))
+ ->wait();
+ end_time = e->get_clock();
+ XBT_INFO("Actual result: 1-byte all-too-all in a parallel communication takes %.2f seconds.",
+ end_time - start_time);
+ XBT_INFO("\n");
}
int main(int argc, char** argv)
> Have to send 1B between two hosts in each direction at 1Bps with a latency of 2 x 500ms + 1s.
> Should be done in 4 seconds (2 x 500ms + 1s latency + 2s transfert).
> Actual result: sending 1 byte in both directions on a 3-link route at 1Bps + 2,500ms takes 4.00 seconds.
+>
+>
+> TEST: 4-host parallel communication with independent transfers.
+> ------------------------------------------------------------
+> 'cpu0' sends 1B to 'cpu1' and 'cpu2' sends 1B to 'cpu3'. The only shared link is the fatpipe switch.
+> Should be done in 3 seconds (2 x 500ms + 1s latency + 1s transfert).
+> Actual result: sending 2 x 1 byte in a parallel communication without interference takes 3.00 seconds.
+>
+>
+> TEST: 4-host parallel communication with scatter pattern.
+> ------------------------------------------------------------
+> 'cpu0' sends 1B to 'cpu1', 2B to 'cpu2' and 3B to 'cpu3'.
+> Should be done in 8 seconds: 2 x 500ms + 1s of initial latency and :
+> - For 3 seconds, three flows share a link to transfer 3 x 1B. 'cpu1' received its payload
+> - For 2 seconds, two lows share a link to transfer 1 x 1B. 'cpu2' received is payload
+> - For 1 second, one flow has the full bandwidth to transfer 1B. 'cpu3' received is payload
+> Actual result: scattering an increasing number of bytes to 3 hosts takes 8.00 seconds.
+>
+>
+> TEST: 4-host parallel communication with all-to-all pattern.
+> ------------------------------------------------------------
+> Each host sends 1B to every other hosts.
+> Should be done in 8 seconds: 2 x 500ms + 1s of initial latency and 6 seconds for transfer
+> 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.
-foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6
- comm-mxn-all2all comm-mxn-independent comm-mxn-scatter
- comm-p2p-latency-bound incomplete)
+foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 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})
${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
- comm-mxn-all2all comm-mxn-independent comm-mxn-scatter flatifier
- comm-p2p-latency-bound incomplete)
+foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 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()
+++ /dev/null
-/* Latency tests */
-
-/* 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"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(comm_mxn_all2all, sd, "SimDag test All2All");
-
-/*
- * intra communication test
- * All2All
- *
- * send 1 byte from all to all
- * + 2 secs latency
- * should be 8 (platform_4p_1switch.xml)
- */
-
-int main(int argc, char **argv)
-{
- double communication_amount[] = { 0.0, 1.0, 1.0, 1.0,
- 1.0, 0.0, 1.0, 1.0,
- 1.0, 1.0, 0.0, 1.0,
- 1.0, 1.0, 1.0, 0.0 };
-
- SD_init(&argc, argv);
- SD_create_environment(argv[1]);
-
- SD_task_t task = SD_task_create("All2all task", NULL, 1.0);
-
- sg_host_t *hosts = sg_host_list();
- SD_task_schedule(task, 4, hosts, SD_SCHED_NO_COST, communication_amount, -1.0);
- xbt_free(hosts);
-
- SD_simulate(-1.0);
-
- XBT_INFO("%g", SD_get_clock());
-
- SD_task_destroy(task);
-
- return 0;
-}
+++ /dev/null
-p all 2 all test, only fat pipe switch is used concurrently
-! output sort
-
-$ ${bindir:=.}/comm-mxn-all2all ../platforms/platform_4p_1switch.xml --cfg=path:${srcdir} --log=sd_kernel.thres=warning "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [ 8.000000] (0:maestro@) 8
+++ /dev/null
-/* Latency tests */
-
-/* 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"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(comm_mxn_independent, sd, "SimDag test independent communications");
-
-/*
- * intra communication test
- * independent communication
- *
- * 0 -> 1
- * 2 -> 3
- * shared is only switch which is fat pipe
- * should be 1 + 2 latency = 3
- */
-
-int main(int argc, char **argv)
-{
- double communication_amount[] = { 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 1.0,
- 0.0, 0.0, 0.0, 0.0 };
-
- SD_init(&argc, argv);
- SD_create_environment(argv[1]);
-
- SD_task_t task = SD_task_create("Comm 1", NULL, 1.0);
-
- sg_host_t *hosts = sg_host_list();
- SD_task_schedule(task, 4, hosts, SD_SCHED_NO_COST, communication_amount, -1.0);
- xbt_free(hosts);
-
- SD_simulate(-1.0);
-
- XBT_INFO("%g", SD_get_clock());
-
- SD_task_destroy(task);
-
- return 0;
-}
+++ /dev/null
-p sending on different paths test
-! output sort
-
-$ ${bindir:=.}/comm-mxn-independent ../platforms/platform_4p_1switch.xml --cfg=path:${srcdir} --log=sd_kernel.thres=warning "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [ 3.000000] (0:maestro@) 3
+++ /dev/null
-/* Latency tests */
-
-/* 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"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(comm_mxn_scatter, sd, "SimDag test scatter");
-
-/*
- * intra communication test 1
- * scatter
- *
- * start: 1 2 3 (each having 1/3 of the bandwidth)
- * after 3 sec: 0 1 2 (having 1/2 of the bandwidth)
- * after another 2 sec: 0 0 1 (having all the bandwidth)
- * -> finished after 1 sec
- * time to send: 6 + latency at the beginning: 0.5 + 1 + 0.5
- */
-
-int main(int argc, char **argv)
-{
- double communication_amount[] = { 0.0, 1.0, 2.0, 3.0,
- 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0 };
-
- SD_init(&argc, argv);
- SD_create_environment(argv[1]);
-
- SD_task_t task = SD_task_create("Scatter task", NULL, 1.0);
-
- sg_host_t *hosts = sg_host_list();
- SD_task_schedule(task, 4, hosts, SD_SCHED_NO_COST, communication_amount, -1.0);
- xbt_free(hosts);
-
- SD_simulate(-1.0);
-
- XBT_INFO("%g", SD_get_clock());
-
- SD_task_destroy(task);
-
- return 0;
-}
+++ /dev/null
-p scatter test
-! output sort
-
-$ ${bindir:=.}/comm-mxn-scatter ../platforms/platform_4p_1switch.xml --cfg=path:${srcdir} --log=sd_kernel.thres=warning "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [ 8.000000] (0:maestro@) 8