X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5623028f32d7821973a11d81306c72380859cb17..7bac600c529ba83f8f246a2dcfa9ddd9c0095675:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 1844ad77c7..592a10156a 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -10,6 +10,7 @@ #include "xbt/dict.h" #include "mc/mc.h" #include "src/mc/mc_replay.h" +#include "src/surf/virtual_machine.hpp" #include "src/surf/host_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, @@ -264,8 +265,8 @@ void SIMIX_host_autorestart(sg_host_t host) } smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall, - const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) { - return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask); + const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) { + return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask); } smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name, double flops_amount, double priority, double bound, unsigned long affinity_mask){ @@ -323,26 +324,19 @@ smx_synchro_t SIMIX_execution_parallel_start(const char *name, for (i = 0; i < host_nb; i++) host_list_cpy[i] = host_list[i]; - - /* FIXME: what happens if host_list contains VMs and PMs. If - * execute_parallel_task() does not change the state of the model, we can mix - * them. */ - surf_host_model_t ws_model = - host_list[0]->extension()->getModel(); + /* Check that we are not mixing VMs and PMs in the parallel task */ + simgrid::surf::Host *host = host_list[0]->extension(); + bool is_a_vm = (nullptr != dynamic_cast(host)); for (i = 1; i < host_nb; i++) { - surf_host_model_t ws_model_tmp = - host_list[i]->extension()->getModel(); - if (ws_model_tmp != ws_model) { - XBT_CRITICAL("mixing VMs and PMs is not supported"); - DIE_IMPOSSIBLE; - } + bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i]->extension())); + xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet)."); } /* set surf's synchro */ if (!MC_is_active() && !MC_record_replay_is_active()) { synchro->execution.surf_exec = surf_host_model->executeParallelTask( - host_nb, host_list_cpy, flops_amount, bytes_amount, rate); + host_nb, host_list_cpy, flops_amount, bytes_amount, rate); synchro->execution.surf_exec->setData(synchro); }