X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1fd664b43fb86c61c7f394c6d23de727cee5bc46..bab5efc96624e2d815745cd0c9c0b29118d88f39:/src/surf/sg_platf.cpp diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 3adc2e1aeb..5236231be1 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -115,9 +115,11 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu( h, host->speed_peak, - host->speed_trace, - host->core_amount, - host->state_trace); + host->core_amount); + if (host->state_trace) + cpu->setStateTrace(host->state_trace); + if (host->speed_trace) + cpu->setSpeedTrace(host->speed_trace); surf_host_model->createHost(host->id, netcard, cpu, host->properties)->attach(h); if (host->pstate != 0) @@ -270,7 +272,8 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) xbt_dict_set(patterns, "radical", bprintf("%d", i), NULL); char *avail_file = xbt_str_varsubst(cluster->availability_trace, patterns); XBT_DEBUG("\tavailability_file=\"%s\"", avail_file); - host.speed_trace = tmgr_trace_new_from_file(avail_file); + if (avail_file && avail_file[0]) + host.speed_trace = tmgr_trace_new_from_file(avail_file); xbt_free(avail_file); } else { XBT_DEBUG("\tavailability_file=\"\""); @@ -279,7 +282,8 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) if (cluster->state_trace && strcmp(cluster->state_trace, "")) { char *avail_file = xbt_str_varsubst(cluster->state_trace, patterns); XBT_DEBUG("\tstate_file=\"%s\"", avail_file); - host.state_trace = tmgr_trace_new_from_file(avail_file); + if (avail_file && avail_file[0]) + host.state_trace = tmgr_trace_new_from_file(avail_file); xbt_free(avail_file); } else { XBT_DEBUG("\tstate_file=\"\"");