- buf = A_surfxml_host_speed;
- XBT_DEBUG("Buffer: %s", buf);
- host.speed_peak = xbt_dynar_new(sizeof(double), nullptr);
- if (strchr(buf, ',') == nullptr){
- double speed = surf_parse_get_speed(A_surfxml_host_speed,"speed of host", host.id);
- xbt_dynar_push_as(host.speed_peak,double, speed);
- }
- else {
- xbt_dynar_t pstate_list = xbt_str_split(buf, ",");
- unsigned int i;
- for (i = 0; i < xbt_dynar_length(pstate_list); i++) {
- double speed;
- char* speed_str;
-
- xbt_dynar_get_cpy(pstate_list, i, &speed_str);
- xbt_str_trim(speed_str, nullptr);
- speed = surf_parse_get_speed(speed_str,"speed of host", host.id);
- xbt_dynar_push_as(host.speed_peak, double, speed);
- XBT_DEBUG("Speed value: %f", speed);
- }
- xbt_dynar_free(&pstate_list);
- }