Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanitize the prototype of Actor::on_exit() callbacks
[simgrid.git] / src / simix / smx_host.cpp
1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "mc/mc.h"
7 #include "smx_private.hpp"
8 #include "src/kernel/activity/CommImpl.hpp"
9 #include "src/kernel/activity/ExecImpl.hpp"
10 #include "src/mc/mc_replay.hpp"
11 #include "src/plugins/vm/VirtualMachineImpl.hpp"
12 #include "src/simix/smx_host_private.hpp"
13
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts");
15
16 simgrid::kernel::activity::ExecImplPtr
17 SIMIX_execution_parallel_start(std::string name, int host_nb, const sg_host_t* host_list, const double* flops_amount,
18                                const double* bytes_amount, double rate, double timeout)
19 {
20   simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr(
21       new simgrid::kernel::activity::ExecImpl(std::move(name), "", host_list[0], timeout));
22
23   /* set surf's synchro */
24   if (not MC_is_active() && not MC_record_replay_is_active()) {
25     exec->surf_action_ = surf_host_model->execute_parallel(host_nb, host_list, flops_amount, bytes_amount, rate);
26     if (exec->surf_action_ != nullptr) {
27       exec->surf_action_->set_data(exec.get());
28     }
29   }
30
31   XBT_DEBUG("Create parallel execute synchro %p", exec.get());
32
33   return exec;
34 }
35