e_smx_state_t comp_state;
msg_error_t status = MSG_OK;
-
- xbt_assert((not simdata->compute) && not task->simdata->isused,
+ xbt_assert((not simdata->compute) && not task->simdata->is_used,
"This task is executed somewhere else. Go fix your code!");
XBT_DEBUG("Computing on %s", MSG_process_get_name(MSG_process_self()));
simgrid::instr::Container::by_name(instr_pid(MSG_process_self()))->get_state("ACTOR_STATE")->push_event("execute");
try {
- simdata->setUsed();
+ simdata->set_used();
if (simdata->host_nb > 0) {
simdata->compute =
comp_state = simcall_execution_wait(simdata->compute);
- simdata->setNotUsed();
+ simdata->set_not_used();
XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
} catch (simgrid::HostFailureException& e) {
->wait_for(timeout);
*task = static_cast<msg_task_t>(payload);
XBT_DEBUG("Got task %s from %s", (*task)->name, alias);
- (*task)->simdata->setNotUsed();
+ (*task)->simdata->set_not_used();
} catch (simgrid::HostFailureException& e) {
ret = MSG_HOST_FAILURE;
} catch (simgrid::TimeoutError& e) {
t_simdata = task->simdata;
t_simdata->sender = myself;
t_simdata->source = MSG_host_self();
- t_simdata->setUsed();
+ t_simdata->set_used();
t_simdata->comm = nullptr;
msg_global->sent_msg++;
finished = comm->s_comm->test();
if (finished && comm->task_received != nullptr) {
/* I am the receiver */
- (*comm->task_received)->simdata->setNotUsed();
+ (*comm->task_received)->simdata->set_not_used();
}
} catch (simgrid::TimeoutError& e) {
comm->status = MSG_TIMEOUT;
if (status == MSG_OK && comm->task_received != nullptr) {
/* I am the receiver */
- (*comm->task_received)->simdata->setNotUsed();
+ (*comm->task_received)->simdata->set_not_used();
}
}
if (comm->task_received != nullptr) {
/* I am the receiver */
- (*comm->task_received)->simdata->setNotUsed();
+ (*comm->task_received)->simdata->set_not_used();
}
/* FIXME: these functions are not traceable */
if (comm->task_received != nullptr) {
/* I am the receiver */
- (*comm->task_received)->simdata->setNotUsed();
+ (*comm->task_received)->simdata->set_not_used();
}
return finished_index;
simdata_task_t t_simdata = task->simdata;
t_simdata->sender = MSG_process_self();
t_simdata->source = MSG_host_self();
- t_simdata->setUsed();
+ t_simdata->set_used();
msg_global->sent_msg++;
throw;
/* If the send failed, it is not used anymore */
- t_simdata->setNotUsed();
+ t_simdata->set_not_used();
}
return ret;
delete[] flops_parallel_amount;
delete[] bytes_parallel_amount;
}
- void setUsed();
- void setNotUsed() { this->isused = false; }
+ void set_used();
+ void set_not_used() { this->is_used = false; }
simgrid::kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
simgrid::s4u::CommPtr comm = nullptr; /* S4U modeling of communication */
double bound = 0.0; /* Capping for CPU resource, or 0 for no capping */
double rate = -1; /* Capping for network resource, or -1 for no capping*/
- bool isused = false; /* Indicates whether the task is used in SIMIX currently */
+ bool is_used = false; /* Indicates whether the task is used in SIMIX currently */
int host_nb = 0; /* ==0 if sequential task; parallel task if not */
/******* Parallel Tasks Only !!!! *******/
sg_host_t* host_list = nullptr;
double* bytes_parallel_amount = nullptr;
private:
- void reportMultipleUse() const;
+ void report_multiple_use() const;
};
/******************************* Process *************************************/
/* declaration of instrumentation functions from msg_task_instr.c */
XBT_PRIVATE void TRACE_msg_task_put_start(msg_task_t task);
-
-inline void s_simdata_task_t::setUsed()
+inline void s_simdata_task_t::set_used()
{
- if (this->isused)
- this->reportMultipleUse();
- this->isused = true;
+ if (this->is_used)
+ this->report_multiple_use();
+ this->is_used = true;
}
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
-void s_simdata_task_t::reportMultipleUse() const
+void s_simdata_task_t::report_multiple_use() const
{
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
*/
msg_error_t MSG_task_destroy(msg_task_t task)
{
- if (task->simdata->isused) {
+ if (task->simdata->is_used) {
/* the task is being sent or executed: cancel it first */
MSG_task_cancel(task);
}
} else if (simdata->comm) {
simdata->comm->cancel();
}
- simdata->setNotUsed();
+ simdata->set_not_used();
return MSG_OK;
}