From 808bc801011b8291383a7fb87669eb67f46f3a07 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 31 Jul 2016 11:30:51 +0200 Subject: [PATCH] align namespaces on directories for kernel::activity --- include/simgrid/forward.h | 12 ++--- include/simgrid/s4u/Activity.hpp | 2 +- include/simgrid/s4u/comm.hpp | 8 ++-- src/kernel/activity/Synchro.cpp | 8 ++-- src/kernel/activity/Synchro.h | 5 ++- src/kernel/activity/SynchroComm.cpp | 16 +++---- src/kernel/activity/SynchroComm.hpp | 5 ++- src/kernel/activity/SynchroExec.cpp | 12 ++--- src/kernel/activity/SynchroExec.hpp | 5 ++- src/kernel/activity/SynchroIo.cpp | 6 +-- src/kernel/activity/SynchroIo.hpp | 5 ++- src/kernel/activity/SynchroRaw.cpp | 8 ++-- src/kernel/activity/SynchroRaw.hpp | 5 ++- src/kernel/activity/SynchroSleep.cpp | 6 +-- src/kernel/activity/SynchroSleep.hpp | 5 ++- src/mc/CommunicationDeterminismChecker.cpp | 24 +++++----- src/mc/CommunicationDeterminismChecker.hpp | 2 +- src/mc/mc_base.cpp | 16 ++++--- src/mc/mc_comm_pattern.cpp | 6 +-- src/mc/mc_request.cpp | 50 ++++++++++----------- src/mc/mc_state.cpp | 12 ++--- src/mc/mc_state.h | 2 +- src/msg/msg_gos.cpp | 14 +++--- src/msg/msg_mailbox.cpp | 2 +- src/msg/msg_private.h | 4 +- src/msg/msg_task.cpp | 2 +- src/simix/libsmx.cpp | 2 +- src/simix/smx_global.cpp | 10 ++--- src/simix/smx_host.cpp | 20 ++++----- src/simix/smx_host_private.h | 2 +- src/simix/smx_io.cpp | 10 ++--- src/simix/smx_network.cpp | 52 +++++++++++----------- src/simix/smx_process.cpp | 30 ++++++------- src/simix/smx_synchro.cpp | 2 +- src/smpi/smpi_base.cpp | 6 +-- src/smpi/smpi_global.cpp | 2 +- 36 files changed, 194 insertions(+), 184 deletions(-) diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index a4ef9bd464..ddf9531817 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -15,8 +15,10 @@ namespace simgrid { class Host; class Mailbox; } - namespace simix { - class Synchro; + namespace kernel { + namespace activity { + class Synchro; + } } namespace surf { class Resource; @@ -35,7 +37,7 @@ namespace simgrid { typedef simgrid::s4u::As simgrid_As; typedef simgrid::s4u::Host simgrid_Host; typedef simgrid::s4u::Mailbox simgrid_Mailbox; -typedef simgrid::simix::Synchro simix_Synchro; +typedef simgrid::kernel::activity::Synchro simgrid_Synchro; typedef simgrid::surf::Cpu surf_Cpu; typedef simgrid::routing::NetCard routing_NetCard; typedef simgrid::surf::Link Link; @@ -47,7 +49,7 @@ typedef simgrid::trace_mgr::trace tmgr_Trace; typedef struct simgrid_As simgrid_As; typedef struct simgrid_Host simgrid_Host; typedef struct simgrid_Mailbox simgrid_Mailbox; -typedef struct simix_Synchro simix_Synchro; +typedef struct simgrid_Synchro simgrid_Synchro; typedef struct surf_Cpu surf_Cpu; typedef struct routing_NetCard routing_NetCard; typedef struct surf_Resource surf_Resource; @@ -59,7 +61,7 @@ typedef simgrid_As *AS_t; typedef simgrid_Host* sg_host_t; typedef simgrid_Mailbox* sg_mbox_t; -typedef simix_Synchro *smx_synchro_t; +typedef simgrid_Synchro *smx_synchro_t; typedef surf_Cpu *surf_cpu_t; typedef routing_NetCard *sg_netcard_t; diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index 0b8d3032a2..ac26e09a1c 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -66,7 +66,7 @@ public: void *getUserData() { return userData_; } private: - simgrid::simix::Synchro *pimpl_ = nullptr; + simgrid::kernel::activity::Synchro *pimpl_ = nullptr; e_s4u_activity_state_t state_ = inited; double remains_ = 0; void *userData_ = nullptr; diff --git a/include/simgrid/s4u/comm.hpp b/include/simgrid/s4u/comm.hpp index e1046aa9cb..ecb1e096c2 100644 --- a/include/simgrid/s4u/comm.hpp +++ b/include/simgrid/s4u/comm.hpp @@ -34,13 +34,13 @@ public: I wait_any(I first, I last) { // Map to dynar: - xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::simix::Synchro*), NULL); + xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::Synchro*), NULL); for(I iter = first; iter != last; iter++) { Comm& comm = **iter; if (comm.state_ == inited) comm.start(); xbt_assert(comm.state_ == started); - xbt_dynar_push_as(comms, simgrid::simix::Synchro*, comm.pimpl_); + xbt_dynar_push_as(comms, simgrid::kernel::activity::Synchro*, comm.pimpl_); } // Call the underlying simcall: int idx = simcall_comm_waitany(comms, -1); @@ -58,13 +58,13 @@ public: I wait_any_for(I first, I last, double timeout) { // Map to dynar: - xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::simix::Synchro*), NULL); + xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::Synchro*), NULL); for(I iter = first; iter != last; iter++) { Comm& comm = **iter; if (comm.state_ == inited) comm.start(); xbt_assert(comm.state_ == started); - xbt_dynar_push_as(comms, simgrid::simix::Synchro*, comm.pimpl_); + xbt_dynar_push_as(comms, simgrid::kernel::activity::Synchro*, comm.pimpl_); } // Call the underlying simcall: int idx = simcall_comm_waitany(comms, timeout); diff --git a/src/kernel/activity/Synchro.cpp b/src/kernel/activity/Synchro.cpp index da79e88d34..cbe5cd3357 100644 --- a/src/kernel/activity/Synchro.cpp +++ b/src/kernel/activity/Synchro.cpp @@ -5,20 +5,20 @@ #include "src/kernel/activity/Synchro.h" -simgrid::simix::Synchro::Synchro() +simgrid::kernel::activity::Synchro::Synchro() { } -simgrid::simix::Synchro::~Synchro() +simgrid::kernel::activity::Synchro::~Synchro() { } -void simgrid::simix::Synchro::ref() +void simgrid::kernel::activity::Synchro::ref() { refcount++; } -void simgrid::simix::Synchro::unref() +void simgrid::kernel::activity::Synchro::unref() { xbt_assert(refcount > 0, "This synchro has a negative refcount! You can only call test() or wait() once per synchronization."); diff --git a/src/kernel/activity/Synchro.h b/src/kernel/activity/Synchro.h index 6421d5c28c..2146efb793 100644 --- a/src/kernel/activity/Synchro.h +++ b/src/kernel/activity/Synchro.h @@ -17,7 +17,8 @@ #include namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { XBT_PUBLIC_CLASS Synchro { public: @@ -36,7 +37,7 @@ namespace simix { private: int refcount = 1; }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #else /* not C++ */ diff --git a/src/kernel/activity/SynchroComm.cpp b/src/kernel/activity/SynchroComm.cpp index a0058b1c90..43675366c7 100644 --- a/src/kernel/activity/SynchroComm.cpp +++ b/src/kernel/activity/SynchroComm.cpp @@ -11,7 +11,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network); -simgrid::simix::Comm::Comm(e_smx_comm_type_t _type) { +simgrid::kernel::activity::Comm::Comm(e_smx_comm_type_t _type) { state = SIMIX_WAITING; this->type = _type; src_data=nullptr; @@ -20,7 +20,7 @@ simgrid::simix::Comm::Comm(e_smx_comm_type_t _type) { XBT_DEBUG("Create communicate synchro %p", this); } -simgrid::simix::Comm::~Comm() +simgrid::kernel::activity::Comm::~Comm() { XBT_DEBUG("Really free communication %p", this); @@ -38,7 +38,7 @@ simgrid::simix::Comm::~Comm() SIMIX_mbox_remove(mbox, this); } -void simgrid::simix::Comm::suspend() +void simgrid::kernel::activity::Comm::suspend() { /* FIXME: shall we suspend also the timeout synchro? */ if (surf_comm) @@ -47,7 +47,7 @@ void simgrid::simix::Comm::suspend() } -void simgrid::simix::Comm::resume() +void simgrid::kernel::activity::Comm::resume() { /*FIXME: check what happen with the timeouts */ if (surf_comm) @@ -55,7 +55,7 @@ void simgrid::simix::Comm::resume() /* in the other case, the synchro were not really suspended yet, see SIMIX_comm_suspend() and SIMIX_comm_start() */ } -void simgrid::simix::Comm::cancel() +void simgrid::kernel::activity::Comm::cancel() { /* if the synchro is a waiting state means that it is still in a mbox */ /* so remove from it and delete it */ @@ -72,7 +72,7 @@ void simgrid::simix::Comm::cancel() } /** @brief get the amount remaining from the communication */ -double simgrid::simix::Comm::remains() +double simgrid::kernel::activity::Comm::remains() { switch (state) { @@ -92,7 +92,7 @@ double simgrid::simix::Comm::remains() } /** @brief This is part of the cleanup process, probably an internal command */ -void simgrid::simix::Comm::cleanupSurf() +void simgrid::kernel::activity::Comm::cleanupSurf() { if (surf_comm){ surf_comm->unref(); @@ -110,7 +110,7 @@ void simgrid::simix::Comm::cleanupSurf() } } -void simgrid::simix::Comm::post() +void simgrid::kernel::activity::Comm::post() { /* Update synchro state */ if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::done) diff --git a/src/kernel/activity/SynchroComm.hpp b/src/kernel/activity/SynchroComm.hpp index 264d598818..608f0fa9fa 100644 --- a/src/kernel/activity/SynchroComm.hpp +++ b/src/kernel/activity/SynchroComm.hpp @@ -17,7 +17,8 @@ typedef enum { } e_smx_comm_type_t; namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { XBT_PUBLIC_CLASS Comm : public Synchro { ~Comm() override; @@ -66,6 +67,6 @@ namespace simix { void* dst_data = nullptr; }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/SynchroExec.cpp b/src/kernel/activity/SynchroExec.cpp index 6ec1d18573..2617322f95 100644 --- a/src/kernel/activity/SynchroExec.cpp +++ b/src/kernel/activity/SynchroExec.cpp @@ -9,7 +9,7 @@ #include "src/surf/surf_interface.hpp" #include "src/simix/smx_host_private.h" -simgrid::simix::Exec::Exec(const char*name, sg_host_t hostarg) +simgrid::kernel::activity::Exec::Exec(const char*name, sg_host_t hostarg) { if (name) this->name = name; @@ -17,24 +17,24 @@ simgrid::simix::Exec::Exec(const char*name, sg_host_t hostarg) this->host = hostarg; } -simgrid::simix::Exec::~Exec() +simgrid::kernel::activity::Exec::~Exec() { if (surf_exec) surf_exec->unref(); } -void simgrid::simix::Exec::suspend() +void simgrid::kernel::activity::Exec::suspend() { if (surf_exec) surf_exec->suspend(); } -void simgrid::simix::Exec::resume() +void simgrid::kernel::activity::Exec::resume() { if (surf_exec) surf_exec->resume(); } -double simgrid::simix::Exec::remains() +double simgrid::kernel::activity::Exec::remains() { if (state == SIMIX_RUNNING) return surf_exec->getRemains(); @@ -42,7 +42,7 @@ double simgrid::simix::Exec::remains() return 0; } -void simgrid::simix::Exec::post() +void simgrid::kernel::activity::Exec::post() { if (host && host->isOff()) {/* FIMXE: handle resource failure for parallel tasks too */ /* If the host running the synchro failed, notice it. This way, the asking diff --git a/src/kernel/activity/SynchroExec.hpp b/src/kernel/activity/SynchroExec.hpp index b9747b8341..facfa539bc 100644 --- a/src/kernel/activity/SynchroExec.hpp +++ b/src/kernel/activity/SynchroExec.hpp @@ -10,7 +10,8 @@ #include "src/kernel/activity/Synchro.h" namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { XBT_PUBLIC_CLASS Exec : public Synchro { ~Exec() override; @@ -25,5 +26,5 @@ namespace simix { surf_action_t surf_exec = nullptr; /* The Surf execution action encapsulated */ }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/SynchroIo.cpp b/src/kernel/activity/SynchroIo.cpp index 05a7245e52..88a9c08852 100644 --- a/src/kernel/activity/SynchroIo.cpp +++ b/src/kernel/activity/SynchroIo.cpp @@ -8,19 +8,19 @@ #include "src/simix/popping_private.h" #include "src/simix/smx_private.h" -void simgrid::simix::Io::suspend() +void simgrid::kernel::activity::Io::suspend() { if (surf_io) surf_io->suspend(); } -void simgrid::simix::Io::resume() +void simgrid::kernel::activity::Io::resume() { if (surf_io) surf_io->resume(); } -void simgrid::simix::Io::post() +void simgrid::kernel::activity::Io::post() { for (smx_simcall_t simcall : simcalls) { switch (simcall->call) { diff --git a/src/kernel/activity/SynchroIo.hpp b/src/kernel/activity/SynchroIo.hpp index ef9213d407..a5202eeae0 100644 --- a/src/kernel/activity/SynchroIo.hpp +++ b/src/kernel/activity/SynchroIo.hpp @@ -10,7 +10,8 @@ #include "src/kernel/activity/Synchro.h" namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { XBT_PUBLIC_CLASS Io : public Synchro { public: @@ -22,6 +23,6 @@ namespace simix { surf_action_t surf_io = nullptr; }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/SynchroRaw.cpp b/src/kernel/activity/SynchroRaw.cpp index 8fc2551eae..0f9e29f30d 100644 --- a/src/kernel/activity/SynchroRaw.cpp +++ b/src/kernel/activity/SynchroRaw.cpp @@ -9,21 +9,21 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro); -simgrid::simix::Raw::~Raw() +simgrid::kernel::activity::Raw::~Raw() { sleep->unref(); } -void simgrid::simix::Raw::suspend() +void simgrid::kernel::activity::Raw::suspend() { /* The suspension of raw synchros is delayed to when the process is rescheduled. */ } -void simgrid::simix::Raw::resume() +void simgrid::kernel::activity::Raw::resume() { /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at * the end of the synchro. */ } -void simgrid::simix::Raw::post() +void simgrid::kernel::activity::Raw::post() { XBT_IN("(%p)",this); if (sleep->getState() == simgrid::surf::Action::State::failed) diff --git a/src/kernel/activity/SynchroRaw.hpp b/src/kernel/activity/SynchroRaw.hpp index 05914c05d2..cac619c01a 100644 --- a/src/kernel/activity/SynchroRaw.hpp +++ b/src/kernel/activity/SynchroRaw.hpp @@ -10,7 +10,8 @@ #include "src/kernel/activity/Synchro.h" namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { /** Used to implement mutexes, semaphores and conditions */ XBT_PUBLIC_CLASS Raw : public Synchro { @@ -23,6 +24,6 @@ namespace simix { surf_action_t sleep = nullptr; }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/SynchroSleep.cpp b/src/kernel/activity/SynchroSleep.cpp index c82a720f70..e8f10df5a4 100644 --- a/src/kernel/activity/SynchroSleep.cpp +++ b/src/kernel/activity/SynchroSleep.cpp @@ -14,17 +14,17 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process); -void simgrid::simix::Sleep::suspend() +void simgrid::kernel::activity::Sleep::suspend() { surf_sleep->suspend(); } -void simgrid::simix::Sleep::resume() +void simgrid::kernel::activity::Sleep::resume() { surf_sleep->resume(); } -void simgrid::simix::Sleep::post() +void simgrid::kernel::activity::Sleep::post() { while (!simcalls.empty()) { smx_simcall_t simcall = simcalls.front(); diff --git a/src/kernel/activity/SynchroSleep.hpp b/src/kernel/activity/SynchroSleep.hpp index 1b838feb81..d2478332b7 100644 --- a/src/kernel/activity/SynchroSleep.hpp +++ b/src/kernel/activity/SynchroSleep.hpp @@ -10,7 +10,8 @@ #include "src/kernel/activity/Synchro.h" namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { XBT_PUBLIC_CLASS Sleep : public Synchro { public: @@ -22,6 +23,6 @@ namespace simix { surf_action_t surf_sleep = nullptr; /* The Surf sleeping action encapsulated */ }; -}} // namespace simgrid::simix +}}} // namespace simgrid::kernel::activity #endif diff --git a/src/mc/CommunicationDeterminismChecker.cpp b/src/mc/CommunicationDeterminismChecker.cpp index e0f7a77e00..b8df5622c1 100644 --- a/src/mc/CommunicationDeterminismChecker.cpp +++ b/src/mc/CommunicationDeterminismChecker.cpp @@ -95,13 +95,13 @@ static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int p static void update_comm_pattern( simgrid::mc::PatternCommunication* comm_pattern, - simgrid::mc::RemotePtr comm_addr) + simgrid::mc::RemotePtr comm_addr) { // HACK, type punning - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, comm_addr); - simgrid::simix::Comm* comm = - static_cast(temp_comm.getBuffer()); + simgrid::kernel::activity::Comm* comm = + static_cast(temp_comm.getBuffer()); smx_process_t src_proc = mc_model_checker->process().resolveProcess( simgrid::mc::remote(comm->src_proc)); @@ -195,11 +195,11 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim pattern->type = simgrid::mc::PatternCommunicationType::send; pattern->comm_addr = simcall_comm_isend__get__result(request); - simgrid::mc::Remote temp_synchro; + simgrid::mc::Remote temp_synchro; mc_model_checker->process().read(temp_synchro, remote( - static_cast(pattern->comm_addr))); - simgrid::simix::Comm* synchro = - static_cast(temp_synchro.getBuffer()); + static_cast(pattern->comm_addr))); + simgrid::kernel::activity::Comm* synchro = + static_cast(temp_synchro.getBuffer()); char* remote_name = mc_model_checker->process().read( (std::uint64_t)(synchro->mbox ? &synchro->mbox->name : &synchro->mbox_cpy->name)); @@ -244,10 +244,10 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim &mpi_request, remote((struct s_smpi_mpi_request*)simcall_comm_irecv__get__data(request))); pattern->tag = mpi_request.tag; - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, remote( - static_cast(pattern->comm_addr))); - simgrid::simix::Comm* comm = temp_comm.getBuffer(); + static_cast(pattern->comm_addr))); + simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer(); char* remote_name; mc_model_checker->process().read(&remote_name, @@ -269,7 +269,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim void CommunicationDeterminismChecker::complete_comm_pattern( - xbt_dynar_t list, simgrid::mc::RemotePtr comm_addr, + xbt_dynar_t list, simgrid::mc::RemotePtr comm_addr, unsigned int issuer, int backtracking) { simgrid::mc::PatternCommunication* current_comm_pattern; diff --git a/src/mc/CommunicationDeterminismChecker.hpp b/src/mc/CommunicationDeterminismChecker.hpp index 6235b80d10..9cfea2618f 100644 --- a/src/mc/CommunicationDeterminismChecker.hpp +++ b/src/mc/CommunicationDeterminismChecker.hpp @@ -36,7 +36,7 @@ public: // These are used by functions which should be moved in CommunicationDeterminismChecker: void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking); void complete_comm_pattern( - xbt_dynar_t list, simgrid::mc::RemotePtr comm_addr, + xbt_dynar_t list, simgrid::mc::RemotePtr comm_addr, unsigned int issuer, int backtracking); private: /** Stack representing the position in the exploration graph */ diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index c068886e94..aa6f7afdbf 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -86,15 +86,16 @@ bool request_is_enabled(smx_simcall_t req) case SIMCALL_COMM_WAIT: { /* FIXME: check also that src and dst processes are not suspended */ - simgrid::simix::Comm *act = static_cast(simcall_comm_wait__get__comm(req)); + simgrid::kernel::activity::Comm *act = + static_cast(simcall_comm_wait__get__comm(req)); #if HAVE_MC // Fetch from MCed memory: // HACK, type puning - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; if (mc_model_checker != nullptr) { mc_model_checker->process().read(temp_comm, remote(act)); - act = static_cast(temp_comm.getBuffer()); + act = static_cast(temp_comm.getBuffer()); } #endif @@ -113,7 +114,8 @@ bool request_is_enabled(smx_simcall_t req) case SIMCALL_COMM_WAITANY: { xbt_dynar_t comms; - simgrid::simix::Comm *act = static_cast(simcall_comm_wait__get__comm(req)); + simgrid::kernel::activity::Comm *act = + static_cast(simcall_comm_wait__get__comm(req)); #if HAVE_MC s_xbt_dynar_t comms_buffer; @@ -141,15 +143,15 @@ bool request_is_enabled(smx_simcall_t req) #if HAVE_MC // Fetch act from MCed memory: // HACK, type puning - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; if (mc_model_checker != nullptr) { memcpy(&act, buffer + comms->elmsize * index, sizeof(act)); mc_model_checker->process().read(temp_comm, remote(act)); - act = static_cast(temp_comm.getBuffer()); + act = static_cast(temp_comm.getBuffer()); } else #endif - act = xbt_dynar_get_as(comms, index, simgrid::simix::Comm*); + act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::Comm*); if (act->src_proc && act->dst_proc) return true; } diff --git a/src/mc/mc_comm_pattern.cpp b/src/mc/mc_comm_pattern.cpp index 0b2549eac2..a2b49fe393 100644 --- a/src/mc/mc_comm_pattern.cpp +++ b/src/mc/mc_comm_pattern.cpp @@ -87,12 +87,12 @@ void MC_handle_comm_pattern( case MC_CALL_TYPE_WAIT: case MC_CALL_TYPE_WAITANY: { - simgrid::mc::RemotePtr comm_addr = nullptr; + simgrid::mc::RemotePtr comm_addr = nullptr; if (call_type == MC_CALL_TYPE_WAIT) - comm_addr = remote(static_cast( + comm_addr = remote(static_cast( simcall_comm_wait__get__comm(req))); else { - simgrid::simix::Comm* addr; + simgrid::kernel::activity::Comm* addr; // comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)): simgrid::mc::read_element(mc_model_checker->process(), &addr, remote(simcall_comm_waitany__get__comms(req)), value, sizeof(comm_addr)); diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index 1feb6e8e2b..e7e0942b3a 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -27,13 +27,13 @@ static char *pointer_to_string(void *pointer); static char *buff_size_to_string(size_t size); static inline -simgrid::simix::Comm* MC_get_comm(smx_simcall_t r) +simgrid::kernel::activity::Comm* MC_get_comm(smx_simcall_t r) { switch (r->call ) { case SIMCALL_COMM_WAIT: - return static_cast(simcall_comm_wait__get__comm(r)); + return static_cast(simcall_comm_wait__get__comm(r)); case SIMCALL_COMM_TEST: - return static_cast(simcall_comm_test__get__comm(r)); + return static_cast(simcall_comm_test__get__comm(r)); default: return nullptr; } @@ -67,8 +67,8 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) // Those are internal requests, we do not need indirection // because those objects are copies: - simgrid::simix::Comm* synchro1 = MC_get_comm(r1); - simgrid::simix::Comm* synchro2 = MC_get_comm(r2); + simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1); + simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2); if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV) && r2->call == SIMCALL_COMM_WAIT) { @@ -154,8 +154,8 @@ bool request_depend(smx_simcall_t r1, smx_simcall_t r2) // Those are internal requests, we do not need indirection // because those objects are copies: - simgrid::simix::Comm* synchro1 = MC_get_comm(r1); - simgrid::simix::Comm* synchro2 = MC_get_comm(r2); + simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1); + simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2); switch(r1->call) { case SIMCALL_COMM_ISEND: @@ -275,8 +275,8 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid } case SIMCALL_COMM_WAIT: { - simgrid::simix::Comm* remote_act = - static_cast(simcall_comm_wait__get__comm(req)); + simgrid::kernel::activity::Comm* remote_act = + static_cast(simcall_comm_wait__get__comm(req)); char* p; if (value == -1) { type = "WaitTimeout"; @@ -286,11 +286,11 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid type = "Wait"; p = pointer_to_string(remote_act); - simgrid::mc::Remote temp_synchro; - simgrid::simix::Comm* act; + simgrid::mc::Remote temp_synchro; + simgrid::kernel::activity::Comm* act; if (use_remote_comm) { mc_model_checker->process().read(temp_synchro, remote( - static_cast(remote_act))); + static_cast(remote_act))); act = temp_synchro.getBuffer(); } else act = remote_act; @@ -312,13 +312,13 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid } case SIMCALL_COMM_TEST: { - simgrid::simix::Comm* remote_act = static_cast( + simgrid::kernel::activity::Comm* remote_act = static_cast( simcall_comm_test__get__comm(req)); - simgrid::mc::Remote temp_synchro; - simgrid::simix::Comm* act; + simgrid::mc::Remote temp_synchro; + simgrid::kernel::activity::Comm* act; if (use_remote_comm) { mc_model_checker->process().read(temp_synchro, remote( - static_cast(remote_act))); + static_cast(remote_act))); act = temp_synchro.getBuffer(); } else act = remote_act; @@ -459,10 +459,10 @@ bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx) return true; } - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, remote( - static_cast(remote_act))); - simgrid::simix::Comm* comm = temp_comm.getBuffer(); + static_cast(remote_act))); + simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer(); return comm->src_proc && comm->dst_proc; } @@ -524,10 +524,10 @@ std::string request_get_dot_output(smx_simcall_t req, int value) label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid); } else { smx_synchro_t remote_act = simcall_comm_wait__get__comm(req); - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, remote( - static_cast(remote_act))); - simgrid::simix::Comm* comm = temp_comm.getBuffer(); + static_cast(remote_act))); + simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer(); smx_process_t src_proc = mc_model_checker->process().resolveProcess( simgrid::mc::remote(comm->src_proc)); @@ -550,10 +550,10 @@ std::string request_get_dot_output(smx_simcall_t req, int value) case SIMCALL_COMM_TEST: { smx_synchro_t remote_act = simcall_comm_test__get__comm(req); - simgrid::mc::Remote temp_comm; + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, remote( - static_cast(remote_act))); - simgrid::simix::Comm* comm = temp_comm.getBuffer(); + static_cast(remote_act))); + simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer(); if (comm->src_proc == nullptr || comm->dst_proc == nullptr) { if (issuer->host) label = simgrid::xbt::string_printf("[(%lu)%s] Test FALSE", diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 59a9de060f..56c566f02b 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -124,11 +124,11 @@ static inline smx_simcall_t MC_state_get_request_for_process( } case SIMCALL_COMM_WAIT: { - simgrid::mc::RemotePtr remote_act = remote( - static_cast(simcall_comm_wait__get__comm(&process->simcall))); - simgrid::mc::Remote temp_act; + simgrid::mc::RemotePtr remote_act = remote( + static_cast(simcall_comm_wait__get__comm(&process->simcall))); + simgrid::mc::Remote temp_act; mc_model_checker->process().read(temp_act, remote_act); - simgrid::simix::Comm* act = temp_act.getBuffer(); + simgrid::kernel::activity::Comm* act = temp_act.getBuffer(); if (act->src_proc && act->dst_proc) state->transition.argument = 0; else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY @@ -178,7 +178,7 @@ static inline smx_simcall_t MC_state_get_request_for_process( &remote_comm, remote(simcall_comm_waitany__get__comms(req)), state->transition.argument, sizeof(remote_comm)); mc_model_checker->process().read(state->internal_comm, remote( - static_cast(remote_comm))); + static_cast(remote_comm))); simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer()); simcall_comm_wait__set__timeout(&state->internal_req, 0); break; @@ -192,7 +192,7 @@ static inline smx_simcall_t MC_state_get_request_for_process( smx_synchro_t remote_comm = mc_model_checker->process().read( remote(simcall_comm_testany__get__comms(req) + state->transition.argument)); mc_model_checker->process().read(state->internal_comm, remote( - static_cast(remote_comm))); + static_cast(remote_comm))); } simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer()); diff --git a/src/mc/mc_state.h b/src/mc/mc_state.h index 81e2e34758..be926fdb0a 100644 --- a/src/mc/mc_state.h +++ b/src/mc/mc_state.h @@ -136,7 +136,7 @@ struct XBT_PRIVATE State { s_smx_simcall_t internal_req; /* Can be used as a copy of the remote synchro object */ - simgrid::mc::Remote internal_comm; + simgrid::mc::Remote internal_comm; /** Snapshot of system state (if needed) */ std::shared_ptr system_state; diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 4e12c2c460..f036d97f21 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -65,7 +65,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) simdata->setUsed(); if (simdata->host_nb > 0) { - simdata->compute = static_cast( + simdata->compute = static_cast( simcall_execution_parallel_start(task->name, simdata->host_nb,simdata->host_list, simdata->flops_parallel_amount, simdata->bytes_parallel_amount, 1.0, -1.0)); @@ -77,7 +77,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) XBT_DEBUG("execute %s@%s with affinity(0x%04lx)", MSG_task_get_name(task), MSG_host_get_name(p_simdata->m_host), affinity_mask); - simdata->compute = static_cast( + simdata->compute = static_cast( simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound, affinity_mask)); } @@ -297,7 +297,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *al /* Send it by calling SIMIX network layer */ smx_synchro_t act = simcall_comm_isend(myself, mailbox, t_simdata->bytes_amount, t_simdata->rate, task, sizeof(void *), match_fun, cleanup, nullptr, match_data,detached); - t_simdata->comm = static_cast(act); + t_simdata->comm = static_cast(act); msg_comm_t comm = nullptr; if (! detached) { @@ -503,7 +503,7 @@ int MSG_comm_testany(xbt_dynar_t comms) int finished_index = -1; /* Create the equivalent array with SIMIX objects: */ - std::vector s_comms; + std::vector s_comms; s_comms.reserve(xbt_dynar_length(comms)); msg_comm_t comm; unsigned int cursor; @@ -690,7 +690,7 @@ msg_task_t MSG_comm_get_task(msg_comm_t comm) */ void MSG_comm_copy_data_from_SIMIX(smx_synchro_t synchro, void* buff, size_t buff_size) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); SIMIX_comm_copy_pointer_callback(comm, buff, buff_size); @@ -780,7 +780,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl t_simdata->rate, task, sizeof(void *), nullptr, nullptr, nullptr, task, 0); if (TRACE_is_enabled()) simcall_set_category(comm, task->category); - t_simdata->comm = static_cast(comm); + t_simdata->comm = static_cast(comm); simcall_comm_wait(comm, timeout); } catch (xbt_ex& e) { @@ -852,7 +852,7 @@ int MSG_task_listen(const char *alias) int MSG_task_listen_from(const char *alias) { msg_mailbox_t mbox = MSG_mailbox_get_by_alias(alias); - simgrid::simix::Comm* comm = static_cast(simcall_mbox_front(mbox)); + simgrid::kernel::activity::Comm* comm = static_cast(simcall_mbox_front(mbox)); if (!comm) return -1; diff --git a/src/msg/msg_mailbox.cpp b/src/msg/msg_mailbox.cpp index 6f5528b7d4..d4636989cb 100644 --- a/src/msg/msg_mailbox.cpp +++ b/src/msg/msg_mailbox.cpp @@ -20,7 +20,7 @@ int MSG_mailbox_is_empty(msg_mailbox_t mailbox) msg_task_t MSG_mailbox_front(msg_mailbox_t mailbox) { - simgrid::simix::Comm* comm = static_cast(simcall_mbox_front(mailbox)); + simgrid::kernel::activity::Comm* comm = static_cast(simcall_mbox_front(mailbox)); if (!comm) return nullptr; diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 1dea62571a..d7d6610035 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -47,8 +47,8 @@ typedef struct simdata_task { this->isused = false; } - simgrid::simix::Exec *compute = nullptr; /* SIMIX modeling of computation */ - simgrid::simix::Comm *comm = nullptr; /* SIMIX modeling of communication */ + simgrid::kernel::activity::Exec *compute = nullptr; /* SIMIX modeling of computation */ + simgrid::kernel::activity::Comm *comm = nullptr; /* SIMIX modeling of communication */ double bytes_amount = 0.0; /* Data size */ double flops_amount = 0.0; /* Computation size */ msg_process_t sender = nullptr; diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index dee434524c..e2adf779f1 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -390,7 +390,7 @@ void MSG_task_set_affinity(msg_task_t task, msg_host_t host, unsigned long mask) return; } - simgrid::simix::Exec *compute = task->simdata->compute; + simgrid::kernel::activity::Exec *compute = task->simdata->compute; msg_host_t host_now = compute->host; // simix_private.h is necessary if (host_now != host) { /* task is not yet executed on this host */ diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 00493b8caa..626f177e1f 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -757,7 +757,7 @@ smx_synchro_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag void simcall_comm_cancel(smx_synchro_t synchro) { simgrid::simix::kernelImmediate([synchro]{ - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); comm->cancel(); }); } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index b035b1fda2..1ecce232e6 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -658,19 +658,19 @@ void SIMIX_display_process_status(void) const char* synchro_description = "unknown"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (dynamic_cast(process->waiting_synchro) != nullptr) synchro_description = "execution"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (dynamic_cast(process->waiting_synchro) != nullptr) synchro_description = "communication"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (dynamic_cast(process->waiting_synchro) != nullptr) synchro_description = "sleeping"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (dynamic_cast(process->waiting_synchro) != nullptr) synchro_description = "synchronization"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (dynamic_cast(process->waiting_synchro) != nullptr) synchro_description = "I/O"; diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index caae036197..a0be3c8cc4 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -211,7 +211,7 @@ smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name, doub double bound, unsigned long affinity_mask){ /* alloc structures and initialize */ - simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, issuer->host); + simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, issuer->host); /* set surf's action */ if (!MC_is_active() && !MC_record_replay_is_active()) { @@ -240,7 +240,7 @@ smx_synchro_t SIMIX_execution_parallel_start(const char *name, int host_nb, sg_h double *bytes_amount, double amount, double rate){ /* alloc structures and initialize */ - simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, nullptr); + simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, nullptr); /* set surf's synchro */ sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb); @@ -268,7 +268,7 @@ smx_synchro_t SIMIX_execution_parallel_start(const char *name, int host_nb, sg_h void SIMIX_execution_cancel(smx_synchro_t synchro) { XBT_DEBUG("Cancel synchro %p", synchro); - simgrid::simix::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::Exec *exec = static_cast(synchro); if (exec->surf_exec) exec->surf_exec->cancel(); @@ -276,21 +276,21 @@ void SIMIX_execution_cancel(smx_synchro_t synchro) void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority) { - simgrid::simix::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::Exec *exec = static_cast(synchro); if(exec->surf_exec) exec->surf_exec->setPriority(priority); } void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound) { - simgrid::simix::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::Exec *exec = static_cast(synchro); if(exec->surf_exec) static_cast(exec->surf_exec)->setBound(bound); } void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask) { - simgrid::simix::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::Exec *exec = static_cast(synchro); if(exec->surf_exec) { /* just a double check to confirm that this host is the host where this task is running. */ xbt_assert(exec->host == host); @@ -300,7 +300,7 @@ void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigne void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t synchro) { - simgrid::simix::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::Exec *exec = static_cast(synchro); XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state); /* Associate this simcall to the synchro */ @@ -319,7 +319,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t synchro SIMIX_execution_finish(exec); } -void SIMIX_execution_finish(simgrid::simix::Exec *exec) +void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec) { for (smx_simcall_t simcall : exec->simcalls) { switch (exec->state) { @@ -362,13 +362,13 @@ void SIMIX_set_category(smx_synchro_t synchro, const char *category) if (synchro->state != SIMIX_RUNNING) return; - simgrid::simix::Exec *exec = dynamic_cast(synchro); + simgrid::kernel::activity::Exec *exec = dynamic_cast(synchro); if (exec != nullptr) { exec->surf_exec->setCategory(category); return; } - simgrid::simix::Comm *comm = dynamic_cast(synchro); + simgrid::kernel::activity::Comm *comm = dynamic_cast(synchro); if (comm != nullptr) { comm->surf_comm->setCategory(category); return; diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 4505f989b3..767c3ea901 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -51,7 +51,7 @@ XBT_PRIVATE void SIMIX_execution_set_priority(smx_synchro_t synchro, double prio XBT_PRIVATE void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound); XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask); -XBT_PRIVATE void SIMIX_execution_finish(simgrid::simix::Exec *exec); +XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec); XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category); diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index a9c34d080d..c4eaa4a677 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -70,7 +70,7 @@ smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host)); - simgrid::simix::Io *synchro = new simgrid::simix::Io(); + simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io(); synchro->host = host; synchro->surf_io = surf_host_read(host, fd->surf_file, size); @@ -93,7 +93,7 @@ smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) if (host->isOff()) THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host)); - simgrid::simix::Io *synchro = new simgrid::simix::Io(); + simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io(); synchro->host = host; synchro->surf_io = surf_host_write(host, fd->surf_file, size); synchro->surf_io->setData(synchro); @@ -115,7 +115,7 @@ smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host) if (host->isOff()) THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host)); - simgrid::simix::Io *synchro = new simgrid::simix::Io(); + simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io(); synchro->host = host; synchro->surf_io = surf_host_open(host, fullpath); synchro->surf_io->setData(synchro); @@ -137,7 +137,7 @@ smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host) if (host->isOff()) THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host)); - simgrid::simix::Io *synchro = new simgrid::simix::Io(); + simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io(); synchro->host = host; synchro->surf_io = surf_host_close(host, fd->surf_file); synchro->surf_io->setData(synchro); @@ -255,7 +255,7 @@ const char* SIMIX_storage_get_host(smx_storage_t storage){ void SIMIX_io_destroy(smx_synchro_t synchro) { - simgrid::simix::Io *io = static_cast(synchro); + simgrid::kernel::activity::Io *io = static_cast(synchro); XBT_DEBUG("Destroy synchro %p", synchro); if (io->surf_io) io->surf_io->unref(); diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 792a7a7983..cbc15eba90 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -84,7 +84,7 @@ void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process) */ static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); mbox->comm_queue.push_back(comm); comm->mbox = mbox; } @@ -96,7 +96,7 @@ static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t synchro) */ void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); comm->mbox = nullptr; for (auto it = mbox->comm_queue.begin(); it != mbox->comm_queue.end(); it++) @@ -119,7 +119,7 @@ static smx_synchro_t _find_matching_comm(std::deque *deque, e_smx for(auto it = deque->begin(); it != deque->end(); it++){ smx_synchro_t synchro = *it; - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); if (comm->type == SIMIX_COMM_SEND) { other_user_data = comm->src_data; @@ -173,7 +173,7 @@ XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_ XBT_DEBUG("send from %p", mbox); /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */ - simgrid::simix::Comm* this_synchro = new simgrid::simix::Comm(SIMIX_COMM_SEND); + simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_SEND); /* Look for communication synchro matching our needs. We also provide a description of * ourself so that the other side also gets a chance of choosing if it wants to match with us. @@ -181,12 +181,12 @@ XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_ * If it is not found then push our communication into the rendez-vous point */ smx_synchro_t other_synchro = _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro, /*remove_matching*/true); - simgrid::simix::Comm *other_comm = static_cast(other_synchro); + simgrid::kernel::activity::Comm *other_comm = static_cast(other_synchro); if (!other_synchro) { other_synchro = this_synchro; - other_comm = static_cast(other_synchro); + other_comm = static_cast(other_synchro); if (mbox->permanent_receiver!=nullptr){ //this mailbox is for small messages, which have to be sent right now @@ -265,7 +265,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void void *data, double rate) { XBT_DEBUG("recv from %p %p", mbox, &mbox->comm_queue); - simgrid::simix::Comm* this_synchro = new simgrid::simix::Comm(SIMIX_COMM_RECEIVE); + simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE); smx_synchro_t other_synchro; //communication already done, get it inside the fifo of completed comms @@ -280,7 +280,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void other_synchro = this_synchro; SIMIX_mbox_push(mbox, this_synchro); } else { - simgrid::simix::Comm *other_comm = static_cast(other_synchro); + simgrid::kernel::activity::Comm *other_comm = static_cast(other_synchro); if(other_comm->surf_comm && other_comm->remains()==0.0) { XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",other_comm); @@ -289,7 +289,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void other_comm->mbox = nullptr; } other_comm->unref(); - static_cast(this_synchro)->unref(); + static_cast(this_synchro)->unref(); } } else { /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */ @@ -306,7 +306,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void SIMIX_mbox_push(mbox, this_synchro); } else { this_synchro->unref(); - simgrid::simix::Comm *other_comm = static_cast(other_synchro); + simgrid::kernel::activity::Comm *other_comm = static_cast(other_synchro); other_comm->state = SIMIX_READY; other_comm->type = SIMIX_COMM_READY; @@ -315,7 +315,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void } /* Setup communication synchro */ - simgrid::simix::Comm *other_comm = static_cast(other_synchro); + simgrid::kernel::activity::Comm *other_comm = static_cast(other_synchro); other_comm->dst_proc = dst_proc; other_comm->dst_buff = dst_buff; other_comm->dst_buff_size = dst_buff_size; @@ -347,13 +347,13 @@ smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data) { XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue); - simgrid::simix::Comm* this_comm; + simgrid::kernel::activity::Comm* this_comm; int smx_type; if(type == 1){ - this_comm = new simgrid::simix::Comm(SIMIX_COMM_SEND); + this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_SEND); smx_type = SIMIX_COMM_RECEIVE; } else{ - this_comm = new simgrid::simix::Comm(SIMIX_COMM_RECEIVE); + this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE); smx_type = SIMIX_COMM_SEND; } smx_synchro_t other_synchro=nullptr; @@ -393,7 +393,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, dou if (timeout == -1) THROW_IMPOSSIBLE; - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); if (comm->src_proc == simcall->issuer) comm->state = SIMIX_SRC_TIMEOUT; else @@ -412,7 +412,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, dou surf_action_t sleep = surf_host_sleep(simcall->issuer->host, timeout); sleep->setData(synchro); - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); if (simcall->issuer == comm->src_proc) comm->src_timeout = sleep; else @@ -422,7 +422,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, dou void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); if (MC_is_active() || MC_record_replay_is_active()){ simcall_comm_test__set__result(simcall, comm->src_proc && comm->dst_proc); @@ -446,7 +446,7 @@ void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro) } void simcall_HANDLER_comm_testany( - smx_simcall_t simcall, simgrid::simix::Synchro* comms[], size_t count) + smx_simcall_t simcall, simgrid::kernel::activity::Synchro* comms[], size_t count) { // The default result is -1 -- this means, "nothing is ready". // It can be changed below, but only if something matches. @@ -457,7 +457,7 @@ void simcall_HANDLER_comm_testany( if(idx == -1){ SIMIX_simcall_answer(simcall); }else{ - simgrid::simix::Synchro* synchro = comms[idx]; + simgrid::kernel::activity::Synchro* synchro = comms[idx]; simcall_comm_testany__set__result(simcall, idx); synchro->simcalls.push_back(simcall); synchro->state = SIMIX_DONE; @@ -467,7 +467,7 @@ void simcall_HANDLER_comm_testany( } for (std::size_t i = 0; i != count; ++i) { - simgrid::simix::Synchro* synchro = comms[i]; + simgrid::kernel::activity::Synchro* synchro = comms[i]; if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) { simcall_comm_testany__set__result(simcall, i); synchro->simcalls.push_back(simcall); @@ -537,7 +537,7 @@ void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall) */ static inline void SIMIX_comm_start(smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); /* If both the sender and the receiver are already there, start the communication */ if (synchro->state == SIMIX_READY) { @@ -580,7 +580,7 @@ static inline void SIMIX_comm_start(smx_synchro_t synchro) */ void SIMIX_comm_finish(smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); unsigned int destroy_count = 0; while (!synchro->simcalls.empty()) { @@ -726,7 +726,7 @@ void SIMIX_comm_finish(smx_synchro_t synchro) } while (destroy_count-- > 0) - static_cast(synchro)->unref(); + static_cast(synchro)->unref(); } /******************************************************************************/ @@ -741,7 +741,7 @@ void SIMIX_comm_set_copy_data_callback(void (*callback) (smx_synchro_t, void*, s void SIMIX_comm_copy_pointer_callback(smx_synchro_t synchro, void* buff, size_t buff_size) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); xbt_assert((buff_size == sizeof(void *)), "Cannot copy %zu bytes: must be sizeof(void*)", buff_size); *(void **) (comm->dst_buff) = buff; @@ -749,7 +749,7 @@ void SIMIX_comm_copy_pointer_callback(smx_synchro_t synchro, void* buff, size_t void SIMIX_comm_copy_buffer_callback(smx_synchro_t synchro, void* buff, size_t buff_size) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); XBT_DEBUG("Copy the data over"); memcpy(comm->dst_buff, buff, buff_size); @@ -766,7 +766,7 @@ void SIMIX_comm_copy_buffer_callback(smx_synchro_t synchro, void* buff, size_t b */ void SIMIX_comm_copy_data(smx_synchro_t synchro) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); size_t buff_size = comm->src_buff_size; /* If there is no data to copy then return */ diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index 6218716f6f..b9bd15e591 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -96,7 +96,7 @@ void SIMIX_process_cleanup(smx_process_t process) /* cancel non-blocking communications */ smx_synchro_t synchro = static_cast(xbt_fifo_pop(process->comms)); while (synchro != nullptr) { - simgrid::simix::Comm *comm = static_cast(synchro); + simgrid::kernel::activity::Comm *comm = static_cast(synchro); /* make sure no one will finish the comm after this process is destroyed, * because src_proc or dst_proc would be an invalid pointer */ @@ -467,11 +467,11 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) { /* destroy the blocking synchro if any */ if (process->waiting_synchro) { - simgrid::simix::Exec *exec = dynamic_cast(process->waiting_synchro); - simgrid::simix::Comm *comm = dynamic_cast(process->waiting_synchro); - simgrid::simix::Sleep *sleep = dynamic_cast(process->waiting_synchro); - simgrid::simix::Raw *raw = dynamic_cast(process->waiting_synchro); - simgrid::simix::Io *io = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Exec *exec = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Comm *comm = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Sleep *sleep = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Raw *raw = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Io *io = dynamic_cast(process->waiting_synchro); if (exec != nullptr) { exec->unref(); @@ -530,18 +530,18 @@ void SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, int value, con /* cancel the blocking synchro if any */ if (process->waiting_synchro) { - simgrid::simix::Exec *exec = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Exec *exec = dynamic_cast(process->waiting_synchro); if (exec != nullptr) { SIMIX_execution_cancel(process->waiting_synchro); } - simgrid::simix::Comm *comm = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Comm *comm = dynamic_cast(process->waiting_synchro); if (comm != nullptr) { xbt_fifo_remove(process->comms, comm); comm->cancel(); } - simgrid::simix::Sleep *sleep = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Sleep *sleep = dynamic_cast(process->waiting_synchro); if (sleep != nullptr) { SIMIX_process_sleep_destroy(process->waiting_synchro); if (!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) { @@ -550,12 +550,12 @@ void SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, int value, con } } - simgrid::simix::Raw *raw = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Raw *raw = dynamic_cast(process->waiting_synchro); if (raw != nullptr) { SIMIX_synchro_stop_waiting(process, &process->simcall); } - simgrid::simix::Io *io = dynamic_cast(process->waiting_synchro); + simgrid::kernel::activity::Io *io = dynamic_cast(process->waiting_synchro); if (io != nullptr) { SIMIX_io_destroy(process->waiting_synchro); } @@ -772,7 +772,7 @@ void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, } static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){ - simgrid::simix::Sleep *sleep = static_cast(synchro); + simgrid::kernel::activity::Sleep *sleep = static_cast(synchro); if (sleep->surf_sleep) { sleep->surf_sleep->cancel(); @@ -800,7 +800,7 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synch smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout) { smx_synchro_t res = SIMIX_process_sleep(issuer, timeout); - static_cast(res)->ref(); + static_cast(res)->ref(); SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res); return res; } @@ -826,7 +826,7 @@ smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration) if (host->isOff()) THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host)); - simgrid::simix::Sleep *synchro = new simgrid::simix::Sleep(); + simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep(); synchro->host = host; synchro->surf_sleep = surf_host_sleep(host, duration); synchro->surf_sleep->setData(synchro); @@ -838,7 +838,7 @@ smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration) void SIMIX_process_sleep_destroy(smx_synchro_t synchro) { XBT_DEBUG("Destroy synchro %p", synchro); - simgrid::simix::Sleep *sleep = static_cast(synchro); + simgrid::kernel::activity::Sleep *sleep = static_cast(synchro); if (sleep->surf_sleep) { sleep->surf_sleep->unref(); diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index bdda6028bc..cde0af9a52 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -27,7 +27,7 @@ static smx_synchro_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout) { XBT_IN("(%p, %f)",smx_host,timeout); - simgrid::simix::Raw *sync = new simgrid::simix::Raw(); + simgrid::kernel::activity::Raw *sync = new simgrid::kernel::activity::Raw(); sync->sleep = surf_host_sleep(smx_host, timeout); sync->sleep->setData(sync); XBT_OUT(); diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp index 61b11ef8d8..b2f576509e 100644 --- a/src/smpi/smpi_base.cpp +++ b/src/smpi/smpi_base.cpp @@ -773,7 +773,7 @@ int smpi_mpi_test(MPI_Request * request, MPI_Status * status) { int smpi_mpi_testany(int count, MPI_Request requests[], int *index, MPI_Status * status) { - std::vector comms; + std::vector comms; comms.reserve(count); int i; @@ -877,8 +877,8 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* } if (request->action != nullptr){ - simgrid::simix::Comm *sync_comm = static_cast(request->action); - MPI_Request req = static_cast(sync_comm->src_data); + simgrid::kernel::activity::Comm *sync_comm = static_cast(request->action); + MPI_Request req = static_cast(sync_comm->src_data); *flag = 1; if(status != MPI_STATUS_IGNORE && (req->flags & PREPARED) == 0) { status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(comm), req->src); diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 0d90ef26f7..797873cb13 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -389,7 +389,7 @@ void smpi_comm_copy_buffer_callback(smx_synchro_t synchro, void *buff, size_t bu { XBT_DEBUG("Copy the data over"); void* tmpbuff=buff; - simgrid::simix::Comm *comm = dynamic_cast(synchro); + simgrid::kernel::activity::Comm *comm = dynamic_cast(synchro); if((smpi_privatize_global_variables) && (static_cast(buff) >= smpi_start_data_exe) && (static_cast(buff) < smpi_start_data_exe + smpi_size_data_exe ) -- 2.20.1