/** @brief Simulation Agent (see \ref s4u_actor)*/
XBT_PUBLIC_CLASS Actor {
friend Mailbox;
- friend simgrid::simix::Process;
+ friend simgrid::simix::ActorImpl;
smx_process_t pimpl_ = nullptr;
/** Wrap a (possibly non-copyable) single-use task into a `std::function` */
data</em>, executing in a <em>location</em>.
\see m_process_management
@{ */
- class Process;
+ class ActorImpl;
class Context;
class ContextFactory;
class Mutex;
}
typedef simgrid::simix::Context *smx_context_t;
-typedef simgrid::simix::Process *smx_process_t;
+typedef simgrid::simix::ActorImpl *smx_process_t;
typedef simgrid::simix::Mutex *smx_mutex_t;
typedef simgrid::simix::Mailbox *smx_mailbox_t;
#include <simgrid/s4u/host.hpp>
#include "src/kernel/activity/SynchroSleep.hpp"
+
#include "src/surf/surf_interface.hpp"
+#include "src/simix/ActorImpl.hpp"
#include "src/simix/popping_private.h"
-#include "src/simix/smx_process_private.h"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
class SimixProcessInformation {
public:
/** MCed address of the process */
- RemotePtr<simgrid::simix::Process> address = nullptr;
- Remote<simgrid::simix::Process> copy;
+ RemotePtr<simgrid::simix::ActorImpl> address = nullptr;
+ Remote<simgrid::simix::ActorImpl> copy;
/** Hostname (owned by `mc_modelchecker->hostnames`) */
const char* hostname = nullptr;
/** Get a local description of a remote SIMIX process */
simgrid::mc::SimixProcessInformation* resolveProcessInfo(
- simgrid::mc::RemotePtr<simgrid::simix::Process> process)
+ simgrid::mc::RemotePtr<simgrid::simix::ActorImpl> process)
{
xbt_assert(mc_model_checker != nullptr);
if (!process)
}
/** Get a local copy of the SIMIX process structure */
- simgrid::simix::Process* resolveProcess(simgrid::mc::RemotePtr<simgrid::simix::Process> process)
+ simgrid::simix::ActorImpl* resolveProcess(simgrid::mc::RemotePtr<simgrid::simix::ActorImpl> process)
{
simgrid::mc::SimixProcessInformation* process_info =
this->resolveProcessInfo(process);
#include <sys/time.h>
#endif
-#include "src/simix/smx_process_private.h"
+#include "src/simix/ActorImpl.hpp"
#if HAVE_MC
#include <libunwind.h>
#include "simgrid/simix.h"
+#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_private.h"
-#include "src/simix/smx_process_private.h"
-
#include "src/mc/mc_replay.h"
#include "src/mc/mc_record.h"
+
#include "src/mc/mc_base.h"
#include "src/mc/Transition.hpp"
/* 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. */
+#include "src/simix/ActorImpl.hpp"
#include "msg_private.h"
-#include "src/simix/smx_process_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "xbt/functional.hpp"
-#include "src/simix/smx_process_private.h"
+#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
if (self_context == nullptr)
return simgrid::s4u::ActorPtr();
- return simgrid::s4u::ActorPtr(&self_context->process()->actor());
+ return simgrid::s4u::ActorPtr(&self_context->process()->getIface());
}
smx_process_t process = simcall_process_create(
name, std::move(code), nullptr, host->name().c_str(),
killTime, nullptr, 0);
- return Ptr(&process->actor());
+ return Ptr(&process->getIface());
}
ActorPtr Actor::createActor(const char* name, s4u::Host *host, double killTime,
smx_process_t process = simcall_process_create(
name, std::move(code), nullptr, host->name().c_str(),
killTime, nullptr, 0);
- return ActorPtr(&process->actor());
+ return ActorPtr(&process->getIface());
}
// ***** Actor methods *****
{
smx_process_t process = SIMIX_process_from_PID(pid);
if (process != nullptr)
- return ActorPtr(&process->actor());
+ return ActorPtr(&process->getIface());
else
return nullptr;
}
#include "src/surf/HostImpl.hpp"
#include "xbt/log.h"
#include "src/msg/msg_private.h"
-#include "src/simix/smx_process_private.h"
+#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_private.h"
#include "src/surf/cpu_interface.hpp"
#include "simgrid/s4u/host.hpp"
#include "xbt/log.h"
#include "src/msg/msg_private.h"
+#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_network_private.h"
-#include "src/simix/smx_process_private.h"
-
#include "simgrid/s4u/mailbox.hpp"
XBT_LOG_EXTERNAL_CATEGORY(s4u);
ActorPtr Mailbox::receiver() {
if(pimpl_->permanent_receiver == nullptr)
return ActorPtr();
- return ActorPtr(&pimpl_->permanent_receiver->actor());
+ return ActorPtr(&pimpl_->permanent_receiver->getIface());
}
}
return mbox->empty();
}
void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) {
- mbox->setReceiver(&process->actor());
+ mbox->setReceiver(&process->getIface());
}
namespace simgrid {
namespace simix {
-Process::~Process()
+ActorImpl::~ActorImpl()
{
delete this->context;
if (this->properties)
{
smx_process_t maestro = nullptr;
/* Create maestro process and intilialize it */
- maestro = new simgrid::simix::Process();
+ maestro = new simgrid::simix::ActorImpl();
maestro->pid = simix_process_maxpid++;
maestro->ppid = -1;
maestro->name = "";
return nullptr;
}
else {
- process = new simgrid::simix::Process();
+ process = new simgrid::simix::ActorImpl();
xbt_assert(code && host != nullptr, "Invalid parameters");
/* Process data */
return nullptr;
}
- smx_process_t process = new simgrid::simix::Process();
+ smx_process_t process = new simgrid::simix::ActorImpl();
/* Process data */
process->pid = simix_process_maxpid++;
process->name = std::string(name);
-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2016. 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. */
-#ifndef _SIMIX_PROCESS_PRIVATE_H
-#define _SIMIX_PROCESS_PRIVATE_H
+#ifndef _SIMIX_ACTORIMPL_H
+#define _SIMIX_ACTORIMPL_H
#include <atomic>
#include <functional>
bool auto_restart = false;
};
-class Process {
+class ActorImpl {
public:
- Process() : actor_(this) {}
+ ActorImpl() : piface_(this) {}
// TODO, replace with boost intrusive container hooks
s_xbt_swag_hookup_t process_hookup = { nullptr, nullptr }; /* simix_global->process_list */
std::function<void()> code;
smx_timer_t kill_timer = nullptr;
- int segment_index = 0; /*Reference to an SMPI process' data segment. Default value is -1 if not in SMPI context*/
+ int segment_index = 0; /* Reference to an SMPI process' data segment. Default value is -1 if not in SMPI context*/
- friend void intrusive_ptr_add_ref(Process* process)
+ friend void intrusive_ptr_add_ref(ActorImpl* process)
{
// Atomic operation! Do not split in two instructions!
auto previous = (process->refcount_)++;
xbt_assert(previous != 0);
(void) previous;
}
- friend void intrusive_ptr_release(Process* process)
+ friend void intrusive_ptr_release(ActorImpl* process)
{
// Atomic operation! Do not split in two instructions!
auto count = --(process->refcount_);
delete process;
}
- ~Process();
+ ~ActorImpl();
- simgrid::s4u::Actor& actor() { return actor_; }
+ simgrid::s4u::Actor& getIface() { return piface_; }
private:
std::atomic_int_fast32_t refcount_ { 1 };
- simgrid::s4u::Actor actor_;
+ simgrid::s4u::Actor piface_;
};
}
typedef simgrid::simix::ProcessArg *smx_process_arg_t;
-typedef simgrid::simix::Process* smx_process_t;
+typedef simgrid::simix::ActorImpl* smx_process_t;
SG_BEGIN_DECL()
if (!simix_global) {
simix_global = std::unique_ptr<simgrid::simix::Global>(new simgrid::simix::Global());
- simgrid::simix::Process proc;
+ simgrid::simix::ActorImpl proc;
simix_global->process_to_run = xbt_dynar_new(sizeof(smx_process_t), nullptr);
simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_process_t), nullptr);
simix_global->process_list = xbt_swag_new(xbt_swag_offset(proc, process_hookup));
smx_host_priv_t smx_host = xbt_new0(s_smx_host_priv_t, 1);
/* Host structure */
- simgrid::simix::Process proc;
+ simgrid::simix::ActorImpl proc;
smx_host->process_list = xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
/* Update global variables */
#include "simgrid/simix.h"
#include "popping_private.h"
-#include "src/simix/smx_process_private.h"
+#include "src/simix/ActorImpl.hpp"
namespace simgrid {
namespace simix {
simgrid::s4u::Mailbox piface_; // Our interface
char* name;
std::deque<smx_synchro_t> comm_queue;
- boost::intrusive_ptr<simgrid::simix::Process> permanent_receiver; //process which the mailbox is attached to
+ boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; //process which the mailbox is attached to
std::deque<smx_synchro_t> done_comm_queue;//messages already received in the permanent receive mode
};
#include "xbt/function_types.h"
#include "src/xbt/ex_interface.h"
#include "src/instr/instr_private.h"
-#include "smx_process_private.h"
#include "smx_host_private.h"
#include "smx_io_private.h"
#include "smx_network_private.h"
#include "smx_synchro_private.h"
#include <signal.h>
+#include "src/simix/ActorImpl.hpp"
#ifdef __cplusplus
{
XBT_IN("(%p)", this);
// Useful to initialize sleeping swag:
- simgrid::simix::Process p;
+ simgrid::simix::ActorImpl p;
this->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
XBT_OUT();
}
smx_cond_t SIMIX_cond_init(void)
{
XBT_IN("()");
- simgrid::simix::Process p;
+ simgrid::simix::ActorImpl p;
smx_cond_t cond = new s_smx_cond();
cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
cond->refcount_ = 1;
smx_sem_t SIMIX_sem_init(unsigned int value)
{
XBT_IN("(%u)",value);
- simgrid::simix::Process p;
+ simgrid::simix::ActorImpl p;
smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
sem->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
src/simix/smx_io_private.h
src/simix/smx_network_private.h
src/simix/smx_private.h
- src/simix/smx_process_private.h
+ src/simix/ActorImpl.hpp
src/simix/smx_synchro_private.h
src/kernel/activity/Synchro.h
src/kernel/activity/SynchroComm.hpp
src/simix/smx_host.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
- src/simix/smx_process.cpp
+ src/simix/ActorImpl.cpp
src/simix/smx_synchro.cpp
src/simix/smx_vm.cpp
src/simix/popping.cpp