- double runtime = xbt_str_parse_double(A_dax__job_runtime, "Parse error: %s is not a double");
- char *name = bprintf("%s@%s", A_dax__job_id, A_dax__job_name);
- runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
- XBT_DEBUG("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
- current_job = SD_task_create_comp_seq(name, nullptr, runtime);
- xbt_dict_set(jobs, A_dax__job_id, current_job, nullptr);
- free(name);
- xbt_dynar_push(result, ¤t_job);
+ try {
+ double runtime = std::stod(std::string(A_dax__job_runtime));
+
+ std::string name = std::string(A_dax__job_id) + "@" + A_dax__job_name;
+ runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
+ XBT_DEBUG("See <job id=%s runtime=%s %.0f>", A_dax__job_id, A_dax__job_runtime, runtime);
+ current_job = SD_task_create_comp_seq(name.c_str(), nullptr, runtime);
+ jobs.insert({A_dax__job_id, current_job});
+ xbt_dynar_push(result, ¤t_job);
+ } catch (const std::invalid_argument&) {
+ throw std::invalid_argument(std::string("Parse error: ") + A_dax__job_runtime + " is not a double");
+ }