XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table, const char *name);
XBT_PUBLIC(void) model_help(const char *category, s_surf_model_description_t * table);
-/** @ingroup SURF_interface
- * @brief Action states
- *
- * @see Action
- */
-typedef enum {
- SURF_ACTION_READY = 0, /**< Ready */
- SURF_ACTION_RUNNING, /**< Running */
- SURF_ACTION_FAILED, /**< Task Failure */
- SURF_ACTION_DONE, /**< Completed */
- SURF_ACTION_TO_FREE, /**< Action to free in next cleanup */
- SURF_ACTION_NOT_IN_THE_SYSTEM /**< Not in the system anymore. Why did you ask ? */
-} e_surf_action_state_t;
-
-/** @ingroup SURF_vm_interface
- *
- *
- */
+/** @ingroup SURF_vm_interface */
/* FIXME: Where should the VM state be defined? */
typedef enum {
SURF_VM_STATE_CREATED, /**< created, but not yet started */
/* If the host running the synchro failed, notice it so that the asking
* process can be killed if it runs on that host itself */
synchro->state = SIMIX_FAILED;
- } else if (synchro->execution.surf_exec->getState() == SURF_ACTION_FAILED) {
+ } else if (synchro->execution.surf_exec->getState() == simgrid::surf::Action::State::failed) {
/* If the host running the synchro didn't fail, then the synchro was
* canceled */
synchro->state = SIMIX_CANCELED;
switch (synchro->io.surf_io->getState()) {
- case SURF_ACTION_FAILED:
+ case simgrid::surf::Action::State::failed:
synchro->state = SIMIX_FAILED;
break;
- case SURF_ACTION_DONE:
+ case simgrid::surf::Action::State::done:
synchro->state = SIMIX_DONE;
break;
synchro->state = SIMIX_RUNNING;
/* If a link is failed, detect it immediately */
- if (synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
+ if (synchro->comm.surf_comm->getState() == simgrid::surf::Action::State::failed) {
XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
sg_host_get_name(sender), sg_host_get_name(receiver));
synchro->state = SIMIX_LINK_FAILURE;
{
/* Update synchro state */
if (synchro->comm.src_timeout &&
- synchro->comm.src_timeout->getState() == SURF_ACTION_DONE)
+ synchro->comm.src_timeout->getState() == simgrid::surf::Action::State::done)
synchro->state = SIMIX_SRC_TIMEOUT;
else if (synchro->comm.dst_timeout &&
- synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE)
+ synchro->comm.dst_timeout->getState() == simgrid::surf::Action::State::done)
synchro->state = SIMIX_DST_TIMEOUT;
else if (synchro->comm.src_timeout &&
- synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED)
+ synchro->comm.src_timeout->getState() == simgrid::surf::Action::State::failed)
synchro->state = SIMIX_SRC_HOST_FAILURE;
else if (synchro->comm.dst_timeout &&
- synchro->comm.dst_timeout->getState() == SURF_ACTION_FAILED)
+ synchro->comm.dst_timeout->getState() == simgrid::surf::Action::State::failed)
synchro->state = SIMIX_DST_HOST_FAILURE;
else if (synchro->comm.surf_comm &&
- synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
+ synchro->comm.surf_comm->getState() == simgrid::surf::Action::State::failed) {
XBT_DEBUG("Puta madre. Surf says that the link broke");
synchro->state = SIMIX_LINK_FAILURE;
} else
while ((simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls))) {
switch (synchro->sleep.surf_sleep->getState()){
- case SURF_ACTION_FAILED:
+ case simgrid::surf::Action::State::failed:
simcall->issuer->context->iwannadie = 1;
//SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
state = SIMIX_SRC_HOST_FAILURE;
break;
- case SURF_ACTION_DONE:
+ case simgrid::surf::Action::State::done:
state = SIMIX_DONE;
break;
{
XBT_IN("(%p)",synchro);
xbt_assert(synchro->type == SIMIX_SYNC_SYNCHRO);
- if (synchro->synchro.sleep->getState() == SURF_ACTION_FAILED)
+ if (synchro->synchro.sleep->getState() == simgrid::surf::Action::State::failed)
synchro->state = SIMIX_FAILED;
- else if(synchro->synchro.sleep->getState() == SURF_ACTION_DONE)
+ else if(synchro->synchro.sleep->getState() == simgrid::surf::Action::State::done)
synchro->state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(synchro);
while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
Action *action = static_cast<Action*>(lmm_variable_id(var));
- if (action->getState() == SURF_ACTION_RUNNING ||
- action->getState() == SURF_ACTION_READY ||
- action->getState() == SURF_ACTION_NOT_IN_THE_SYSTEM) {
+ if (action->getState() == Action::State::running ||
+ action->getState() == Action::State::ready ||
+ action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
}
}
}
* Callbacks *
*************/
-simgrid::xbt::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
+simgrid::xbt::signal<void(CpuAction*, Action::State, Action::State)> cpuActionStateChangedCallbacks;
/*********
* Model *
/* set the remains to 0 due to precision problems when updating the remaining amount */
action->setRemains(0);
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
action->heapRemove(getActionHeap()); //FIXME: strange call since action was already popped
}
if (TRACE_is_enabled()) {
if ((action->getRemainsNoUpdate() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
} else if ((action->getMaxDuration() != NO_MAX_DURATION) &&
(action->getMaxDuration() <= 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
}
}
}
XBT_OUT();
}
-simgrid::xbt::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t)> CpuAction::onStateChange;
+simgrid::xbt::signal<void(simgrid::surf::CpuAction*, Action::State)> CpuAction::onStateChange;
-void CpuAction::setState(e_surf_action_state_t state){
- e_surf_action_state_t previous = getState();
+void CpuAction::setState(Action::State state){
+ Action::State previous = getState();
Action::setState(state);
onStateChange(this, previous);
}
friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
public:
/** @brief Callbacks handler which emit the callbacks after CpuAction State changed *
- * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t previous)`
+ * @details Callback functions have the following signature: `void(CpuAction *action, simgrid::surf::Action::State previous)`
*/
- static simgrid::xbt::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t)> onStateChange;
+ static simgrid::xbt::signal<void(simgrid::surf::CpuAction*, simgrid::surf::Action::State)> onStateChange;
CpuAction(simgrid::surf::Model *model, double cost, bool failed)
: Action(model, cost, failed) {} //FIXME:DEADCODE?
/** @brief Set the affinity of the current CpuAction */
virtual void setAffinity(Cpu *cpu, unsigned long mask);
- void setState(e_surf_action_state_t state);
+ void setState(simgrid::surf::Action::State state) override;
void updateRemainingLazy(double now);
std::list<Cpu*> cpus();
-
};
}
action->finish();
/* set the remains to 0 due to precision problems when updating the remaining amount */
action->setRemains(0);
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
/* update remaining amount of all actions */
action->cpu_->updateRemainingAmount(surf_get_clock());
}
; it != itend ; ++it) {
CpuTiAction *action = &*it;
- if (action->getState() == SURF_ACTION_RUNNING
- || action->getState() == SURF_ACTION_READY
- || action->getState() == SURF_ACTION_NOT_IN_THE_SYSTEM) {
+ if (action->getState() == Action::State::running
+ || action->getState() == Action::State::ready
+ || action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
if (action->indexHeap_ >= 0) {
CpuTiAction *heap_act = (CpuTiAction*)
xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->tiActionHeap_, action->indexHeap_);
indexHeap_ = i;
}
-void CpuTiAction::setState(e_surf_action_state_t state)
+void CpuTiAction::setState(Action::State state)
{
CpuAction::setState(state);
cpu_->modified(true);
void CpuTiAction::cancel()
{
- this->setState(SURF_ACTION_FAILED);
+ this->setState(Action::State::failed);
xbt_heap_remove(getModel()->getActionHeap(), this->indexHeap_);
cpu_->modified(true);
return;
public:
CpuTiAction(CpuTiModel *model, double cost, bool failed, CpuTi *cpu);
- void setState(e_surf_action_state_t state) override;
+ void setState(simgrid::surf::Action::State state) override;
int unref() override;
void cancel() override;
void updateIndexHeap(int i);
XBT_DEBUG("Action %p finished", action);
action->setRemains(0);
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
action->heapRemove(actionHeap_);
action->gapRemove();
if ((action->getRemains() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
action->gapRemove();
} else if (((action->getMaxDuration() != NO_MAX_DURATION)
&& (action->getMaxDuration() <= 0))) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
action->gapRemove();
}
}
while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
Action *action = static_cast<Action*>( lmm_variable_id(var) );
- if (action->getState() == SURF_ACTION_RUNNING ||
- action->getState() == SURF_ACTION_READY) {
+ if (action->getState() == Action::State::running ||
+ action->getState() == Action::State::ready) {
action->setFinishTime(now);
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
}
}
}
if (m_remains <= 0 &&
(lmm_get_variable_weight(getVariable()) > 0)) {
finish();
- setState(SURF_ACTION_DONE);
+ setState(Action::State::done);
heapRemove(getModel()->getActionHeap());
} else if (((m_maxDuration != NO_MAX_DURATION)
&& (m_maxDuration <= 0))) {
finish();
- setState(SURF_ACTION_DONE);
+ setState(Action::State::done);
heapRemove(getModel()->getActionHeap());
}
if (action->getRemainsNoUpdate() <= 0) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
} else if ((action->getMaxDuration() != NO_MAX_DURATION)
&& (action->getMaxDuration() <= 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
}
}
}
static void IB_action_state_changed_callback(
simgrid::surf::NetworkAction *action,
- e_surf_action_state_t statein, e_surf_action_state_t stateout)
+ simgrid::surf::Action::State statein, simgrid::surf::Action::State stateout)
{
using namespace simgrid::surf;
- if(statein!=SURF_ACTION_RUNNING|| stateout!=SURF_ACTION_DONE)
+ if(statein!=simgrid::surf::Action::State::running || stateout!=simgrid::surf::Action::State::done)
return;
std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
XBT_DEBUG("IB callback - action %p finished", action);
simgrid::xbt::signal<void(simgrid::surf::Link*)> Link::onDestruction;
simgrid::xbt::signal<void(simgrid::surf::Link*)> Link::onStateChange;
- simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, e_surf_action_state_t, e_surf_action_state_t)> networkActionStateChangedCallbacks;
+ simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, simgrid::surf::Action::State, simgrid::surf::Action::State)> networkActionStateChangedCallbacks;
simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst, double size, double rate)> networkCommunicateCallbacks;
}
* Action *
**********/
- void NetworkAction::setState(e_surf_action_state_t state){
- e_surf_action_state_t old = getState();
+ void NetworkAction::setState(Action::State state){
+ Action::State old = getState();
Action::setState(state);
networkActionStateChangedCallbacks(this, old, state);
}
/** @brief Callback signal fired when the state of a NetworkAction changes
- * Signature: `void(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t current)` */
- XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, e_surf_action_state_t, e_surf_action_state_t)>) networkActionStateChangedCallbacks;
+ * Signature: `void(NetworkAction *action, simgrid::surf::Action::State old, simgrid::surf::Action::State current)` */
+ XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, simgrid::surf::Action::State, simgrid::surf::Action::State)>) networkActionStateChangedCallbacks;
/** @brief Callback signal fired when a NetworkAction is created (when a communication starts)
* Signature: `void(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate)` */
NetworkAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
: simgrid::surf::Action(model, cost, failed, var) {};
- void setState(e_surf_action_state_t state);
+ void setState(simgrid::surf::Action::State state) override;
double latency_;
double latCurrent_;
action->setRemains(action->getCost() - ns3_get_socket_sent(data));
if (TRACE_is_enabled() &&
- action->getState() == SURF_ACTION_RUNNING){
+ action->getState() == Action::State::running){
double data_sent = ns3_get_socket_sent(data);
double data_delta_sent = data_sent - action->m_lastSent;
xbt_dynar_push(socket_to_destroy,&key);
XBT_DEBUG("Destroy socket %p of action %p", key, action);
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
}
}
host.extension_set(new HostEnergy(&host));
}
-static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_state_t previous) {
+static void onActionStateChange(simgrid::surf::CpuAction *action, simgrid::surf::Action::State previous) {
for(simgrid::surf::Cpu* cpu : action->cpus()) {
const char *name = cpu->getName();
sg_host_t sghost = sg_host_by_name(name);
if ((action->getRemains() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
} else if ((action->getMaxDuration() != NO_MAX_DURATION) &&
(action->getMaxDuration() <= 0)) {
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
} else {
/* Need to check that none of the model has failed */
lmm_constraint_t cnst = NULL;
if (static_cast<HostImpl*>(constraint_id)->isOff()) {
XBT_DEBUG("Action (%p) Failed!!", action);
action->finish();
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
break;
}
}
* Callbacks *
*************/
-simgrid::xbt::signal<void(simgrid::surf::Storage*)> storageCreatedCallbacks;
-simgrid::xbt::signal<void(simgrid::surf::Storage*)> storageDestructedCallbacks;
-simgrid::xbt::signal<void(simgrid::surf::Storage*, int, int)> storageStateChangedCallbacks; // signature: wasOn, isOn
-simgrid::xbt::signal<void(simgrid::surf::StorageAction*, e_surf_action_state_t, e_surf_action_state_t)> storageActionStateChangedCallbacks;
+simgrid::xbt::signal<void(Storage*)> storageCreatedCallbacks;
+simgrid::xbt::signal<void(Storage*)> storageDestructedCallbacks;
+simgrid::xbt::signal<void(Storage*, int, int)> storageStateChangedCallbacks; // signature: wasOn, isOn
+simgrid::xbt::signal<void(StorageAction*, Action::State, Action::State)> storageActionStateChangedCallbacks;
/*********
* Model *
progress = 0;
}
-void StorageAction::setState(e_surf_action_state_t state){
- e_surf_action_state_t old = getState();
+void StorageAction::setState(Action::State state){
+ Action::State old = getState();
Action::setState(state);
storageActionStateChangedCallbacks(this, old, state);
}
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, simgrid::surf::Action::State old, simgrid::surf::Action::State current)`
*/
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageAction*, e_surf_action_state_t, e_surf_action_state_t)>) storageActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::StorageAction*, simgrid::surf::Action::State, simgrid::surf::Action::State)>) storageActionStateChangedCallbacks;
/*********
* Model *
StorageAction(Model *model, double cost, bool failed, lmm_variable_t var,
Storage *storage, e_surf_action_storage_type_t type);
- void setState(e_surf_action_state_t state);
+ void setState(simgrid::surf::Action::State state) override;
e_surf_action_storage_type_t m_type;
Storage *p_storage;
action->p_storage->m_usedSize == action->p_storage->m_size)
{
action->finish();
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
} else if ((action->getRemainsNoUpdate() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0))
{
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
} else if ((action->getMaxDuration() != NO_MAX_DURATION) &&
(action->getMaxDuration() <= 0))
{
action->finish();
- action->setState(SURF_ACTION_DONE);
+ action->setState(Action::State::done);
}
}
return;
m_usedSize -= (fd->size - fd->current_position);
// If the storage is full before even starting to write
if(m_usedSize==m_size) {
- action->setState(SURF_ACTION_FAILED);
+ action->setState(Action::State::failed);
}
return action;
}
void StorageN11Action::cancel()
{
- setState(SURF_ACTION_FAILED);
+ setState(Action::State::failed);
return;
}
m_finish = surf_get_clock();
}
-e_surf_action_state_t Action::getState()
+Action::State Action::getState()
{
if (p_stateSet == getModel()->getReadyActionSet())
- return SURF_ACTION_READY;
+ return Action::State::ready;
if (p_stateSet == getModel()->getRunningActionSet())
- return SURF_ACTION_RUNNING;
+ return Action::State::running;
if (p_stateSet == getModel()->getFailedActionSet())
- return SURF_ACTION_FAILED;
+ return Action::State::failed;
if (p_stateSet == getModel()->getDoneActionSet())
- return SURF_ACTION_DONE;
- return SURF_ACTION_NOT_IN_THE_SYSTEM;
+ return Action::State::done;
+ return Action::State::not_in_the_system;
}
-void Action::setState(e_surf_action_state_t state)
+void Action::setState(Action::State state)
{
- //surf_action_state_t action_state = &(action->model_type->states);
- XBT_IN("(%p,%s)", this, surf_action_state_names[state]);
p_stateSet->erase(p_stateSet->iterator_to(*this));
- if (state == SURF_ACTION_READY)
+ switch (state) {
+ case Action::State::ready:
p_stateSet = getModel()->getReadyActionSet();
- else if (state == SURF_ACTION_RUNNING)
+ break;
+ case Action::State::running:
p_stateSet = getModel()->getRunningActionSet();
- else if (state == SURF_ACTION_FAILED)
+ break;
+ case Action::State::failed:
p_stateSet = getModel()->getFailedActionSet();
- else if (state == SURF_ACTION_DONE)
+ break;
+ case Action::State::done:
p_stateSet = getModel()->getDoneActionSet();
- else
+ break;
+ default:
p_stateSet = NULL;
-
+ break;
+ }
if (p_stateSet)
p_stateSet->push_back(*this);
- XBT_OUT();
}
double Action::getBound()
}
void Action::cancel(){
- setState(SURF_ACTION_FAILED);
+ setState(Action::State::failed);
if (getModel()->getUpdateMechanism() == UM_LAZY) {
if (action_lmm_hook.is_linked())
getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this));
if ((m_remains <= 0) &&
(lmm_get_variable_weight(getVariable()) > 0)) {
finish();
- setState(SURF_ACTION_DONE);
+ setState(Action::State::done);
heapRemove(getModel()->getActionHeap());
} else if (((m_maxDuration != NO_MAX_DURATION)
&& (m_maxDuration <= 0))) {
finish();
- setState(SURF_ACTION_DONE);
+ setState(Action::State::done);
heapRemove(getModel()->getActionHeap());
}
}
typedef boost::intrusive::member_hook<
Action, boost::intrusive::list_member_hook<>, &Action::action_hook> ActionOptions;
typedef boost::intrusive::list<Action, ActionOptions> ActionList;
+
+ enum class State {
+ ready = 0, /**< Ready */
+ running, /**< Running */
+ failed, /**< Task Failure */
+ done, /**< Completed */
+ to_free, /**< Action to free in next cleanup */
+ not_in_the_system /**< Not in the system anymore. Why did you ask ? */
+ };
+
private:
/**
* @brief Common initializations for the constructors
void finish();
/** @brief Get the [state](\ref e_surf_action_state_t) of the current Action */
- e_surf_action_state_t getState(); /**< get the state*/
+ Action::State getState(); /**< get the state*/
/** @brief Set the [state](\ref e_surf_action_state_t) of the current Action */
- virtual void setState(e_surf_action_state_t state);
+ virtual void setState(Action::State state);
/** @brief Get the bound of the current Action */
double getBound();
/* create a cpu action bound to the pm model at the destination. */
CpuAction *new_cpu_action = static_cast<CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
- e_surf_action_state_t state = p_action->getState();
- if (state != SURF_ACTION_DONE)
- XBT_CRITICAL("FIXME: may need a proper handling, %d", state);
+ Action::State state = p_action->getState();
+ if (state != Action::State::done)
+ XBT_CRITICAL("FIXME: may need a proper handling, %d", static_cast<int>(state));
if (p_action->getRemainsNoUpdate() > 0)
XBT_CRITICAL("FIXME: need copy the state(?), %f", p_action->getRemainsNoUpdate());
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
-static const char *string_action(e_surf_action_state_t state)
+static const char *string_action(simgrid::surf::Action::State state)
{
switch (state) {
- case (SURF_ACTION_READY):
+ case (simgrid::surf::Action::State::ready):
return "SURF_ACTION_READY";
- case (SURF_ACTION_RUNNING):
+ case (simgrid::surf::Action::State::running):
return "SURF_ACTION_RUNNING";
- case (SURF_ACTION_FAILED):
+ case (simgrid::surf::Action::State::failed):
return "SURF_ACTION_FAILED";
- case (SURF_ACTION_DONE):
+ case (simgrid::surf::Action::State::done):
return "SURF_ACTION_DONE";
- case (SURF_ACTION_NOT_IN_THE_SYSTEM):
+ case (simgrid::surf::Action::State::not_in_the_system):
return "SURF_ACTION_NOT_IN_THE_SYSTEM";
default:
return "INVALID STATE";
surf_action_t actionC = surf_host_sleep(hostB, 7.32);
/* Use whatever calling style you want... */
- e_surf_action_state_t stateActionA = actionA->getState(); /* When you know actionA model type */
- e_surf_action_state_t stateActionB = actionB->getState(); /* If you're unsure about it's model type */
- e_surf_action_state_t stateActionC = actionC->getState(); /* When you know actionA model type */
+ simgrid::surf::Action::State stateActionA = actionA->getState(); /* When you know actionA model type */
+ simgrid::surf::Action::State stateActionB = actionB->getState(); /* If you're unsure about it's model type */
+ simgrid::surf::Action::State stateActionC = actionC->getState(); /* When you know actionA model type */
/* And just look at the state of these tasks */
XBT_INFO("actionA state: %s", string_action(stateActionA));