Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
greatly reduce the amount of atoi in our codebase
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 16:51:06 +0000 (17:51 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 16:51:09 +0000 (17:51 +0100)
Some remain and should be hunted down. atol and atof will follow.

23 files changed:
examples/msg/bittorrent/bittorrent.xml
examples/msg/bittorrent/peer.c
examples/msg/chainsend/broadcaster.c
examples/msg/chord/chord.c
examples/msg/cloud/bound.c
examples/msg/io/remote.c
examples/msg/mc/bugged1.c
examples/msg/mc/bugged2.c
examples/msg/mc/bugged3.c
examples/msg/ns3/ns3.c
examples/msg/pastry/pastry.c
examples/msg/pmm/msg_pmm.c
examples/msg/start_kill_time/sk_time.c
examples/msg/token_ring/ring_call.c
examples/smpi/MM/MM_mpi.c
examples/smpi/mvmul.c
examples/smpi/replay_multiple/replay_multiple.c
examples/xbt/sem_sched.c
src/instr/jedule/jedule_platform.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_client.cpp
src/smpi/smpi_global.cpp
src/surf/surf_routing_cluster_fat_tree.cpp

index 58627ee..c15bcfe 100644 (file)
@@ -9,7 +9,7 @@
   <process host="Boivin" function="peer">
     <argument value="00000002"/>        <!-- my id -->
     <argument value="5000" />                  <!-- end time -->       
-    <argument value="1" />                     <!-- indicates if the peer is a seed at the begining of the simulation -->      
+    <argument value="1" />                     <!-- indicates if the peer is a seed at the beginning of the simulation -->     
   </process>
   <process host="Jean_Yves" function="peer">
     <argument value="00000003"/>        <!-- my id -->
@@ -22,7 +22,7 @@
   <process host="Geoff" function="peer">
     <argument value="00000005"/>        <!-- my id -->
     <argument value="5000" />                  <!-- end time -->       
-    <argument value="1" />                     <!-- indicates if the peer is a seed at the begining of the simulation -->      
+    <argument value="1" />                     <!-- indicates if the peer is a seed at the beginning of the simulation -->     
   </process>
   <process host="Disney" function="peer">
     <argument value="00000006"/>        <!-- my id -->
index 4382710..fcd1a0f 100644 (file)
@@ -47,12 +47,12 @@ int peer(int argc, char *argv[])
   xbt_assert(argc == 3 || argc == 4, "Wrong number of arguments");
   //Build peer object
   if (argc == 4) {
-    peer_init(&peer, atoi(argv[1]), 1);
+    peer_init(&peer, xbt_str_parse_int(argv[1],"Invalid ID: %s"), 1);
   } else {
-    peer_init(&peer, atoi(argv[1]), 0);
+    peer_init(&peer, xbt_str_parse_int(argv[1],"Invalid ID: %s"), 0);
   }
   //Retrieve deadline
-  double deadline = atof(argv[2]);
+  double deadline = xbt_str_parse_double(argv[2],"Invalid deadline: %s");
   xbt_assert(deadline > 0, "Wrong deadline supplied");
   XBT_INFO("Hi, I'm joining the network with id %d", peer.id);
   //Getting peer data from the tracker.
index 5daf3d5..112bb25 100644 (file)
@@ -118,11 +118,11 @@ int broadcaster(int argc, char *argv[])
   XBT_DEBUG("broadcaster");
 
   /* Add every mailbox given by the hostcount in argv[1] to a dynamic array */
-  host_list = build_hostlist_from_hostcount(atoi(argv[1]));
+  host_list = build_hostlist_from_hostcount(xbt_str_parse_int(argv[1], "Invalid number of peers: %s"));
 
   /* argv[2] is the number of pieces */
   if (argc > 2) {
-    piece_count = atoi(argv[2]);
+    piece_count = xbt_str_parse_int(argv[2], "Invalid number of pieces: %s");
     XBT_DEBUG("piece_count set to %d", piece_count);
   } else {
     XBT_DEBUG("No piece_count specified, defaulting to %d", piece_count);
index 8de01ef..ef8324c 100644 (file)
@@ -322,9 +322,8 @@ int node(int argc, char *argv[])
 
   // initialize my node
   s_node_t node = {0};
-  node.id = atoi(argv[1]);
-  node.stream =
-    (RngStream)MSG_host_get_property_value(MSG_host_self(), "stream");
+  node.id = xbt_str_parse_int(argv[1],"Invalid ID: %s");
+  node.stream = (RngStream)MSG_host_get_property_value(MSG_host_self(), "stream");
   get_mailbox(node.id, node.mailbox);
   node.next_finger_to_fix = 0;
   node.fingers = xbt_new0(s_finger_t, nb_bits);
@@ -336,14 +335,14 @@ int node(int argc, char *argv[])
   }
 
   if (argc == 3) { // first ring
-    deadline = atof(argv[2]);
+    deadline = xbt_str_parse_double(argv[2],"Invalid deadline: %s");
     create(&node);
     join_success = 1;
-  }
-  else {
-    int known_id = atoi(argv[2]);
+
+  else {
+    int known_id = xbt_str_parse_int(argv[2],"Invalid root ID: %s");
     //double sleep_time = atof(argv[3]);
-    deadline = atof(argv[4]);
+    deadline = xbt_str_parse_double(argv[4],"Invalid deadline: %s");
 
     /*
     // sleep before starting
@@ -1036,14 +1035,14 @@ int main(int argc, char *argv[])
 
     int length = strlen("-nb_bits=");
     if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
-      nb_bits = atoi(options[0] + length);
+      nb_bits = xbt_str_parse_int(options[0] + length, "Invalid nb_bits parameter: %s");
       XBT_DEBUG("Set nb_bits to %d", nb_bits);
     }
     else {
 
       length = strlen("-timeout=");
       if (!strncmp(options[0], "-timeout=", length) && strlen(options[0]) > length) {
-        timeout = atoi(options[0] + length);
+        timeout = xbt_str_parse_int(options[0] + length, "Invalid timeout parameter: %s");
         XBT_DEBUG("Set timeout to %d", timeout);
       }
       else {
index 8316bb5..06a059b 100644 (file)
@@ -24,9 +24,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
 
 static int worker_main(int argc, char *argv[])
 {
-  double computation_amount = atof(argv[1]);
-  int use_bound = atoi(argv[2]);
-  double bound = atof(argv[3]);
+  double computation_amount = xbt_str_parse_double(argv[1], "Invalid computation amount: %s");
+  int use_bound = xbt_str_parse_int(argv[2], "Second parameter (use_bound) should be 0 or 1 but is: %s");
+  double bound = xbt_str_parse_double(argv[3], "Invalid bound: %s");
 
   {
     double clock_sta = MSG_get_clock();
index 5661b61..cc84983 100644 (file)
@@ -54,7 +54,7 @@ int host(int argc, char *argv[]){
     msg_host_t src, dest;
     src= MSG_host_self();
     dest = MSG_host_by_name(argv[3]);
-    if (atoi(argv[5])){
+    if (xbt_str_parse_int(argv[5], "Argument 5 (move or copy) must be an int, not '%s'")) {
       XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename,
            MSG_file_get_size(file), MSG_host_get_name(src),
            argv[3]);
index 1954933..aa397f8 100644 (file)
@@ -31,7 +31,7 @@ int server(int argc, char *argv[])
     MSG_task_receive(&task, "mymailbox");
     count++;
   }
-  MC_assert(atoi(MSG_task_get_name(task)) == 3);
+  MC_assert(xbt_str_parse_int(MSG_task_get_name(task), "Task names must be integers, not '%s'") == 3);
 
   XBT_INFO("OK");
   return 0;
index 70cff38..bd916c0 100644 (file)
@@ -54,15 +54,14 @@ int server(int argc, char *argv[])
 
 int client(int argc, char *argv[])
 {
-  msg_task_t task1 =
-      MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
-  msg_task_t task2 =
-      MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
+  int ID = xbt_str_parse_int(argv[1], "Arg 1 is not a numerical ID: %s");
+  msg_task_t task1 = MSG_task_create("task", 0, 10000, (void *) ID);
+  msg_task_t task2 = MSG_task_create("task", 0, 10000, (void *) ID);
 
-  XBT_INFO("Send %d!", atoi(argv[1]));
+  XBT_INFO("Send %d!", ID);
   MSG_task_send(task1, "mymailbox");
 
-  XBT_INFO("Send %d!", atoi(argv[1]));
+  XBT_INFO("Send %d!", ID);
   MSG_task_send(task2, "mymailbox");
 
   return 0;
index 33dc2d1..e43e802 100644 (file)
@@ -43,15 +43,13 @@ int server(int argc, char *argv[])
 
 int client(int argc, char *argv[])
 {
-  msg_comm_t comm;
-  char *mbox;
-  msg_task_t task1 =
-      MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
+  int ID = xbt_str_parse_int(argv[1], "Arg 1 is not a numerical ID: %s");
+  msg_task_t task1 = MSG_task_create("task", 0, 10000, (void *) ID);
 
-  mbox = bprintf("mymailbox%s", argv[1]);
+  char *mbox = bprintf("mymailbox%s", argv[1]);
 
-  XBT_INFO("Send %d!", atoi(argv[1]));
-  comm = MSG_task_isend(task1, mbox);
+  XBT_INFO("Send %d!", ID);
+  msg_comm_t comm = MSG_task_isend(task1, mbox);
   MSG_comm_wait(comm, -1);
 
   xbt_free(mbox);
@@ -66,9 +64,7 @@ int main(int argc, char *argv[])
   MSG_create_environment("platform.xml");
 
   MSG_function_register("server", server);
-
   MSG_function_register("client", client);
-
   MSG_launch_application("deploy_bugged3.xml");
 
   MSG_main();
index ac1b6ad..42fa9d1 100644 (file)
@@ -56,7 +56,6 @@ int count_finished = 0;
 /** master */
 int master(int argc, char *argv[])
 {
-  double task_comm_size = 0;
   msg_task_t todo;
 
   xbt_assert(argc==4,"Strange number of arguments expected 3 got %d", argc - 1);
@@ -64,13 +63,11 @@ int master(int argc, char *argv[])
   XBT_DEBUG ("Master started");
 
   /* data size */
-  int read;
-  read = sscanf(argv[1], "%lg", &task_comm_size);
-  xbt_assert(read, "Invalid argument %s\n", argv[1]);
+  double task_comm_size = xbt_str_parse_double(argv[1], "Invalid task communication size: %s");
 
   /* slave name */
   char *slavename = argv[2];
-  int id = atoi(argv[3]);   //unique id to control statistics
+  int id = xbt_str_parse_int(argv[3], "Invalid ID as argument 3: %s");   //unique id to control statistics
   char *id_alias = bprintf("flow_%d", id);
   slavenames[id] = slavename;
   TRACE_category(id_alias);
@@ -86,7 +83,7 @@ int master(int argc, char *argv[])
   }
 
   {                             /* Process organization */
-    MSG_get_host_by_name(slavename);
+    MSG_host_by_name(slavename);
   }
 
   count_finished++;
@@ -143,7 +140,7 @@ int slave(int argc, char *argv[])
 
   XBT_DEBUG ("Slave started");
 
-  id = atoi(argv[1]);
+  id = xbt_str_parse_int(argv[1], "Invalid id: %s");
   sprintf(id_alias, "%d", id);
 
   a = MSG_task_receive(&(task), id_alias);
index bc85c04..37d443c 100644 (file)
@@ -517,7 +517,7 @@ static int node(int argc, char *argv[])
   double deadline;
   xbt_assert(argc == 3 || argc == 5, "Wrong number of arguments for this node");
   s_node_t node = {0};
-  node.id = atoi(argv[1]);
+  node.id = xbt_str_parse_int(argv[1], "Invalid ID: %s");
   node.known_id = -1;
   node.ready = -1;
   node.pending_tasks = xbt_fifo_new();
@@ -539,14 +539,14 @@ static int node(int argc, char *argv[])
 
   if (argc == 3) { // first ring
     XBT_DEBUG("Hey! Let's create the system.");
-    deadline = atof(argv[2]);
+    deadline = xbt_str_parse_double(argv[2], "Invalid deadline: %s");
     create(&node);
     join_success = 1;
   }
   else {
-    node.known_id = atoi(argv[2]);
-    double sleep_time = atof(argv[3]);
-    deadline = atof(argv[4]);
+    node.known_id = xbt_str_parse_int(argv[2], "Invalid known ID: %s");
+    double sleep_time = xbt_str_parse_double(argv[3], "Invalid sleep time: %s");
+    deadline = xbt_str_parse_double(argv[4], "Invalid deadline: %s");
 
     // sleep before starting
     XBT_DEBUG("Let's sleep during %f", sleep_time);
@@ -623,14 +623,14 @@ int main(int argc, char *argv[])
 
     int length = strlen("-nb_bits=");
     if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
-      nb_bits = atoi(options[0] + length);
+      nb_bits = xbt_str_parse_int(options[0] + length, "Invalid nb_bits parameter: %s");
       XBT_DEBUG("Set nb_bits to %d", nb_bits);
     }
     else {
 
       length = strlen("-timeout=");
       if (!strncmp(options[0], "-timeout=", length) && strlen(options[0]) > length) {
-        timeout = atoi(options[0] + length);
+        timeout = xbt_str_parse_int(options[0] + length, "Invalid timeout parameter: %s");
         XBT_DEBUG("Set timeout to %d", timeout);
       }
       else {
index 530b15d..f1e02aa 100644 (file)
@@ -77,7 +77,7 @@ int node(int argc, char **argv)
   xbt_assert(argc != 1, "Wrong number of arguments for this node");
 
   /* Initialize the node's data-structures */
-  myid = atoi(argv[1]);
+  myid = xbt_str_parse_int(argv[1], "Invalid ID received as first node parameter: %s");
   snprintf(my_mbox, MAILBOX_NAME_SIZE - 1, "%d", myid);
   sC = xbt_matrix_double_new_zeros(NODE_MATRIX_SIZE, NODE_MATRIX_SIZE);
 
index 00dfcbb..8442325 100644 (file)
@@ -22,7 +22,7 @@ static int sleeper(int argc, char *argv[])
   XBT_INFO("Hello! I go to sleep.");
   MSG_process_on_exit(my_onexit, NULL);
    
-  MSG_process_sleep(atoi(argv[1]));
+  MSG_process_sleep(xbt_str_parse_int(argv[1], "sleeper process expects an integer parameter but got %s"));
   XBT_INFO("Done sleeping.");
   return 0;
 }
index 6b00f34..06a4648 100644 (file)
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "simgrid/msg.h"
-#include "src/surf/surf_private.h"
 
 int host(int argc, char *argv[]);
 unsigned int task_comp_size = 50000000;
@@ -30,7 +29,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(ring,
 
 int host(int argc, char *argv[])
 {
-  int host_number = atoi(MSG_process_get_name(MSG_process_self()));
+  int host_number = xbt_str_parse_int(MSG_process_get_name(MSG_process_self()), "Process name must be an integer but is: %s");
   char mailbox[256];
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
index 6767ba4..d59b122 100644 (file)
@@ -84,41 +84,41 @@ int main(int argc, char ** argv)
                     "  -M I  M size (default: %zu)\n"
                     "  -N I  N size (default: %zu)\n"
                     "  -K I  K size (default: %zu)\n"
-                    "  -B I  Block size on the k dimension(default: %zu)\n"
-                    "  -G I  Number of processor groups(default: %zu)\n"
-                    "  -g I  group index(default: %zu)\n"
-                    "  -k I  group rank(default: %zu)\n"
+                    "  -B I  Block size on the k dimension (default: %zu)\n"
+                    "  -G I  Number of processor groups (default: %zu)\n"
+                    "  -g I  group index (default: %zu)\n"
+                    "  -k I  group rank (default: %zu)\n"
                     "  -r I  processor row size (default: %zu)\n"
                     "  -c I  processor col size (default: %zu)\n"
                     "  -h  help\n",
                     m, n, k, Block_size, NB_groups, group, key, row, col);
         return 0;
       case 'M':
-        m = atoi(optarg);
+        m = xbt_str_parse_int(optarg, "Invalid M size: %s");
         break;
       case 'N':
-        n   = atoi(optarg);
+        n = xbt_str_parse_int(optarg, "Invalid N size: %s");
         break;
       case 'K':
-        k  = atoi(optarg);
+        k = xbt_str_parse_int(optarg, "Invalid K size: %s");
         break;
       case 'B':
-        Block_size = atoi(optarg);
+        Block_size = xbt_str_parse_int(optarg, "Invalid block size: %s");
         break;
       case 'G':
-        NB_groups = atoi(optarg);
+        NB_groups = xbt_str_parse_int(optarg, "Invalid number of processor groups: %s");
         break;
       case 'g':
-        group = atoi(optarg);
+        group = xbt_str_parse_int(optarg, "Invalid group index: %s");
         break;
       case 'k':
-        key = atoi(optarg);
+        key = xbt_str_parse_int(optarg, "Invalid group rank: %s");
         break;
       case 'r':
-        size_row = atoi(optarg);
+        size_row = xbt_str_parse_int(optarg, "Invalid processor row size: %s");
         break;
       case 'c':
-        size_col = atoi(optarg);
+        size_col = xbt_str_parse_int(optarg, "Invalid processor col size: %s");
         break;
         /*case 'P':
           str_mask = strdup(optarg);
index 15a9e7e..c7e8353 100644 (file)
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
       exit(USAGE_ERROR);
     }
 
-    N = atoi(argv[1]);
+    N = xbt_str_parse_int(argv[1], "Invalid size: %s");
 
     start_time = (struct timeval *) malloc(sizeof(struct timeval));
     stop_time = (struct timeval *) malloc(sizeof(struct timeval));
index 03ec4b4..969fe9a 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]){
 
     const char** line_char= xbt_dynar_to_array(elems);
     instance_id = line_char[0];
-    instance_size = atoi(line_char[2]);
+    instance_size = xbt_str_parse_int(line_char[2], "Invalid size: %s");
 
     XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size);
     SMPI_app_instance_register(instance_id, smpi_replay,instance_size);
index c6af2d9..607a4a7 100644 (file)
@@ -99,8 +99,7 @@ int main(int argc, char *argv[])
     exit(EXIT_FAILURE);
   }
 
-
-  size = atoi(argv[1]);
+  size = xbt_str_parse_int(argv[1], "Invalid size: %s");
 
   /* create a new scheduler */
   sched = sched_new(size);
@@ -113,10 +112,7 @@ int main(int argc, char *argv[])
   __argv = xbt_new0(char *, MAX_ARGS);
 
   for (i = 0; i < MAX_ARGS; i++) {
-    sprintf(arg, "arg_%d", i);
-    __argv[i] = strdup(arg);
-    memset(arg, 0, MAX_ARG);
-
+    __argv[i] = bprintf("arg_%d", i);
   }
 
   for (i = 0; i < size; i++)
index e774f9d..b585d51 100644 (file)
@@ -155,7 +155,7 @@ static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
   nb_ids = xbt_dynar_length(id_list);
   id_ar = xbt_new0(int,nb_ids);
   xbt_dynar_foreach(id_list, iter, id_str) {
-    id_ar[iter] = atoi(id_str);
+    id_ar[iter] = xbt_str_parse_int(id_str, "Parse error: not a number: %s");
   }
 
   qsort (id_ar, nb_ids, sizeof(int), &compare_ids);
index fca86d0..ef98cce 100644 (file)
@@ -497,7 +497,7 @@ static std::vector<s_fd_infos_t> MC_get_current_fds(pid_t pid)
   struct dirent* fd_number;
   while ((fd_number = readdir(fd_dir))) {
 
-    int fd_value = atoi(fd_number->d_name);
+    int fd_value = xbt_str_parse_int(fd_number->d_name, "Found a non-numerical FD: %s. Freaking out!");
 
     if(fd_value < 3)
       continue;
index 3956391..07e65fb 100644 (file)
@@ -47,7 +47,7 @@ void MC_client_init(void)
   if (!fd_env)
     xbt_die("MC socket not found");
 
-  int fd = atoi(fd_env);
+  int fd = xbt_str_parse_int(fd_env,bprintf("Variable %s should contain a number but contains '%%s'", MC_ENV_SOCKET_FD));
   XBT_DEBUG("Model-checked application found socket FD %i", fd);
 
   int type;
index bf3b7cf..2dc16b6 100644 (file)
@@ -82,7 +82,7 @@ void smpi_process_init(int *argc, char ***argv)
     //FIXME: dirty cleanup method to avoid using msg cleanup functions on these processes when using MSG+SMPI
     SIMIX_process_set_cleanup_function(proc, SIMIX_process_cleanup);
     char* instance_id = (*argv)[1];
-    int rank = atoi((*argv)[2]);
+    int rank = xbt_str_parse_int((*argv)[2], "Invalid rank: %s");
     index = smpi_process_index_of_smx_process(proc);
 
     if(!index_to_process_data){
@@ -207,13 +207,9 @@ int smpi_process_get_replaying(){
 int smpi_global_size(void)
 {
   char *value = getenv("SMPI_GLOBAL_SIZE");
+  xbt_assert(value,"Please set env var SMPI_GLOBAL_SIZE to the expected number of processes.");
 
-  if (!value) {
-    fprintf(stderr,
-            "Please set env var SMPI_GLOBAL_SIZE to expected number of processes.\n");
-    xbt_abort();
-  }
-  return atoi(value);
+  return xbt_str_parse_int(value, "SMPI_GLOBAL_SIZE contains a non-numerical value: %s");
 }
 
 smpi_process_data_t smpi_process_data(void)
index 041abb7..9ecbb8a 100644 (file)
@@ -431,7 +431,7 @@ void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t
   }
 
   // The first parts of topo_parameters should be the levels number
-  this->levels = std::atoi(parameters[0].c_str()); // stoi() only in C++11...
+  this->levels = xbt_str_parse_int(parameters[0].c_str(), "First parameter is not the amount of levels: %s");
   
   // Then, a l-sized vector standing for the childs number by level
   boost::split(tmp, parameters[1], boost::is_any_of(","));
@@ -440,7 +440,7 @@ void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t
                      ", see the documentation for more informations"); 
   }
   for(size_t i = 0 ; i < tmp.size() ; i++){
-    this->lowerLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); 
+    this->lowerLevelNodesNumber.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid lower level node number: %s"));
   }
   
   // Then, a l-sized vector standing for the parents number by level
@@ -450,7 +450,7 @@ void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t
                      ", see the documentation for more informations"); 
   }
   for(size_t i = 0 ; i < tmp.size() ; i++){
-    this->upperLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); 
+    this->upperLevelNodesNumber.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid upper level node number: %s"));
   }
   
   // Finally, a l-sized vector standing for the ports number with the lower level
@@ -461,7 +461,7 @@ void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t
     
   }
   for(size_t i = 0 ; i < tmp.size() ; i++){
-    this->lowerLevelPortsNumber.push_back(std::atoi(tmp[i].c_str())); 
+    this->lowerLevelPortsNumber.push_back(xbt_str_parse_int(tmp[i].c_str(), "Invalid lower level node number: %s"));
   }
   this->cluster = cluster;
 }