From: Martin Quinson Date: Fri, 11 May 2018 23:11:28 +0000 (+0200) Subject: rename some fields (change toto to toto_) X-Git-Tag: v3.20~242 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/89047acf6125582321f8e86f9765b0f57e350e2c rename some fields (change toto to toto_) --- diff --git a/src/kernel/activity/ActivityImpl.hpp b/src/kernel/activity/ActivityImpl.hpp index dba9a7af7f..d145e8fb36 100644 --- a/src/kernel/activity/ActivityImpl.hpp +++ b/src/kernel/activity/ActivityImpl.hpp @@ -23,9 +23,9 @@ class XBT_PUBLIC ActivityImpl { public: ActivityImpl(); virtual ~ActivityImpl(); - e_smx_state_t state = SIMIX_WAITING; /* State of the activity */ - std::string name; /* Activity name if any */ - std::list simcalls; /* List of simcalls waiting for this activity */ + e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */ + std::string name_; /* Activity name if any */ + std::list simcalls_; /* List of simcalls waiting for this activity */ virtual void suspend() = 0; virtual void resume() = 0; diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 129aeafc5e..7d9bd69694 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -15,7 +15,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network); simgrid::kernel::activity::CommImpl::CommImpl(e_smx_comm_type_t _type) : type(_type) { - state = SIMIX_WAITING; + state_ = SIMIX_WAITING; src_data = nullptr; dst_data = nullptr; XBT_DEBUG("Create comm activity %p", this); @@ -27,7 +27,7 @@ simgrid::kernel::activity::CommImpl::~CommImpl() cleanupSurf(); - if (detached && state != SIMIX_DONE) { + if (detached && state_ != SIMIX_DONE) { /* the communication has failed and was detached: * we have to free the buffer */ if (clean_fun) @@ -59,11 +59,11 @@ void simgrid::kernel::activity::CommImpl::cancel() { /* if the synchro is a waiting state means that it is still in a mbox */ /* so remove from it and delete it */ - if (state == SIMIX_WAITING) { + if (state_ == SIMIX_WAITING) { mbox->remove(this); - state = SIMIX_CANCELED; + state_ = SIMIX_CANCELED; } else if (not MC_is_active() /* when running the MC there are no surf actions */ - && not MC_record_replay_is_active() && (state == SIMIX_READY || state == SIMIX_RUNNING)) { + && not MC_record_replay_is_active() && (state_ == SIMIX_READY || state_ == SIMIX_RUNNING)) { surfAction_->cancel(); } @@ -98,26 +98,26 @@ void simgrid::kernel::activity::CommImpl::post() { /* Update synchro state */ if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::done) - state = SIMIX_SRC_TIMEOUT; + state_ = SIMIX_SRC_TIMEOUT; else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::done) - state = SIMIX_DST_TIMEOUT; + state_ = SIMIX_DST_TIMEOUT; else if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::failed) - state = SIMIX_SRC_HOST_FAILURE; + state_ = SIMIX_SRC_HOST_FAILURE; else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::failed) - state = SIMIX_DST_HOST_FAILURE; + state_ = SIMIX_DST_HOST_FAILURE; else if (surfAction_ && surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) { - state = SIMIX_LINK_FAILURE; + state_ = SIMIX_LINK_FAILURE; } else - state = SIMIX_DONE; + state_ = SIMIX_DONE; - XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", this, (int)state, src_proc, + XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", this, (int)state_, src_proc, dst_proc, detached); /* destroy the surf actions associated with the Simix communication */ cleanupSurf(); /* if there are simcalls associated with the synchro, then answer them */ - if (not simcalls.empty()) { + if (not simcalls_.empty()) { SIMIX_comm_finish(this); } } diff --git a/src/kernel/activity/ConditionVariableImpl.cpp b/src/kernel/activity/ConditionVariableImpl.cpp index c49ab05a08..84190d0180 100644 --- a/src/kernel/activity/ConditionVariableImpl.cpp +++ b/src/kernel/activity/ConditionVariableImpl.cpp @@ -29,7 +29,7 @@ static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout, } synchro = SIMIX_synchro_wait(issuer->host, timeout); - synchro->simcalls.push_front(simcall); + synchro->simcalls_.push_front(simcall); issuer->waiting_synchro = synchro; cond->sleeping.push_back(*simcall->issuer); XBT_OUT(); diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index 9860471563..20c99682d6 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -20,8 +20,8 @@ simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, resource::Action : host_(host) { if (name) - this->name = name; - this->state = SIMIX_RUNNING; + this->name_ = name; + this->state_ = SIMIX_RUNNING; surf_action_ = surf_action; surf_action_->set_data(this); @@ -73,7 +73,8 @@ double simgrid::kernel::activity::ExecImpl::get_remaining() double simgrid::kernel::activity::ExecImpl::get_remaining_ratio() { - if (host_ == nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::remains()) + if (host_ == + nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::get_remaining()) return surf_action_->get_remains(); else // Actually compute the ratio for sequential tasks return surf_action_->get_remains() / surf_action_->get_cost(); @@ -95,14 +96,14 @@ void simgrid::kernel::activity::ExecImpl::post() if (host_ && host_->isOff()) { /* FIXME: handle resource failure for parallel tasks too */ /* If the host running the synchro failed, notice it. This way, the asking * process can be killed if it runs on that host itself */ - state = SIMIX_FAILED; + state_ = SIMIX_FAILED; } else if (surf_action_ && surf_action_->get_state() == simgrid::kernel::resource::Action::State::failed) { /* If the host running the synchro didn't fail, then the synchro was canceled */ - state = SIMIX_CANCELED; + state_ = SIMIX_CANCELED; } else if (timeout_detector_ && timeout_detector_->get_state() == simgrid::kernel::resource::Action::State::done) { - state = SIMIX_TIMEOUT; + state_ = SIMIX_TIMEOUT; } else { - state = SIMIX_DONE; + state_ = SIMIX_DONE; } if (surf_action_) { @@ -116,7 +117,7 @@ void simgrid::kernel::activity::ExecImpl::post() onCompletion(this); /* If there are simcalls associated with the synchro, then answer them */ - if (not simcalls.empty()) + if (not simcalls_.empty()) SIMIX_execution_finish(this); } diff --git a/src/kernel/activity/MutexImpl.cpp b/src/kernel/activity/MutexImpl.cpp index 62fadd7ba0..2a68661fd7 100644 --- a/src/kernel/activity/MutexImpl.cpp +++ b/src/kernel/activity/MutexImpl.cpp @@ -35,7 +35,7 @@ void MutexImpl::lock(smx_actor_t issuer) /* FIXME: check if the host is active ? */ /* Somebody using the mutex, use a synchronization to get host failures */ synchro = SIMIX_synchro_wait(issuer->host, -1); - synchro->simcalls.push_back(&issuer->simcall); + synchro->simcalls_.push_back(&issuer->simcall); issuer->waiting_synchro = synchro; this->sleeping.push_back(*issuer); } else { diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index fd843d1858..05e8303529 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -27,9 +27,9 @@ void simgrid::kernel::activity::SleepImpl::resume() void simgrid::kernel::activity::SleepImpl::post() { - while (not simcalls.empty()) { - smx_simcall_t simcall = simcalls.front(); - simcalls.pop_front(); + while (not simcalls_.empty()) { + smx_simcall_t simcall = simcalls_.front(); + simcalls_.pop_front(); e_smx_state_t result; switch (surf_sleep->get_state()) { diff --git a/src/kernel/activity/SynchroIo.cpp b/src/kernel/activity/SynchroIo.cpp index 3d861d5be1..130354d48e 100644 --- a/src/kernel/activity/SynchroIo.cpp +++ b/src/kernel/activity/SynchroIo.cpp @@ -21,7 +21,7 @@ void simgrid::kernel::activity::IoImpl::resume() void simgrid::kernel::activity::IoImpl::post() { - for (smx_simcall_t const& simcall : simcalls) { + for (smx_simcall_t const& simcall : simcalls_) { switch (simcall->call) { case SIMCALL_STORAGE_WRITE: simcall_storage_write__set__result(simcall, surf_io->get_cost()); @@ -36,10 +36,10 @@ void simgrid::kernel::activity::IoImpl::post() switch (surf_io->get_state()) { case simgrid::kernel::resource::Action::State::failed: - state = SIMIX_FAILED; + state_ = SIMIX_FAILED; break; case simgrid::kernel::resource::Action::State::done: - state = SIMIX_DONE; + state_ = SIMIX_DONE; break; default: THROW_IMPOSSIBLE; diff --git a/src/kernel/activity/SynchroRaw.cpp b/src/kernel/activity/SynchroRaw.cpp index 95b17e2450..69830b02e3 100644 --- a/src/kernel/activity/SynchroRaw.cpp +++ b/src/kernel/activity/SynchroRaw.cpp @@ -28,9 +28,9 @@ void simgrid::kernel::activity::RawImpl::post() { XBT_IN("(%p)",this); if (sleep->get_state() == simgrid::kernel::resource::Action::State::failed) - state = SIMIX_FAILED; + state_ = SIMIX_FAILED; else if (sleep->get_state() == simgrid::kernel::resource::Action::State::done) - state = SIMIX_SRC_TIMEOUT; + state_ = SIMIX_SRC_TIMEOUT; SIMIX_synchro_finish(this); XBT_OUT(); diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index cbcdf33117..e9c1692b35 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -15,10 +15,10 @@ namespace simgrid { namespace s4u { Comm::~Comm() { - if (state_ == State::started && not detached_ && (pimpl_ == nullptr || pimpl_->state == SIMIX_RUNNING)) { + if (state_ == State::started && not detached_ && (pimpl_ == nullptr || pimpl_->state_ == SIMIX_RUNNING)) { XBT_INFO("Comm %p freed before its completion. Detached: %d, State: %d", this, detached_, (int)state_); if (pimpl_ != nullptr) - XBT_INFO("pimpl_->state: %d", pimpl_->state); + XBT_INFO("pimpl_->state: %d", pimpl_->state_); else XBT_INFO("pimpl_ is null"); xbt_backtrace_display_current(); diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index bb12bb468d..e0b79ebc2a 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -80,11 +80,11 @@ void SIMIX_process_cleanup(smx_actor_t process) if (comm->src_proc == process) { XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", comm.get(), - comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc); + comm->detached, (int)comm->state_, comm->src_proc, comm->dst_proc); comm->src_proc = nullptr; } else if (comm->dst_proc == process) { - XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm.get(), (int)comm->state, + XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm.get(), (int)comm->state_, comm->src_proc, comm->dst_proc); comm->dst_proc = nullptr; @@ -484,9 +484,9 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) { process->comms.remove(process->waiting_synchro); comm->cancel(); // Remove first occurrence of &process->simcall: - auto i = boost::range::find(process->waiting_synchro->simcalls, &process->simcall); - if (i != process->waiting_synchro->simcalls.end()) - process->waiting_synchro->simcalls.remove(&process->simcall); + auto i = boost::range::find(process->waiting_synchro->simcalls_, &process->simcall); + if (i != process->waiting_synchro->simcalls_.end()) + process->waiting_synchro->simcalls_.remove(&process->simcall); } else if (sleep != nullptr) { SIMIX_process_sleep_destroy(process->waiting_synchro); @@ -591,7 +591,7 @@ void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process) if (process != simcall->issuer) { SIMIX_simcall_answer(simcall); } else { - sync_suspend->simcalls.push_back(simcall); + sync_suspend->simcalls_.push_back(simcall); process->waiting_synchro = sync_suspend; process->waiting_synchro->suspend(); } @@ -643,7 +643,7 @@ void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, do return; } smx_activity_t sync = SIMIX_process_join(simcall->issuer, process, timeout); - sync->simcalls.push_back(simcall); + sync->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = sync; } @@ -672,7 +672,7 @@ void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration) return; } smx_activity_t sync = simcall->issuer->sleep(duration); - sync->simcalls.push_back(simcall); + sync->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = sync; } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 11b654e4d7..a4a9b7a486 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -654,7 +654,7 @@ void SIMIX_display_process_status() XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid, process->get_cname(), process->host->get_cname(), synchro_description, process->waiting_synchro.get(), - process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state); + process->waiting_synchro->name_.c_str(), (int)process->waiting_synchro->state_); } else { XBT_INFO("Process %ld (%s@%s)", process->pid, process->get_cname(), process->host->get_cname()); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 5e5275de40..a2cc7678be 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -150,7 +150,7 @@ SIMIX_execution_start(const char* name, double flops_amount, double priority, do simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr( new simgrid::kernel::activity::ExecImpl(name, surf_action, /*timeout_detector*/ nullptr, host)); - XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str()); + XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name_.c_str()); simgrid::kernel::activity::ExecImpl::onCreation(exec); return exec; @@ -190,35 +190,35 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro) { - XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state); + XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state_); /* Associate this simcall to the synchro */ - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = synchro; /* set surf's synchro */ if (MC_is_active() || MC_record_replay_is_active()) { - synchro->state = SIMIX_DONE; + synchro->state_ = SIMIX_DONE; SIMIX_execution_finish(synchro); return; } /* If the synchro is already finished then perform the error handling */ - if (synchro->state != SIMIX_RUNNING) + if (synchro->state_ != SIMIX_RUNNING) SIMIX_execution_finish(synchro); } void simcall_HANDLER_execution_test(smx_simcall_t simcall, smx_activity_t synchro) { - simcall_execution_test__set__result(simcall, (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING)); + simcall_execution_test__set__result(simcall, (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING)); if (simcall_execution_test__get__result(simcall)) { - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); SIMIX_execution_finish(synchro); } else { SIMIX_simcall_answer(simcall); } /* If the synchro is already finished then perform the error handling */ - if (synchro->state != SIMIX_RUNNING) + if (synchro->state_ != SIMIX_RUNNING) SIMIX_execution_finish(synchro); } @@ -227,10 +227,10 @@ void SIMIX_execution_finish(smx_activity_t synchro) simgrid::kernel::activity::ExecImplPtr exec = boost::static_pointer_cast(synchro); - while (not synchro->simcalls.empty()) { - smx_simcall_t simcall = synchro->simcalls.front(); - synchro->simcalls.pop_front(); - switch (exec->state) { + while (not synchro->simcalls_.empty()) { + smx_simcall_t simcall = synchro->simcalls_.front(); + synchro->simcalls_.pop_front(); + switch (exec->state_) { case SIMIX_DONE: /* do nothing, synchro done */ @@ -254,22 +254,21 @@ void SIMIX_execution_finish(smx_activity_t synchro) break; default: - xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", - (int)exec->state); + xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", (int)exec->state_); } /* Fail the process if the host is down */ if (simcall->issuer->host->isOff()) simcall->issuer->context->iwannadie = 1; simcall->issuer->waiting_synchro = nullptr; - simcall_execution_wait__set__result(simcall, exec->state); + simcall_execution_wait__set__result(simcall, exec->state_); SIMIX_simcall_answer(simcall); } } void SIMIX_set_category(smx_activity_t synchro, const char *category) { - if (synchro->state != SIMIX_RUNNING) + if (synchro->state_ != SIMIX_RUNNING) return; simgrid::kernel::activity::ExecImplPtr exec = diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index e5a998c257..bdc916652b 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -23,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io) void simcall_HANDLER_storage_read(smx_simcall_t simcall, surf_storage_t st, sg_size_t size) { smx_activity_t synchro = SIMIX_storage_read(st, size); - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = synchro; } @@ -41,7 +41,7 @@ smx_activity_t SIMIX_storage_read(surf_storage_t st, sg_size_t size) void simcall_HANDLER_storage_write(smx_simcall_t simcall, surf_storage_t st, sg_size_t size) { smx_activity_t synchro = SIMIX_storage_write(st, size); - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = synchro; } @@ -65,8 +65,8 @@ void SIMIX_io_destroy(smx_activity_t synchro) void SIMIX_io_finish(smx_activity_t synchro) { - for (smx_simcall_t const& simcall : synchro->simcalls) { - switch (synchro->state) { + for (smx_simcall_t const& simcall : synchro->simcalls_) { + switch (synchro->state_) { case SIMIX_DONE: /* do nothing, synchro done */ break; @@ -77,7 +77,7 @@ void SIMIX_io_finish(smx_activity_t synchro) SMX_EXCEPTION(simcall->issuer, cancel_error, 0, "Canceled"); break; default: - xbt_die("Internal error in SIMIX_io_finish: unexpected synchro state %d", static_cast(synchro->state)); + xbt_die("Internal error in SIMIX_io_finish: unexpected synchro state %d", static_cast(synchro->state_)); } if (simcall->issuer->host->isOff()) { diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index d147d4d5c8..72f03f7c4d 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -113,7 +113,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( if (mbox->permanent_receiver != nullptr) { //this mailbox is for small messages, which have to be sent right now - other_comm->state = SIMIX_READY; + other_comm->state_ = SIMIX_READY; other_comm->dst_proc=mbox->permanent_receiver.get(); mbox->done_comm_queue.push_back(other_comm); XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm.get()); @@ -124,7 +124,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( } else { XBT_DEBUG("Receive already pushed"); - other_comm->state = SIMIX_READY; + other_comm->state_ = SIMIX_READY; other_comm->type = SIMIX_COMM_READY; } src_proc->comms.push_back(other_comm); @@ -149,7 +149,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( if (MC_is_active() || MC_record_replay_is_active()) { - other_comm->state = SIMIX_RUNNING; + other_comm->state_ = SIMIX_RUNNING; return (detached ? nullptr : other_comm); } @@ -203,7 +203,7 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_ } else { if (other_comm->surfAction_ && other_comm->remains() < 1e-12) { XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get()); - other_comm->state = SIMIX_DONE; + other_comm->state_ = SIMIX_DONE; other_comm->type = SIMIX_COMM_DONE; other_comm->mbox = nullptr; } @@ -225,7 +225,7 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_ } else { XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get()); - other_comm->state = SIMIX_READY; + other_comm->state_ = SIMIX_READY; other_comm->type = SIMIX_COMM_READY; } dst_proc->comms.push_back(other_comm); @@ -244,7 +244,7 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_ other_comm->copy_data_fun = copy_data_fun; if (MC_is_active() || MC_record_replay_is_active()) { - other_comm->state = SIMIX_RUNNING; + other_comm->state_ = SIMIX_RUNNING; return other_comm; } @@ -291,13 +291,13 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do /* Associate this simcall to the wait synchro */ XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro.get()); - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); simcall->issuer->waiting_synchro = synchro; if (MC_is_active() || MC_record_replay_is_active()) { int idx = SIMCALL_GET_MC_VALUE(simcall); if (idx == 0) { - synchro->state = SIMIX_DONE; + synchro->state_ = SIMIX_DONE; } else { /* If we reached this point, the wait simcall must have a timeout */ /* Otherwise it shouldn't be enabled and executed by the MC */ @@ -307,9 +307,9 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do simgrid::kernel::activity::CommImplPtr comm = boost::static_pointer_cast(synchro); if (comm->src_proc == simcall->issuer) - comm->state = SIMIX_SRC_TIMEOUT; + comm->state_ = SIMIX_SRC_TIMEOUT; else - comm->state = SIMIX_DST_TIMEOUT; + comm->state_ = SIMIX_DST_TIMEOUT; } SIMIX_comm_finish(synchro); @@ -318,7 +318,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do /* If the synchro has already finish perform the error handling, */ /* otherwise set up a waiting timeout on the right side */ - if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) { + if (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING) { SIMIX_comm_finish(synchro); } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */ @@ -342,8 +342,8 @@ void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro) if (MC_is_active() || MC_record_replay_is_active()){ simcall_comm_test__set__result(simcall, comm->src_proc && comm->dst_proc); if (simcall_comm_test__get__result(simcall)){ - synchro->state = SIMIX_DONE; - synchro->simcalls.push_back(simcall); + synchro->state_ = SIMIX_DONE; + synchro->simcalls_.push_back(simcall); SIMIX_comm_finish(synchro); } else { SIMIX_simcall_answer(simcall); @@ -351,9 +351,9 @@ void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro) return; } - simcall_comm_test__set__result(simcall, (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING)); + simcall_comm_test__set__result(simcall, (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING)); if (simcall_comm_test__get__result(simcall)) { - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); SIMIX_comm_finish(synchro); } else { SIMIX_simcall_answer(simcall); @@ -374,8 +374,8 @@ void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activi }else{ simgrid::kernel::activity::ActivityImplPtr synchro = comms[idx]; simcall_comm_testany__set__result(simcall, idx); - synchro->simcalls.push_back(simcall); - synchro->state = SIMIX_DONE; + synchro->simcalls_.push_back(simcall); + synchro->state_ = SIMIX_DONE; SIMIX_comm_finish(synchro); } return; @@ -383,9 +383,9 @@ void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activi for (std::size_t i = 0; i != count; ++i) { simgrid::kernel::activity::ActivityImplPtr synchro = comms[i]; - if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) { + if (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING) { simcall_comm_testany__set__result(simcall, i); - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); SIMIX_comm_finish(synchro); return; } @@ -400,9 +400,9 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, d xbt_die("Timeout not implemented for waitany in the model-checker"); int idx = SIMCALL_GET_MC_VALUE(simcall); smx_activity_t synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t); - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); simcall_comm_waitany__set__result(simcall, idx); - synchro->state = SIMIX_DONE; + synchro->state_ = SIMIX_DONE; SIMIX_comm_finish(synchro); return; } @@ -422,10 +422,10 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, d xbt_dynar_foreach(synchros, cursor, ptr){ smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr); /* associate this simcall to the the synchro */ - synchro->simcalls.push_back(simcall); + synchro->simcalls_.push_back(simcall); /* see if the synchro is already finished */ - if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING){ + if (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING) { SIMIX_comm_finish(synchro); break; } @@ -442,9 +442,9 @@ void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall) smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr); // Remove the first occurence of simcall: - auto i = boost::range::find(synchro->simcalls, simcall); - if (i != synchro->simcalls.end()) - synchro->simcalls.erase(i); + auto i = boost::range::find(synchro->simcalls_, simcall); + if (i != synchro->simcalls_.end()) + synchro->simcalls_.erase(i); } } @@ -455,14 +455,14 @@ void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall) static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm) { /* If both the sender and the receiver are already there, start the communication */ - if (comm->state == SIMIX_READY) { + if (comm->state_ == SIMIX_READY) { simgrid::s4u::Host* sender = comm->src_proc->host; simgrid::s4u::Host* receiver = comm->dst_proc->host; comm->surfAction_ = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate); comm->surfAction_->set_data(comm.get()); - comm->state = SIMIX_RUNNING; + comm->state_ = SIMIX_RUNNING; XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->get_cname(), receiver->get_cname(), comm->surfAction_); @@ -471,7 +471,7 @@ static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm) if (comm->surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) { XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->get_cname(), receiver->get_cname()); - comm->state = SIMIX_LINK_FAILURE; + comm->state_ = SIMIX_LINK_FAILURE; comm->cleanupSurf(); } @@ -501,9 +501,9 @@ void SIMIX_comm_finish(smx_activity_t synchro) simgrid::kernel::activity::CommImplPtr comm = boost::static_pointer_cast(synchro); - while (not synchro->simcalls.empty()) { - smx_simcall_t simcall = synchro->simcalls.front(); - synchro->simcalls.pop_front(); + while (not synchro->simcalls_.empty()) { + smx_simcall_t simcall = synchro->simcalls_.front(); + synchro->simcalls_.pop_front(); /* If a waitany simcall is waiting for this synchro to finish, then remove it from the other synchros in the waitany * list. Afterwards, get the position of the actual synchro in the waitany dynar and return it as the result of the @@ -526,7 +526,7 @@ void SIMIX_comm_finish(smx_activity_t synchro) if (comm->mbox) comm->mbox->remove(comm); - XBT_DEBUG("SIMIX_comm_finish: synchro state = %d", (int)synchro->state); + XBT_DEBUG("SIMIX_comm_finish: synchro state = %d", (int)synchro->state_); /* Check out for errors */ @@ -534,7 +534,7 @@ void SIMIX_comm_finish(smx_activity_t synchro) simcall->issuer->context->iwannadie = 1; SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed"); } else { - switch (comm->state) { + switch (comm->state_) { case SIMIX_DONE: XBT_DEBUG("Communication %p complete!", synchro.get()); @@ -587,7 +587,7 @@ void SIMIX_comm_finish(smx_activity_t synchro) break; default: - xbt_die("Unexpected synchro state in SIMIX_comm_finish: %d", (int)synchro->state); + xbt_die("Unexpected synchro state in SIMIX_comm_finish: %d", (int)synchro->state_); } } diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 24f863649d..233f61c331 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -63,11 +63,11 @@ void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall) void SIMIX_synchro_finish(smx_activity_t synchro) { XBT_IN("(%p)", synchro.get()); - smx_simcall_t simcall = synchro->simcalls.front(); - synchro->simcalls.pop_front(); + smx_simcall_t simcall = synchro->simcalls_.front(); + synchro->simcalls_.pop_front(); - if (synchro->state != SIMIX_SRC_TIMEOUT) { - if (synchro->state == SIMIX_FAILED) + if (synchro->state_ != SIMIX_SRC_TIMEOUT) { + if (synchro->state_ == SIMIX_FAILED) simcall->issuer->context->iwannadie = 1; else THROW_IMPOSSIBLE; @@ -147,7 +147,7 @@ static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_actor_t issuer, XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout); if (sem->value <= 0) { synchro = SIMIX_synchro_wait(issuer->host, timeout); - synchro->simcalls.push_front(simcall); + synchro->simcalls_.push_front(simcall); issuer->waiting_synchro = synchro; sem->sleeping.push_back(*issuer); } else {