X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ee768b7c404f66fb8b45e919a2ad9f7dc795bdc..2558c8c0eb206ff353cb88672f5a90cd0e2562d3:/src/simix/libsmx.cpp diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 16347e9a52..9947bf18cb 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -384,10 +384,9 @@ smx_activity_t simcall_execution_start(const std::string& name, const std::strin double priority, double bound, sg_host_t host) { return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] { - return simgrid::kernel::activity::ExecImplPtr( - new simgrid::kernel::activity::ExecImpl(std::move(name), std::move(category))) - ->set_host(host) - ->start(flops_amount, priority, bound); + simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(); + (*exec).set_name(name).set_tracing_category(category).set_host(host).start(flops_amount, priority, bound); + return simgrid::kernel::activity::ExecImplPtr(exec); }); } @@ -416,19 +415,17 @@ smx_activity_t simcall_execution_parallel_start(const std::string& name, int hos } xbt_assert(std::isfinite(rate), "rate is not finite!"); - std::vector hosts; + std::vector hosts(host_list, host_list + host_nb); std::vector flops_parallel_amount; std::vector bytes_parallel_amount; - for (int i = 0; i < host_nb; i++) { - hosts.push_back(host_list[i]); - flops_parallel_amount.push_back(flops_amount[i]); - for (int j = 0; j < host_nb; j++) - bytes_parallel_amount.push_back(bytes_amount[i]); - } + if (flops_amount != nullptr) + flops_parallel_amount = std::vector(flops_amount, flops_amount + host_nb); + if (bytes_amount != nullptr) + bytes_parallel_amount = std::vector(bytes_amount, bytes_amount + host_nb * host_nb); return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] { - return simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(std::move(name), "")) - ->set_timeout(timeout) - ->start(hosts, flops_parallel_amount, bytes_parallel_amount); + simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(); + (*exec).set_name(name).set_timeout(timeout).start(hosts, flops_parallel_amount, bytes_parallel_amount); + return simgrid::kernel::activity::ExecImplPtr(exec); }); }