smx_simcall_t req = nullptr;
if (actor->simcall_.inspector_ != nullptr) {
- bool pending = mc_model_checker->simcall_is_pending(actor->get_pid(), procstate->times_considered);
-
- ++procstate->times_considered;
state->transition_.times_considered_ = procstate->times_considered;
- if (not pending)
+ procstate->times_considered++;
+ if (actor->simcall_.mc_max_consider_ <= procstate->times_considered)
procstate->set_done();
req = &actor->simcall_;
} else
}
const char* Api::actor_get_host_name(smx_actor_t actor) const
+{
+ return get_actor_host_name(actor).c_str();
+}
+
+xbt::string const& Api::get_actor_host_name(smx_actor_t actor) const
{
if (mc_model_checker == nullptr)
- return actor->get_host()->get_cname();
+ return actor->get_host()->get_name();
const simgrid::mc::RemoteSimulation* process = &mc_model_checker->get_remote_simulation();
std::vector<char> hostname(remote_string.len + 1);
// no need to read the terminating null byte, and thus hostname[remote_string.len] is guaranteed to be '\0'
process->read_bytes(hostname.data(), remote_string.len, remote(remote_string.data));
- info->hostname = mc_model_checker->get_host_name(hostname.data()).c_str();
- return info->hostname;
+ info->hostname = &mc_model_checker->get_host_name(hostname.data());
+ return *info->hostname;
}
const char* Api::actor_get_name(smx_actor_t actor) const
return buffer;
}
-const char* Api::get_actor_host_name(smx_actor_t actor) const
-{
- const char* host_name = actor_get_host_name(actor);
- return host_name;
-}
-
#if HAVE_SMPI
bool Api::check_send_request_detached(smx_simcall_t const& simcall) const
{
mc_model_checker->exit(status);
}
-std::string const& Api::mc_get_host_name(std::string const& hostname) const
-{
- return mc_model_checker->get_host_name(hostname);
-}
-
void Api::dump_record_path() const
{
simgrid::mc::dumpRecordPath();
return xbt::string_printf("label = \"%s\", color = %s, fontcolor = %s", label.c_str(), color, color);
}
-const char* Api::simcall_get_name(simgrid::simix::Simcall kind) const
-{
- return simcall_names[static_cast<int>(kind)];
-}
-
#if HAVE_SMPI
int Api::get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simcall type) const
{
session->restore_initial_state();
}
-void Api::execute(Transition const& transition) const
+void Api::execute(Transition& transition, smx_simcall_t simcall) const
{
- session->execute(transition);
- auto textual = mc_model_checker->simcall_to_string(transition.pid_, transition.times_considered_);
+ /* FIXME: once all simcalls have observers, kill the simcall parameter and use mc_model_checker->simcall_to_string() */
+ auto textual =
+ simgrid::mc::Api::get().request_to_string(simcall, transition.times_considered_, RequestType::executed);
strcpy((char*)transition.textual, textual.c_str());
+
+ session->execute(transition);
}
#if SIMGRID_HAVE_MC