class ActionArgParser {
public:
virtual ~ActionArgParser() = default;
- virtual void parse(simgrid::xbt::ReplayAction& action, const std::string& name) { CHECK_ACTION_PARAMS(action, 0, 0) }
+ virtual void parse(xbt::ReplayAction& action, const std::string& name) { CHECK_ACTION_PARAMS(action, 0, 0) }
};
class WaitTestParser : public ActionArgParser {
int dst;
int tag;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class SendRecvParser : public ActionArgParser {
int tag;
MPI_Datatype datatype1 = MPI_DEFAULT_TYPE;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class ComputeParser : public ActionArgParser {
public:
double flops;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class SleepParser : public ActionArgParser {
public:
double time;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class LocationParser : public ActionArgParser {
std::string filename;
int line;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class CollCommParser : public ActionArgParser {
class BcastArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class ReduceArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class AllReduceArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class AllToAllArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class GatherArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class GatherVArgParser : public CollCommParser {
int recv_size_sum;
std::shared_ptr<std::vector<int>> recvcounts;
std::vector<int> disps;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class ScatterArgParser : public CollCommParser {
public:
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class ScatterVArgParser : public CollCommParser {
int send_size_sum;
std::shared_ptr<std::vector<int>> sendcounts;
std::vector<int> disps;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class ReduceScatterArgParser : public CollCommParser {
int recv_size_sum;
std::shared_ptr<std::vector<int>> recvcounts;
std::vector<int> disps;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
class AllToAllVArgParser : public CollCommParser {
std::vector<int> recvdisps;
int send_buf_size;
int recv_buf_size;
- void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+ void parse(xbt::ReplayAction& action, const std::string& name) override;
};
/**
T args;
public:
- explicit ReplayAction(const std::string& name) : name(name), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
+ explicit ReplayAction(const std::string& name) : name(name), my_proc_id(s4u::this_actor::get_pid()) {}
virtual ~ReplayAction() = default;
- void execute(simgrid::xbt::ReplayAction& action)
+ void execute(xbt::ReplayAction& action)
{
// Needs to be re-initialized for every action, hence here
double start_time = smpi_process()->simulated_elapsed();
};
class WaitAction : public ReplayAction<WaitTestParser> {
-private:
RequestStorage& req_storage;
public:
explicit WaitAction(RequestStorage& storage) : ReplayAction("Wait"), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class SendAction : public ReplayAction<SendRecvParser> {
-private:
RequestStorage& req_storage;
public:
explicit SendAction(const std::string& name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class RecvAction : public ReplayAction<SendRecvParser> {
-private:
RequestStorage& req_storage;
public:
explicit RecvAction(const std::string& name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class ComputeAction : public ReplayAction<ComputeParser> {
public:
explicit ComputeAction() : ReplayAction("compute") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class SleepAction : public ReplayAction<SleepParser> {
public:
explicit SleepAction() : ReplayAction("sleep") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class LocationAction : public ReplayAction<LocationParser> {
public:
explicit LocationAction() : ReplayAction("location") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class TestAction : public ReplayAction<WaitTestParser> {
public:
explicit TestAction(RequestStorage& storage) : ReplayAction("Test"), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class InitAction : public ReplayAction<ActionArgParser> {
public:
explicit InitAction() : ReplayAction("Init") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class CommunicatorAction : public ReplayAction<ActionArgParser> {
public:
explicit CommunicatorAction() : ReplayAction("Comm") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class WaitAllAction : public ReplayAction<ActionArgParser> {
-private:
RequestStorage& req_storage;
public:
explicit WaitAllAction(RequestStorage& storage) : ReplayAction("waitall"), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class BarrierAction : public ReplayAction<ActionArgParser> {
public:
explicit BarrierAction() : ReplayAction("barrier") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class BcastAction : public ReplayAction<BcastArgParser> {
public:
explicit BcastAction() : ReplayAction("bcast") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class ReduceAction : public ReplayAction<ReduceArgParser> {
public:
explicit ReduceAction() : ReplayAction("reduce") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class AllReduceAction : public ReplayAction<AllReduceArgParser> {
public:
explicit AllReduceAction() : ReplayAction("allreduce") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class AllToAllAction : public ReplayAction<AllToAllArgParser> {
public:
explicit AllToAllAction() : ReplayAction("alltoall") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class GatherAction : public ReplayAction<GatherArgParser> {
public:
explicit GatherAction(const std::string& name) : ReplayAction(name) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class GatherVAction : public ReplayAction<GatherVArgParser> {
public:
explicit GatherVAction(const std::string& name) : ReplayAction(name) {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class ScatterAction : public ReplayAction<ScatterArgParser> {
public:
explicit ScatterAction() : ReplayAction("scatter") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class ScatterVAction : public ReplayAction<ScatterVArgParser> {
public:
explicit ScatterVAction() : ReplayAction("scatterv") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class ReduceScatterAction : public ReplayAction<ReduceScatterArgParser> {
public:
explicit ReduceScatterAction() : ReplayAction("reducescatter") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
class AllToAllVAction : public ReplayAction<AllToAllVArgParser> {
public:
explicit AllToAllVAction() : ReplayAction("alltoallv") {}
- void kernel(simgrid::xbt::ReplayAction& action) override;
+ void kernel(xbt::ReplayAction& action) override;
};
-}
-}
-}
+
+} // namespace replay
+} // namespace smpi
+} // namespace simgrid
#endif
return (self_context != nullptr) ? self_context->get_actor() : nullptr;
}
-ActorImpl::ActorImpl(simgrid::xbt::string name, s4u::Host* host) : host_(host), name_(std::move(name)), piface_(this)
+ActorImpl::ActorImpl(xbt::string name, s4u::Host* host) : host_(host), name_(std::move(name)), piface_(this)
{
pid_ = maxpid++;
simcall.issuer_ = this;
if (simix_global != nullptr && this != simix_global->maestro_) {
if (context_.get() != nullptr) /* the actor was not start()ed yet. This happens if its host was initially off */
context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
- simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); });
+ actor::simcall([this] { s4u::Actor::on_destruction(*ciface()); });
if (context_.get() != nullptr)
context_->iwannadie = true;
}
if (not host->is_on()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname());
- throw simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.");
+ throw HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.");
}
ActorImpl* actor = new ActorImpl(xbt::string(name), host);
simix_global->actors_to_run.push_back(actor);
intrusive_ptr_add_ref(actor);
- auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(actor->context_.get());
+ auto* context = dynamic_cast<context::AttachContext*>(actor->context_.get());
xbt_assert(nullptr != context, "Not a suitable context");
context->attach_start();
/* The on_creation() signal must be delayed until there, where the pid and everything is set */
- simgrid::s4u::Actor::on_creation(*actor->ciface());
+ s4u::Actor::on_creation(*actor->ciface());
return ActorImplPtr(actor);
}
simix_global->mutex.unlock();
context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
- simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_termination(*ciface()); });
+ actor::simcall([this] { s4u::Actor::on_termination(*ciface()); });
context_->iwannadie = true;
}
activity::ActivityImplPtr ActorImpl::sleep(double duration)
{
if (not host_->is_on())
- throw_exception(std::make_exception_ptr(simgrid::HostFailureException(
+ throw_exception(std::make_exception_ptr(HostFailureException(
XBT_THROW_POINT, std::string("Host ") + host_->get_cname() + " failed, you cannot sleep there.")));
auto sleep = new activity::SleepImpl();
if (not host_->is_on()) {
XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name_.c_str(), host_->get_cname());
intrusive_ptr_release(this);
- throw simgrid::HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.");
+ throw HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.");
}
this->code_ = code;