From: Martin Quinson Date: Fri, 16 Feb 2018 20:50:47 +0000 (+0100) Subject: use SPLITDUPLEX internally instead of FULLDUPLEX X-Git-Tag: v3.19~194 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1bf71617c94b4c2ff15ac076992a24a0fdbaa897?ds=sidebyside use SPLITDUPLEX internally instead of FULLDUPLEX We will s/FULLDUPLEX/SPLITDUPLEX/ everywhere in SimGrid. Rational: That sharing mode is modeled by spliting every link between two links: one uplink used when traversing the link in a direction, and the downlink when we traverse the same link in the other direction. With SHARED links, the bandwidth is shared between all flows without taking the flow direction into account. So, SPLITDUPLEX is the way we model fullduplex links, but at the end, each of the SimGrid link in a SPLITDUPLEX (either the up or down link) can be used in one direction only. That's the right model, but using FULLDUPLEX for the situation where you have 2 links was rather disturbing. And yes, users will soon notice, when they will try to use network energy models. --- diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 0a082a69d0..231385f36a 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -134,9 +134,9 @@ typedef struct s_smx_simcall s_smx_simcall_t; typedef struct s_smx_simcall* smx_simcall_t; typedef enum { // FIXME: move this to s4u::Link; make it an enum class - SURF_LINK_FULLDUPLEX = 2, - SURF_LINK_SHARED = 1, - SURF_LINK_FATPIPE = 0 + SURF_LINK_SPLITDUPLEX = 2, + SURF_LINK_SHARED = 1, + SURF_LINK_FATPIPE = 0 } e_surf_link_sharing_policy_t; /** @ingroup m_datatypes_management_details diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 6a1a8e4438..47f46410a3 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -94,7 +94,7 @@ int console_add_backbone(lua_State *L) { const char* policy = lua_tostring(L, -1); lua_pop(L, 1); if (policy && not strcmp(policy, "FULLDUPLEX")) { - link.policy = SURF_LINK_FULLDUPLEX; + link.policy = SURF_LINK_SPLITDUPLEX; } else if (policy && not strcmp(policy, "FATPIPE")) { link.policy = SURF_LINK_FATPIPE; } else { @@ -267,7 +267,7 @@ int console_add_link(lua_State *L) { policy = lua_tostring(L, -1); lua_pop(L, 1); if (policy && not strcmp(policy, "FULLDUPLEX")) { - link.policy = SURF_LINK_FULLDUPLEX; + link.policy = SURF_LINK_SPLITDUPLEX; } else if (policy && not strcmp(policy, "FATPIPE")) { link.policy = SURF_LINK_FATPIPE; } else { diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index 2bd40cd92a..33e08639e7 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -130,7 +130,7 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in surf::LinkImpl *linkUp; surf::LinkImpl *linkDown; - if (link.policy == SURF_LINK_FULLDUPLEX) { + if (link.policy == SURF_LINK_SPLITDUPLEX) { linkUp = surf::LinkImpl::byName(link_id + "_UP"); linkDown = surf::LinkImpl::byName(link_id + "_DOWN"); } else { diff --git a/src/kernel/routing/DragonflyZone.cpp b/src/kernel/routing/DragonflyZone.cpp index cc72704a3f..6b6f2c7229 100644 --- a/src/kernel/routing/DragonflyZone.cpp +++ b/src/kernel/routing/DragonflyZone.cpp @@ -112,7 +112,7 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster) throw std::invalid_argument(std::string("Last parameter is not the amount of nodes per blade:") + parameters[3]); } - if (cluster->sharing_policy == SURF_LINK_FULLDUPLEX) + if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) this->numLinksperLink_ = 2; this->cluster_ = cluster; @@ -168,7 +168,7 @@ void DragonflyZone::createLink(const std::string& id, int numlinks, surf::LinkIm sg_platf_new_link(&linkTemplate); XBT_DEBUG("Generating link %s", id.c_str()); surf::LinkImpl* link; - if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX) { + if (this->cluster_->sharing_policy == SURF_LINK_SPLITDUPLEX) { *linkup = surf::LinkImpl::byName(linkTemplate.id + "_UP"); // check link? *linkdown = surf::LinkImpl::byName(linkTemplate.id + "_DOWN"); // check link ? } else { @@ -199,7 +199,7 @@ void DragonflyZone::generateLinks() this->createLink(id, 1, &linkup, &linkdown); this->routers_[i]->myNodes_[j] = linkup; - if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX) + if (this->cluster_->sharing_policy == SURF_LINK_SPLITDUPLEX) this->routers_[i]->myNodes_[j + 1] = linkdown; uniqueId++; diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 9b34a4d150..e8732f1e11 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -472,7 +472,7 @@ FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, Fa "link_from_" + std::to_string(downNode->id) + "_" + std::to_string(upNode->id) + "_" + std::to_string(uniqueId); sg_platf_new_link(&linkTemplate); - if (cluster->sharing_policy == SURF_LINK_FULLDUPLEX) { + if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) { std::string tmpID = std::string(linkTemplate.id) + "_UP"; this->upLink = surf::LinkImpl::byName(tmpID); // check link? tmpID = std::string(linkTemplate.id) + "_DOWN"; diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index 03ba0a6a7f..1d01cc9bcc 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -54,7 +54,7 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int sg_platf_new_link(&link); surf::LinkImpl* linkUp; surf::LinkImpl* linkDown; - if (link.policy == SURF_LINK_FULLDUPLEX) { + if (link.policy == SURF_LINK_SPLITDUPLEX) { std::string tmp_link = link_id + "_UP"; linkUp = surf::LinkImpl::byName(tmp_link); tmp_link = link_id + "_DOWN"; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 46351501bc..5a3578581a 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -116,7 +116,7 @@ void sg_platf_new_link(LinkCreationArgs* link) { std::vector names; - if (link->policy == SURF_LINK_FULLDUPLEX) { + if (link->policy == SURF_LINK_SPLITDUPLEX) { names.push_back(link->id+ "_UP"); names.push_back(link->id+ "_DOWN"); } else { @@ -315,7 +315,7 @@ void sg_platf_new_cabinet(CabinetCreationArgs* cabinet) sg_platf_new_host(&host); LinkCreationArgs link; - link.policy = SURF_LINK_FULLDUPLEX; + link.policy = SURF_LINK_SPLITDUPLEX; link.latency = cabinet->lat; link.bandwidth = cabinet->bw; link.id = "link_" + hostname; diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 7f3d0ba9c6..a8262d99f1 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -503,7 +503,7 @@ void ETag_surfxml_cluster(){ cluster.sharing_policy = SURF_LINK_SHARED; break; case A_surfxml_cluster_sharing___policy_FULLDUPLEX: - cluster.sharing_policy = SURF_LINK_FULLDUPLEX; + cluster.sharing_policy = SURF_LINK_SPLITDUPLEX; break; case A_surfxml_cluster_sharing___policy_FATPIPE: cluster.sharing_policy = SURF_LINK_FATPIPE; @@ -592,8 +592,8 @@ void ETag_surfxml_link(){ link.policy = SURF_LINK_FATPIPE; break; case A_surfxml_link_sharing___policy_FULLDUPLEX: - link.policy = SURF_LINK_FULLDUPLEX; - break; + link.policy = SURF_LINK_SPLITDUPLEX; + break; default: surf_parse_error(std::string("Invalid sharing policy in link ") + link.id); break;