From: Frederic Suter Date: Sun, 17 Feb 2019 22:12:36 +0000 (+0100) Subject: SIMIX_process_cleanup becomes ActorImpl::Cleanup X-Git-Tag: v3_22~315 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/247fba2eee61dc2a8e06c6f1339437dcb4481c3b SIMIX_process_cleanup becomes ActorImpl::Cleanup There is no more need to pass the callback on an external function when creating context. --- diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index 99642af77f..4dd0cc6950 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -34,10 +34,9 @@ JavaContextFactory::JavaContextFactory() : ContextFactory() JavaContextFactory::~JavaContextFactory()=default; -JavaContext* JavaContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup_fun, - smx_actor_t actor) +JavaContext* JavaContextFactory::create_context(std::function code, smx_actor_t actor) { - return this->new_context(std::move(code), cleanup_fun, actor); + return this->new_context(std::move(code), actor); } void JavaContextFactory::run_all() @@ -45,8 +44,8 @@ void JavaContextFactory::run_all() SerialThreadContext::run_all(); } -JavaContext::JavaContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process) - : SerialThreadContext(std::move(code), cleanup_func, process, false /* not maestro */) +JavaContext::JavaContext(std::function code, smx_actor_t actor) + : SerialThreadContext(std::move(code), actor, false /* not maestro */) { /* ThreadContext already does all we need */ } diff --git a/src/bindings/java/JavaContext.hpp b/src/bindings/java/JavaContext.hpp index f1e0570378..0a750b2a68 100644 --- a/src/bindings/java/JavaContext.hpp +++ b/src/bindings/java/JavaContext.hpp @@ -32,9 +32,7 @@ public: JNIEnv* jenv_ = nullptr; friend class JavaContextFactory; - JavaContext(std::function code, - void_pfn_smxprocess_t cleanup_func, - smx_actor_t process); + JavaContext(std::function code, smx_actor_t actor); void start_hook() override; void stop_hook() override; @@ -44,8 +42,7 @@ class JavaContextFactory : public simgrid::kernel::context::ContextFactory { public: JavaContextFactory(); ~JavaContextFactory() override; - JavaContext* create_context(std::function code, - void_pfn_smxprocess_t, smx_actor_t process) override; + JavaContext* create_context(std::function code, smx_actor_t actor) override; void run_all() override; }; diff --git a/src/include/xbt/parmap.hpp b/src/include/xbt/parmap.hpp index 22b5bc225a..36da54f332 100644 --- a/src/include/xbt/parmap.hpp +++ b/src/include/xbt/parmap.hpp @@ -10,6 +10,7 @@ #include "src/internal_config.h" // HAVE_FUTEX_H #include "src/kernel/context/Context.hpp" +#include "src/simix/smx_private.hpp" /* simix_global */ #include #include @@ -295,7 +296,7 @@ template void* Parmap::worker_main(void* arg) ThreadData* data = static_cast(arg); Parmap& parmap = data->parmap; unsigned round = 0; - smx_context_t context = SIMIX_context_new(std::function(), nullptr, nullptr); + smx_context_t context = simix_global->context_factory->create_context(std::function(), nullptr); kernel::context::Context::set_current(context); XBT_CDEBUG(xbt_parmap, "New worker thread created"); diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 5f754be6ea..1a51d042ed 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -13,20 +13,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); -/** - * @brief creates a new context for a user level process - * @param code a main function - * @param cleanup_func the function to call when the context stops - * @param simix_process - */ -smx_context_t SIMIX_context_new( - std::function code, - void_pfn_smxprocess_t cleanup_func, - smx_actor_t simix_process) -{ - return simix_global->context_factory->create_context( - std::move(code), cleanup_func, simix_process); -} namespace simgrid { namespace kernel { @@ -55,7 +41,7 @@ void Context::declare_context(std::size_t size) #endif } -Context* ContextFactory::attach(void_pfn_smxprocess_t, smx_actor_t) +Context* ContextFactory::attach(smx_actor_t) { xbt_die("Cannot attach with this ContextFactory.\n" "Try using --cfg=contexts/factory:thread instead.\n"); @@ -67,8 +53,7 @@ Context* ContextFactory::create_maestro(std::function, smx_actor_t) "Try using --cfg=contexts/factory:thread instead.\n"); } -Context::Context(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor) - : code_(std::move(code)), cleanup_func_(cleanup_func), actor_(actor) +Context::Context(std::function code, smx_actor_t actor) : code_(std::move(code)), actor_(actor) { /* If no function was provided, this is the context for maestro * and we should set it as the current context */ @@ -108,8 +93,8 @@ void Context::stop() XBT_DEBUG("%s@%s(%ld) should not run anymore", actor_->get_cname(), actor_->iface()->get_host()->get_cname(), actor_->get_pid()); - if (this->cleanup_func_) - this->cleanup_func_(this->actor_); + if (this->actor_ == simix_global->maestro_process) /* Do not cleanup maestro */ + this->actor_->cleanup(); this->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), because that's me simgrid::simix::simcall([this] { @@ -121,7 +106,7 @@ void Context::stop() actor_->kill_timer = nullptr; } - SIMIX_process_cleanup(actor_); + actor_->cleanup(); }); this->iwannadie = true; } diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index a46b2d32f6..42a1ca4552 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -12,9 +12,6 @@ #include #include -/* Process creation/destruction callbacks */ -typedef void (*void_pfn_smxprocess_t)(smx_actor_t); - namespace simgrid { namespace kernel { namespace context { @@ -23,12 +20,12 @@ class XBT_PUBLIC ContextFactory { public: explicit ContextFactory() {} virtual ~ContextFactory(); - virtual Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0; + virtual Context* create_context(std::function code, smx_actor_t actor) = 0; /** Turn the current thread into a simulation context */ - virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process); + virtual Context* attach(smx_actor_t actor); /** Turn the current thread into maestro (the old maestro becomes a regular actor) */ - virtual Context* create_maestro(std::function code, smx_actor_t process); + virtual Context* create_maestro(std::function code, smx_actor_t actor); virtual void run_all() = 0; @@ -46,14 +43,13 @@ class XBT_PUBLIC Context { private: std::function code_; - void_pfn_smxprocess_t cleanup_func_ = nullptr; smx_actor_t actor_ = nullptr; void declare_context(std::size_t size); public: bool iwannadie = false; - Context(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor); + Context(std::function code, smx_actor_t actor); Context(const Context&) = delete; Context& operator=(const Context&) = delete; virtual ~Context(); @@ -61,7 +57,6 @@ public: void operator()() { code_(); } bool has_code() const { return static_cast(code_); } smx_actor_t get_actor() { return this->actor_; } - void set_cleanup(void_pfn_smxprocess_t cleanup) { cleanup_func_ = cleanup; } // Scheduling methods virtual void stop(); @@ -76,10 +71,7 @@ public: class XBT_PUBLIC AttachContext : public Context { public: - AttachContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor) - : Context(std::move(code), cleanup_func, actor) - { - } + AttachContext(std::function code, smx_actor_t actor) : Context(std::move(code), actor) {} ~AttachContext() override; @@ -127,9 +119,6 @@ typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t; XBT_PRIVATE void SIMIX_context_mod_init(); XBT_PRIVATE void SIMIX_context_mod_exit(); -XBT_PUBLIC smx_context_t SIMIX_context_new(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_actor_t simix_process); - #ifndef WIN32 XBT_PUBLIC_DATA char sigsegv_stack[SIGSTKSZ]; #endif diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 6153c41878..b1deb29184 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -15,17 +15,15 @@ namespace kernel { namespace context { // BoostContextFactory -smx_context_t BoostContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_actor_t process) +smx_context_t BoostContextFactory::create_context(std::function code, smx_actor_t actor) { - return this->new_context(std::move(code), cleanup_func, process, this); + return this->new_context(std::move(code), actor, this); } // BoostContext -BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup_func, actor, factory) +BoostContext::BoostContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) + : SwappedContext(std::move(code), actor, factory) { /* if the user provided a function for the process then use it, otherwise it is the context for maestro */ diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index 12bca09a2e..a078407592 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -32,8 +32,7 @@ namespace context { /** @brief Userspace context switching implementation based on Boost.Context */ class BoostContext : public SwappedContext { public: - BoostContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - SwappedContextFactory* factory); + BoostContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory); ~BoostContext() override; void swap_into(SwappedContext* to) override; @@ -55,7 +54,7 @@ private: class BoostContextFactory : public SwappedContextFactory { public: - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; + Context* create_context(std::function code, smx_actor_t actor) override; }; }}} // namespace diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 84d742c45c..e651a46565 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -186,17 +186,15 @@ namespace context { // RawContextFactory -Context* RawContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_actor_t process) +Context* RawContextFactory::create_context(std::function code, smx_actor_t actor) { - return this->new_context(std::move(code), cleanup_func, process, this); + return this->new_context(std::move(code), actor, this); } // RawContext -RawContext::RawContext(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor, - SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup, actor, factory) +RawContext::RawContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) + : SwappedContext(std::move(code), actor, factory) { if (has_code()) { this->stack_top_ = raw_makecontext(get_stack(), smx_context_usable_stack_size, RawContext::wrapper, this); diff --git a/src/kernel/context/ContextRaw.hpp b/src/kernel/context/ContextRaw.hpp index ab3967b6b2..40b74a4b10 100644 --- a/src/kernel/context/ContextRaw.hpp +++ b/src/kernel/context/ContextRaw.hpp @@ -26,8 +26,7 @@ namespace context { */ class RawContext : public SwappedContext { public: - RawContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - SwappedContextFactory* factory); + RawContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory); void swap_into(SwappedContext* to) override; @@ -40,7 +39,7 @@ private: class RawContextFactory : public SwappedContextFactory { public: - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; + Context* create_context(std::function code, smx_actor_t actor) override; }; }}} // namespace diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 2e964404dc..7a2de5b9bb 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -47,9 +47,8 @@ SwappedContextFactory::~SwappedContextFactory() delete parmap_; } -SwappedContext::SwappedContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, - SwappedContextFactory* factory) - : Context(std::move(code), cleanup_func, process), factory_(factory) +SwappedContext::SwappedContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) + : Context(std::move(code), actor), factory_(factory) { // Save maestro (=context created first) in preparation for run_all if (not factory->parallel_ && factory_->workers_context_[0] == nullptr) diff --git a/src/kernel/context/ContextSwapped.hpp b/src/kernel/context/ContextSwapped.hpp index aba97d5b95..507fbb0bcd 100644 --- a/src/kernel/context/ContextSwapped.hpp +++ b/src/kernel/context/ContextSwapped.hpp @@ -35,8 +35,7 @@ private: class SwappedContext : public Context { public: - SwappedContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t get_actor, - SwappedContextFactory* factory); + SwappedContext(std::function code, smx_actor_t get_actor, SwappedContextFactory* factory); virtual ~SwappedContext(); void suspend() override; diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index cb9cab4e81..a164339ef0 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -34,13 +34,12 @@ ThreadContextFactory::~ThreadContextFactory() ParallelThreadContext::finalize(); } -ThreadContext* ThreadContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup, - smx_actor_t actor, bool maestro) +ThreadContext* ThreadContextFactory::create_context(std::function code, smx_actor_t actor, bool maestro) { if (parallel_) - return this->new_context(std::move(code), cleanup, actor, maestro); + return this->new_context(std::move(code), actor, maestro); else - return this->new_context(std::move(code), cleanup, actor, maestro); + return this->new_context(std::move(code), actor, maestro); } void ThreadContextFactory::run_all() @@ -56,8 +55,8 @@ void ThreadContextFactory::run_all() // ThreadContext -ThreadContext::ThreadContext(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor, bool maestro) - : AttachContext(std::move(code), cleanup, actor), is_maestro_(maestro) +ThreadContext::ThreadContext(std::function code, smx_actor_t actor, bool maestro) + : AttachContext(std::move(code), actor), is_maestro_(maestro) { /* If the user provided a function for the actor then use it */ if (has_code()) { diff --git a/src/kernel/context/ContextThread.hpp b/src/kernel/context/ContextThread.hpp index 09ac695785..6f6125a59b 100644 --- a/src/kernel/context/ContextThread.hpp +++ b/src/kernel/context/ContextThread.hpp @@ -20,7 +20,7 @@ namespace context { class XBT_PUBLIC ThreadContext : public AttachContext { public: - ThreadContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, bool maestro); + ThreadContext(std::function code, smx_actor_t actor, bool maestro); ~ThreadContext() override; void stop() override; void suspend() override; @@ -51,8 +51,8 @@ private: class XBT_PUBLIC SerialThreadContext : public ThreadContext { public: - SerialThreadContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, bool maestro) - : ThreadContext(std::move(code), cleanup_func, actor, maestro) + SerialThreadContext(std::function code, smx_actor_t actor, bool maestro) + : ThreadContext(std::move(code), actor, maestro) { } @@ -61,8 +61,8 @@ public: class ParallelThreadContext : public ThreadContext { public: - ParallelThreadContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, bool maestro) - : ThreadContext(std::move(code), cleanup_func, actor, maestro) + ParallelThreadContext(std::function code, smx_actor_t actor, bool maestro) + : ThreadContext(std::move(code), actor, maestro) { } @@ -81,29 +81,24 @@ class ThreadContextFactory : public ContextFactory { public: ThreadContextFactory(); ~ThreadContextFactory() override; - ThreadContext* create_context(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_actor_t actor) override + ThreadContext* create_context(std::function code, smx_actor_t actor) override { bool maestro = not code; - return create_context(std::move(code), cleanup_func, actor, maestro); + return create_context(std::move(code), actor, maestro); } void run_all() override; // Optional methods: - ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t actor) override - { - return create_context(std::function(), cleanup_func, actor, false); - } + ThreadContext* attach(smx_actor_t actor) override { return create_context(std::function(), actor, false); } ThreadContext* create_maestro(std::function code, smx_actor_t actor) override { - return create_context(std::move(code), nullptr, actor, true); + return create_context(std::move(code), actor, true); } private: bool parallel_; - ThreadContext* create_context(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - bool maestro); + ThreadContext* create_context(std::function code, smx_actor_t actor, bool maestro); }; }}} // namespace diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index a39ef84980..ad79b5e732 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -56,17 +56,16 @@ namespace kernel { namespace context { // UContextFactory -Context* UContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor) +Context* UContextFactory::create_context(std::function code, smx_actor_t actor) { - return new_context(std::move(code), cleanup, actor, this); + return new_context(std::move(code), actor, this); } // UContext -UContext::UContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup_func, actor, factory) +UContext::UContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) + : SwappedContext(std::move(code), actor, factory) { /* if the user provided a function for the actor then use it. If not, nothing to do for maestro. */ if (has_code()) { diff --git a/src/kernel/context/ContextUnix.hpp b/src/kernel/context/ContextUnix.hpp index d136c5a247..a3cc5e1568 100644 --- a/src/kernel/context/ContextUnix.hpp +++ b/src/kernel/context/ContextUnix.hpp @@ -25,8 +25,7 @@ namespace context { class UContext : public SwappedContext { public: - UContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, - SwappedContextFactory* factory); + UContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory); void swap_into(SwappedContext* to) override; @@ -36,7 +35,7 @@ private: class UContextFactory : public SwappedContextFactory { public: - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor) override; + Context* create_context(std::function code, smx_actor_t actor) override; }; }}} // namespace diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 67dbfcdffc..4637cc3ab1 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -50,30 +50,6 @@ int SIMIX_process_has_pending_comms(smx_actor_t process) { return process->comms.size() > 0; } -/** - * @brief Moves a process to the list of processes to destroy. - */ -void SIMIX_process_cleanup(smx_actor_t process) -{ - XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->get_cname(), process, - process->waiting_synchro.get()); - - simix_global->mutex.lock(); - - simix_global->process_list.erase(process->get_pid()); - if (process->get_host() && process->host_process_list_hook.is_linked()) - simgrid::xbt::intrusive_erase(process->get_host()->pimpl_->process_list_, *process); - if (not process->smx_destroy_list_hook.is_linked()) { -#if SIMGRID_HAVE_MC - xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, process); -#endif - simix_global->actors_to_destroy.push_back(*process); - } - process->context_->iwannadie = false; - - simix_global->mutex.unlock(); -} - namespace simgrid { namespace kernel { namespace actor { @@ -89,6 +65,26 @@ ActorImpl::~ActorImpl() delete this->context_; } +void ActorImpl::cleanup() +{ + XBT_DEBUG("Cleanup actor %s (%p), waiting synchro %p", get_cname(), this, waiting_synchro.get()); + + simix_global->mutex.lock(); + + simix_global->process_list.erase(pid_); + if (host_ && host_process_list_hook.is_linked()) + simgrid::xbt::intrusive_erase(host_->pimpl_->process_list_, *this); + if (not smx_destroy_list_hook.is_linked()) { +#if SIMGRID_HAVE_MC + xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, this); +#endif + simix_global->actors_to_destroy.push_back(*this); + } + context_->iwannadie = false; + + simix_global->mutex.unlock(); +} + void ActorImpl::exit() { context_->iwannadie = true; @@ -399,7 +395,7 @@ ActorImplPtr ActorImpl::create(std::string name, simix::ActorCode code, void* da actor->set_ppid(parent_actor->get_pid()); XBT_VERB("Create context %s", actor->get_cname()); - actor->context_ = SIMIX_context_new(std::move(code), &SIMIX_process_cleanup, actor); + actor->context_ = simix_global->context_factory->create_context(std::move(code), actor); /* Add properties */ if (properties != nullptr) @@ -429,7 +425,7 @@ void create_maestro(simix::ActorCode code) ActorImpl* maestro = new ActorImpl(xbt::string(""), /*host*/ nullptr); if (not code) { - maestro->context_ = SIMIX_context_new(simix::ActorCode(), nullptr, maestro); + maestro->context_ = simix_global->context_factory->create_context(simix::ActorCode(), maestro); } else { maestro->context_ = simix_global->context_factory->create_maestro(code, maestro); } @@ -466,7 +462,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn XBT_VERB("Create context %s", actor->get_cname()); xbt_assert(simix_global != nullptr, "simix is not initialized, please call MSG_init first"); - actor->context_ = simix_global->context_factory->attach(&SIMIX_process_cleanup, actor); + actor->context_ = simix_global->context_factory->attach(actor); /* Add properties */ if (properties != nullptr) @@ -499,7 +495,7 @@ void SIMIX_process_detach() if (context == nullptr) xbt_die("Not a suitable context"); - SIMIX_process_cleanup(context->get_actor()); + context->get_actor()->cleanup(); context->attach_stop(); } diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 1667712db0..561d1e8a63 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -105,6 +105,7 @@ public: static ActorImplPtr create(std::string name, simix::ActorCode code, void* data, s4u::Host* host, std::unordered_map* properties, ActorImpl* parent_actor); + void cleanup(); void exit(); void kill(ActorImpl* actor); void kill_all(); @@ -168,8 +169,6 @@ XBT_PUBLIC void create_maestro(std::function code); } // namespace kernel } // namespace simgrid -XBT_PRIVATE void SIMIX_process_cleanup(smx_actor_t arg); - extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor); XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro); diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index a624d4993e..30327d64bb 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -225,7 +225,6 @@ void ActorExt::init() } simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self(); - proc->get_impl()->context_->set_cleanup(&SIMIX_process_cleanup); // cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved // this up here so that I can set the privatized region before the switch. ActorExt* process = smpi_process_remote(proc);