X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c91b5a0dff704f2fe08d3480a12cc15f1a8b4081..5e7d79b763a5f55d1afb579d2b5a8d30ccfe869c:/src/simix/ActorImpl.hpp diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 03966bf846..c2449fbfd8 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -19,17 +19,30 @@ struct s_smx_process_exit_fun_t { }; namespace simgrid { -namespace simix { +namespace kernel { +namespace actor { class ProcessArg { public: std::string name; std::function code; - void *data = nullptr; - sg_host_t host = nullptr; + void* data = nullptr; + s4u::Host* host = nullptr; double kill_time = 0.0; std::shared_ptr> properties; bool auto_restart = false; + ProcessArg() = default; + explicit ProcessArg(std::string name, std::function code, void* data, s4u::Host* host, double kill_time, + std::shared_ptr> properties, bool auto_restart) + : name(name) + , code(std::move(code)) + , data(data) + , host(host) + , kill_time(kill_time) + , properties(properties) + , auto_restart(auto_restart) + { + } }; class ActorImpl : public simgrid::surf::PropertyHolder { @@ -56,7 +69,6 @@ public: bool suspended = false; bool auto_restart = false; - sg_host_t new_host = nullptr; /* if not null, the host on which the process must migrate to */ smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */ std::list comms; /* the current non-blocking communication synchros */ s_smx_simcall_t simcall; @@ -65,7 +77,6 @@ public: std::function code; smx_timer_t kill_timer = nullptr; - int segment_index = -1; /* Reference to an SMPI process' data segment. Default value is -1 if not in SMPI context*/ /* Refcounting */ private: @@ -113,12 +124,17 @@ public: void* getUserData() { return userdata; } }; -} -} +/* Used to keep the list of actors blocked on a synchro */ +typedef boost::intrusive::list, + &ActorImpl::smx_synchro_hook>> + SynchroList; -typedef simgrid::simix::ProcessArg *smx_process_arg_t; +XBT_PUBLIC void create_maestro(std::function code); +} +} // namespace kernel +} // namespace simgrid -typedef simgrid::simix::ActorImpl* smx_actor_t; +typedef simgrid::kernel::actor::ActorImpl* smx_actor_t; extern "C" { @@ -128,18 +144,15 @@ XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function