X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3eb95bea2b4188d46fa0cb4d652dd1d200f1e12..0f116580b8868f181e8bc3f78d0f1f783ad3eef8:/src/simix/smx_new_api.c diff --git a/src/simix/smx_new_api.c b/src/simix/smx_new_api.c index e2c289045d..eb0a9f1981 100644 --- a/src/simix/smx_new_api.c +++ b/src/simix/smx_new_api.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -68,9 +68,9 @@ smx_action_t SIMIX_new_api_fct(smx_process_t process, const char* param1, double /* check if the host is active */ if (surf_workstation_model->extension. - workstation.get_state(host->host) != SURF_RESOURCE_ON) { + workstation.get_state(host) != SURF_RESOURCE_ON) { THROWF(host_error, 0, "Host %s failed, you cannot call this function", - host->name); + sg_host_name(host)); } action = xbt_mallocator_get(simix_global->action_mallocator); @@ -80,7 +80,8 @@ smx_action_t SIMIX_new_api_fct(smx_process_t process, const char* param1, double action->category = NULL; #endif - action->new_api.surf_new_api = NULL; + // Called the function from the new model + action->new_api.surf_new_api = surf_workstation_model->extension.new_model.fct(); surf_workstation_model->action_data_set(action->new_api.surf_new_api, action); XBT_DEBUG("Create NEW MODEL action %p", action); @@ -123,7 +124,7 @@ void SIMIX_new_api_finish(smx_action_t action) } if (surf_workstation_model->extension. - workstation.get_state(simcall->issuer->smx_host->host) != SURF_RESOURCE_ON) { + workstation.get_state(simcall->issuer->smx_host) != SURF_RESOURCE_ON) { simcall->issuer->context->iwannadie = 1; }