#include "src/surf/surf_interface.hpp"
#include "src/simix/smx_host_private.h"
+simgrid::simix::Exec::Exec(const char*name, sg_host_t hostarg)
+{
+ name = xbt_strdup(name);
+ state = SIMIX_RUNNING;
+ host = hostarg;
+}
simgrid::simix::Exec::~Exec()
{
if (surf_exec)
XBT_PUBLIC_CLASS Exec : public Synchro {
~Exec();
public:
+ Exec(const char*name, sg_host_t host);
void suspend() override;
void resume() override;
void post() override;
double remains();
- sg_host_t host; /* The host where the execution takes place */
- surf_action_t surf_exec; /* The Surf execution action encapsulated */
+ sg_host_t host; /* The host where the execution takes place. If NULL, then this is a parallel exec (and only surf knows the hosts) */
+ surf_action_t surf_exec=nullptr;/* The Surf execution action encapsulated */
};
}} // namespace simgrid::simix
double flops_amount, double priority, double bound, unsigned long affinity_mask){
/* alloc structures and initialize */
- simgrid::simix::Exec *exec = new simgrid::simix::Exec();
- exec->name = xbt_strdup(name);
- exec->state = SIMIX_RUNNING;
- exec->host = issuer->host;
+ simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, issuer->host);
/* set surf's action */
if (!MC_is_active() && !MC_record_replay_is_active()) {
int i;
/* alloc structures and initialize */
- simgrid::simix::Exec *exec = new simgrid::simix::Exec();
- exec->name = xbt_strdup(name);
- exec->state = SIMIX_RUNNING;
- exec->host = nullptr; /* FIXME: do we need the list of hosts? */
+ simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, nullptr);
/* set surf's synchro */
host_list_cpy = xbt_new0(sg_host_t, host_nb);