NetCard *router_ = nullptr;
bool hasLimiter_ = false;
bool hasLoopback_ = false;
- int linkCountPerNode_ = 1; /* may be 1 (if only a private link), 2 or 3 (if limiter and loopback) */
+ unsigned int linkCountPerNode_ = 1; /* may be 1 (if only a private link), 2 or 3 (if limiter and loopback) */
};
* TODO Change to dynamic assignment
*/
unsigned int j, cur_dim, dim_product = 1;
- int current_node = src->id();
- int unsigned next_node = 0;
+ unsigned int current_node = src->id();
+ unsigned int next_node = 0;
/*
* Arrays that hold the coordinates of the current node and
* the target; comparing the values at the i-th position of
/* create a result route */
xbt_dynar_t route_stack = xbt_dynar_new(sizeof(sg_platf_route_cbarg_t), nullptr);
int pred;
- int cur = dst->id();
+ unsigned int cur = dst->id();
do {
pred = TO_FLOYD_PRED(src->id(), cur);
if (pred == -1)
}
/* Retrieve the private links */
- if (static_cast<int>(privateLinks_.size()) > src->id()) {
+ if (privateLinks_.size() > src->id()) {
s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id());
if(info.linkUp) {
route->link_list->push_back(info.linkUp);
*lat += info.linkUp->getLatency();
}
}
- if (static_cast<int>(privateLinks_.size()) >dst->id()) {
+ if (privateLinks_.size() >dst->id()) {
s_surf_parsing_link_up_down_t info = privateLinks_.at(dst->id());
if(info.linkDown) {
route->link_list->push_back(info.linkDown);
info_loop.linkDown = Link::byName(tmp_link);
free(tmp_link);
auto as_cluster = static_cast<AsCluster*>(current_as);
- if (rankId*as_cluster->linkCountPerNode_ >= static_cast<int>(as_cluster->privateLinks_.size())){
+ if (rankId*as_cluster->linkCountPerNode_ >= as_cluster->privateLinks_.size()) {
s_surf_parsing_link_up_down_t dummy;
dummy.linkUp = nullptr;
dummy.linkDown = nullptr;
// If dynar is is greater than netcard id and if the host_link is already defined
auto as_cluster = static_cast<simgrid::kernel::routing::AsCluster*>(current_routing);
- if(static_cast<int>(as_cluster->privateLinks_.size()) > netcard->id()){
+ if (as_cluster->privateLinks_.size() > netcard->id()){
if (as_cluster->privateLinks_.at(netcard->id()).linkUp != nullptr)
surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
} else {
class NetCard {
public:
virtual ~NetCard(){};
- virtual int id()=0; // Our rank in the vertices_ array of our containing AS.
+ virtual unsigned int id()=0; // Our rank in the vertices_ array of our containing AS.
virtual char *name()=0;
virtual AsImpl *containingAS()=0; // This is the AS in which I am
virtual bool isAS()=0;
}
~NetCardImpl() { xbt_free(name_);};
- int id() override {return id_;}
+ unsigned int id() override {return id_;}
char *name() override {return name_;}
AsImpl *containingAS() override {return containingAS_;}
bool isRouter() override {return componentType_ == Type::Router;}
private:
- int id_ = -1;
+ unsigned int id_;
char *name_;
NetCard::Type componentType_;
AsImpl *containingAS_;