X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/06bb605c18bd9a9b704b0415d41ab31e02b49839..2eae9b903fa523a15a5c8b4adb4471b6bd1e0af1:/src/surf/workstation.c diff --git a/src/surf/workstation.c b/src/surf/workstation.c index 19cdad3be0..4a5cb42af4 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -127,24 +127,26 @@ static surf_action_t action_sleep(void *workstation, double duration) static void action_suspend(surf_action_t action) { - xbt_assert0(action->resource_type == - ((surf_resource_t) surf_cpu_resource), - "Resource type mismatch"); - surf_cpu_resource->extension_public->suspend(action); + if(action->resource_type==(surf_resource_t)surf_network_resource) + surf_network_resource->extension_public->suspend(action); + else if(action->resource_type==(surf_resource_t)surf_cpu_resource) + surf_cpu_resource->extension_public->suspend(action); + else DIE_IMPOSSIBLE; } static void action_resume(surf_action_t action) { - xbt_assert0(action->resource_type == - ((surf_resource_t) surf_cpu_resource), - "Resource type mismatch"); - surf_cpu_resource->extension_public->resume(action); + if(action->resource_type==(surf_resource_t)surf_network_resource) + surf_network_resource->extension_public->resume(action); + else if(action->resource_type==(surf_resource_t)surf_cpu_resource) + surf_cpu_resource->extension_public->resume(action); + else DIE_IMPOSSIBLE; } static int action_is_suspended(surf_action_t action) { if(action->resource_type==(surf_resource_t)surf_network_resource) - return 0; + return surf_network_resource->extension_public->is_suspended(action); if(action->resource_type==(surf_resource_t)surf_cpu_resource) return surf_cpu_resource->extension_public->is_suspended(action); DIE_IMPOSSIBLE; @@ -241,14 +243,25 @@ static void surf_workstation_resource_init_internal(void) xbt_assert0(maxmin_system, "surf_init has to be called first!"); } -void surf_workstation_resource_init(const char *filename) +/********************************************************************/ +/* The model used in MSG and presented at CCGrid03 */ +/********************************************************************/ +/* @InProceedings{Casanova.CLM_03, */ +/* author = {Henri Casanova and Arnaud Legrand and Loris Marchal}, */ +/* title = {Scheduling Distributed Applications: the SimGrid Simulation Framework}, */ +/* booktitle = {Proceedings of the third IEEE International Symposium on Cluster Computing and the Grid (CCGrid'03)}, */ +/* publisher = {"IEEE Computer Society Press"}, */ +/* month = {may}, */ +/* year = {2003} */ +/* } */ +void surf_workstation_resource_init_CLM03(const char *filename) { /* int i ; */ /* surf_resource_t resource = NULL; */ surf_workstation_resource_init_internal(); - surf_cpu_resource_init(filename); - surf_network_resource_init(filename); + surf_cpu_resource_init_Cas01(filename); + surf_network_resource_init_CM02(filename); create_workstations(); xbt_dynar_push(resource_list, &surf_workstation_resource); /* xbt_dynar_foreach(resource_list, i, resource) { */