virtual void suspend();
virtual void resume();
virtual void cancel();
- virtual void post() = 0; // What to do when a simcall terminates
- virtual void finish() = 0;
+
+ virtual void post() = 0; // Called by the main loop when the activity is marked as terminated or failed by its model.
+ // Setups the status, clean things up, and call finish()
+ virtual void finish() = 0; // Unlock all simcalls blocked on that activity, either because it was marked as done by
+ // the model or because it terminated without waiting for the model
virtual void register_simcall(smx_simcall_t simcall);
void clean_action();
*/
virtual bool is_enabled() { return true; }
+ /** Execute the simcall, from the kernel POV.
+ *
+ * Most of the time, this action is in charge of doing what the perf models would have done if not in MC mode.
+ * For example, if it's a random(), choose the value to explore next. If it's a waitany, choose the terminated
+ * communication to consider now.
+ */
+ virtual void fire();
+
/** Some simcalls may only be observable under some circomstances.
* Most simcalls are not visible from the MC because they don't have an inspector at all. */
virtual bool is_visible() { return true; }
mc_model_checker->process().read(temp_act, remote_act);
simgrid::kernel::activity::CommImpl* act = temp_act.get_buffer();
if (act->src_actor_.get() && act->dst_actor_.get())
- state->transition_.argument_ = 0;
+ state->transition_.argument_ = 0; // OK
else if (act->src_actor_.get() == nullptr && act->type_ == simgrid::kernel::activity::CommImpl::Type::READY &&
act->detached())
- state->transition_.argument_ = 0;
+ state->transition_.argument_ = 0; // OK
else
- state->transition_.argument_ = -1;
+ state->transition_.argument_ = -1; // timeout
procstate->set_done();
req = &actor->simcall;
break;