X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d4f45383d774dcee4a79b3ca281c6180b9005f04..54f9d48567e65bd17b9ad3544b5aad57bef54463:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 37c3479b7b..7b69ef0e81 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -17,30 +17,20 @@ simgrid::kernel::activity::ExecImplPtr SIMIX_execution_parallel_start(std::string name, int host_nb, const sg_host_t* host_list, const double* flops_amount, const double* bytes_amount, double rate, double timeout) { + simgrid::kernel::activity::ExecImplPtr exec = + simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(std::move(name), "")); - /* Check that we are not mixing VMs and PMs in the parallel task */ - bool is_a_vm = (nullptr != dynamic_cast(host_list[0])); - for (int i = 1; i < host_nb; i++) { - bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i])); - xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet)."); - } - + std::vector hosts; + for (int i = 0; i < host_nb; i++) + hosts.push_back(host_list[i]); /* set surf's synchro */ - simgrid::kernel::resource::Action* surf_action = nullptr; - simgrid::kernel::resource::Action* timeout_detector = nullptr; if (not MC_is_active() && not MC_record_replay_is_active()) { - surf_action = surf_host_model->execute_parallel(host_nb, host_list, flops_amount, bytes_amount, rate); - if (timeout > 0) { - timeout_detector = host_list[0]->pimpl_cpu->sleep(timeout); + exec->surf_action_ = surf_host_model->execute_parallel(hosts, flops_amount, bytes_amount, rate); + if (exec->surf_action_ != nullptr) { + exec->surf_action_->set_data(exec.get()); } } - simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr( - new simgrid::kernel::activity::ExecImpl(std::move(name), "", timeout_detector, nullptr)); - if (surf_action != nullptr) { - exec->surf_action_ = surf_action; - exec->surf_action_->set_data(exec.get()); - } XBT_DEBUG("Create parallel execute synchro %p", exec.get()); return exec;