Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use SPLITDUPLEX internally instead of FULLDUPLEX
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 16 Feb 2018 20:50:47 +0000 (21:50 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 18 Feb 2018 13:12:43 +0000 (14:12 +0100)
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.

include/simgrid/forward.h
src/bindings/lua/lua_platf.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/TorusZone.cpp
src/surf/sg_platf.cpp
src/surf/xml/surfxml_sax_cb.cpp

index 0a082a6..231385f 100644 (file)
@@ -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
 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
 } e_surf_link_sharing_policy_t;
 
 /** @ingroup m_datatypes_management_details
index 6a1a8e4..47f4641 100644 (file)
@@ -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")) {
   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 {
   } 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")) {
   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 {
   } else if (policy && not strcmp(policy, "FATPIPE")) {
     link.policy = SURF_LINK_FATPIPE;
   } else {
index 2bd40cd..33e0863 100644 (file)
@@ -130,7 +130,7 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
 
   surf::LinkImpl *linkUp;
   surf::LinkImpl *linkDown;
 
   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 {
     linkUp   = surf::LinkImpl::byName(link_id + "_UP");
     linkDown = surf::LinkImpl::byName(link_id + "_DOWN");
   } else {
index cc72704..6b6f2c7 100644 (file)
@@ -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]);
   }
 
     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;
     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;
   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 {
     *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;
       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++;
         this->routers_[i]->myNodes_[j + 1] = linkdown;
 
       uniqueId++;
index 9b34a4d..e8732f1 100644 (file)
@@ -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);
 
       "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";
     std::string tmpID = std::string(linkTemplate.id) + "_UP";
     this->upLink      = surf::LinkImpl::byName(tmpID); // check link?
     tmpID          = std::string(linkTemplate.id) + "_DOWN";
index 03ba0a6..1d01cc9 100644 (file)
@@ -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;
     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";
       std::string tmp_link = link_id + "_UP";
       linkUp         = surf::LinkImpl::byName(tmp_link);
       tmp_link             = link_id + "_DOWN";
index 4635150..5a35785 100644 (file)
@@ -116,7 +116,7 @@ void sg_platf_new_link(LinkCreationArgs* link)
 {
   std::vector<std::string> names;
 
 {
   std::vector<std::string> 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 {
     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;
     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;
     link.latency   = cabinet->lat;
     link.bandwidth = cabinet->bw;
     link.id        = "link_" + hostname;
index 7f3d0ba..a8262d9 100644 (file)
@@ -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_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;
     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_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;
   default:
     surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
     break;