X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/16bbb8a8212497d9c44c81333ed2c0e689e0c5af..7bac600c529ba83f8f246a2dcfa9ddd9c0095675:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index b362a16c2d..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, @@ -323,19 +324,12 @@ 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 */