- char* link_id;
- unsigned int j = 0;
- /*
- * Create all links that exist in the torus.
- * Each rank creates @a dimensions-1 links
- */
- int neighbor_rank_id = 0; // The other node the link connects
- int current_dimension = 0, // which dimension are we currently in?
- // we need to iterate over all dimensions
- // and create all links there
- dim_product = 1; // Needed to calculate the next neighbor_id
- for (j = 0; j < xbt_dynar_length(dimensions_); j++) {
-
- s_sg_platf_link_cbarg_t link;
- memset(&link, 0, sizeof(link));
- current_dimension = xbt_dynar_get_as(dimensions_, j, int);
- neighbor_rank_id = (((int)rank / dim_product) % current_dimension == current_dimension - 1)
- ? rank - (current_dimension - 1) * dim_product
- : rank + dim_product;
+ /* Create all links that exist in the torus. Each rank creates @a dimensions-1 links */
+ int dim_product = 1; // Needed to calculate the next neighbor_id
+
+ for (unsigned int j = 0; j < dimensions_.size(); j++) {
+ LinkCreationArgs link;
+ int current_dimension = dimensions_[j]; // which dimension are we currently in?
+ // we need to iterate over all dimensions and create all links there
+ // The other node the link connects
+ int neighbor_rank_id = ((static_cast<int>(rank) / dim_product) % current_dimension == current_dimension - 1)
+ ? rank - (current_dimension - 1) * dim_product
+ : rank + dim_product;