X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ede7d4e0f2464d8646f1d1a3b09fa7f678660ade..84c998f37a79bac94865047e272a49baa48985de:/src/surf/surf_c_bindings.cpp diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 08e1e516ff..bd807adb75 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -44,7 +44,7 @@ void surf_presolve(void) while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) { if (value >= 0){ - resource->updateState(event, value); + resource->apply_event(event, value); } } } @@ -65,9 +65,6 @@ double surf_solve(double max_date) tmgr_trace_iterator_t event = NULL; unsigned int iter; - if(!host_that_restart) - host_that_restart = xbt_dynar_new(sizeof(char*), NULL); - if (max_date > 0.0) { xbt_assert(max_date > NOW,"You asked to simulate up to %f, but that's in the past already", max_date); @@ -124,7 +121,7 @@ double surf_solve(double max_date) while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) { if (resource->isUsed() || xbt_dict_get_or_null(watched_hosts_lib, resource->getName())) { time_delta = next_event_date - NOW; - XBT_DEBUG("This event will modify model state. Next event set to %f", time_delta); + XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta); } // FIXME: I'm too lame to update NOW live, so I change it and restore it so that the real update with surf_min will work double round_start = NOW; @@ -132,7 +129,7 @@ double surf_solve(double max_date) /* update state of the corresponding resource to the new value. Does not touch lmm. It will be modified if needed when updating actions */ XBT_DEBUG("Calling update_resource_state for resource %s", resource->getName()); - resource->updateState(event, value); + resource->apply_event(event, value); NOW = round_start; } } @@ -263,9 +260,8 @@ xbt_dynar_t surf_host_get_vms(sg_host_t host){ unsigned int cpt; simgrid::surf::VirtualMachine *vm; xbt_dynar_foreach(vms, cpt, vm) { - // TODO, use a backlink from simgrid::surf::Host to simgrid::s4u::Host - sg_host_t vm_ = (sg_host_t) xbt_dict_get_elm_or_null(host_list, vm->getName()); - xbt_dynar_push(vms_, &vm_); + sg_host_t cpy_ = vm->getHost(); + xbt_dynar_push(vms_, &cpy_); } xbt_dynar_free(&vms); return vms_;