New: s4u::create_torus_zone
Implements the builder method for Torus zones
NetZone* create_torus_zone(const std::string& name, const NetZone* parent, const std::vector<unsigned int>& dimensions,
double bandwidth, double latency, Link::SharingPolicy sharing_policy,
const std::function<TorusNetPointCb>& set_netpoint,
const std::function<TorusLinkCb>& set_loopback = {},
const std::function<TorusLinkCb>& set_limiter = {});
This builder method allow us to keep hiding the internals of our
NetZones, exporting only a NetZone* to the end-user.
It uses callbacks functions to populate the leaves in the Torus, 3
callbacks can be used:
- set_netpoint: must return a pair NetPoint,Gateway. This allows us to
have complex netzones under each leaf
- set_loopback: The link used to loopback communications
- set_limiter: A limiter link for each leaf
The links inside the Torus are homogeneous and described by the
bandwidth, latency and sharing policy parameters.
As the creation of resources are linked to the netzones (create_host,
create_link functions), we have to add the parent parameter to the
builder function. Otherwise, the user cannot create the resources
associated with the leaves in the callbacks.
Obs.: By now, the sg_platf.cpp isn't using this new builder method.
It will be changed once we have implemented the builder for every
cluster type (fatree, dragonfly).