if (this->remote_process_->running())
checker_side_.dispatch();
}
-bool ModelChecker::simcall_is_visible(int aid)
+bool ModelChecker::simcall_is_visible(aid_t aid)
{
xbt_assert(mc_model_checker != nullptr, "This should be called from the checker side");
to_c_str(answer.type), (int)answer.type, (int)s, (int)MessageType::SIMCALL_IS_VISIBLE_ANSWER,
(int)sizeof(answer));
- XBT_DEBUG("is_visible(%d) is returning %s", aid, answer.value ? "true" : "false");
+ XBT_DEBUG("is_visible(%ld) is returning %s", aid, answer.value ? "true" : "false");
this->remote_process_->clear_cache();
return answer.value;
}
-std::string ModelChecker::simcall_to_string(MessageType type, int aid, int times_considered)
+std::string ModelChecker::simcall_to_string(MessageType type, aid_t aid, int times_considered)
{
xbt_assert(mc_model_checker != nullptr, "This should be called from the checker side");
return std::string(answer.value);
}
-std::string ModelChecker::simcall_to_string(int aid, int times_considered)
+std::string ModelChecker::simcall_to_string(aid_t aid, int times_considered)
{
std::string answer = simcall_to_string(MessageType::SIMCALL_TO_STRING, aid, times_considered);
- XBT_DEBUG("to_string(%d) is returning %s", aid, answer.c_str());
+ XBT_DEBUG("to_string(%ld) is returning %s", aid, answer.c_str());
return answer;
}
-std::string ModelChecker::simcall_dot_label(int aid, int times_considered)
+std::string ModelChecker::simcall_dot_label(aid_t aid, int times_considered)
{
std::string answer = simcall_to_string(MessageType::SIMCALL_DOT_LABEL, aid, times_considered);
- XBT_DEBUG("dot_label(%d) is returning %s", aid, answer.c_str());
+ XBT_DEBUG("dot_label(%ld) is returning %s", aid, answer.c_str());
return answer;
}
Checker* checker_ = nullptr;
// Expect MessageType::SIMCALL_TO_STRING or MessageType::SIMCALL_DOT_LABEL
- std::string simcall_to_string(MessageType type, int aid, int times_considered);
+ std::string simcall_to_string(MessageType type, aid_t aid, int times_considered);
public:
ModelChecker(ModelChecker const&) = delete;
void handle_simcall(Transition const& transition);
/* Interactions with the simcall observer */
- bool simcall_is_visible(int aid);
- std::string simcall_to_string(int aid, int times_considered);
- std::string simcall_dot_label(int aid, int times_considered);
+ bool simcall_is_visible(aid_t aid);
+ std::string simcall_to_string(aid_t aid, int times_considered);
+ std::string simcall_dot_label(aid_t aid, int times_considered);
XBT_ATTRIB_NORETURN void exit(int status);
#ifndef SIMGRID_MC_TRANSITION_HPP
#define SIMGRID_MC_TRANSITION_HPP
+#include "simgrid/forward.h" // aid_t
#include <string>
namespace simgrid {
*/
class Transition {
public:
- long aid_ = 0;
+ aid_t aid_ = 0;
/* Which transition was executed for this simcall
*
void AppSide::handle_simcall_execute(const s_mc_message_simcall_handle_t* message) const
{
kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_pid(message->aid_);
- xbt_assert(process != nullptr, "Invalid pid %lu", message->aid_);
+ xbt_assert(process != nullptr, "Invalid pid %ld", message->aid_);
process->simcall_handle(message->times_considered_);
xbt_assert(channel_.send(MessageType::WAITING) == 0, "Could not send MESSAGE_WAITING to model-checker");
}
assert_msg_size("SIMCALL_IS_VISIBLE", s_mc_message_simcall_is_visible_t);
auto msg_simcall = (s_mc_message_simcall_is_visible_t*)message_buffer.data();
const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
- xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
+ xbt_assert(actor != nullptr, "Invalid pid %ld", msg_simcall->aid);
xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
bool value = actor->simcall_.observer_->is_visible();
assert_msg_size("SIMCALL_TO_STRING", s_mc_message_simcall_to_string_t);
auto msg_simcall = (s_mc_message_simcall_to_string_t*)message_buffer.data();
const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
- xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
+ xbt_assert(actor != nullptr, "Invalid pid %ld", msg_simcall->aid);
xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
std::string value = actor->simcall_.observer_->to_string(msg_simcall->time_considered);
assert_msg_size("SIMCALL_DOT_LABEL", s_mc_message_simcall_to_string_t);
auto msg_simcall = (s_mc_message_simcall_to_string_t*)message_buffer.data();
const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
- xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
+ xbt_assert(actor != nullptr, "Invalid pid %ld", msg_simcall->aid);
xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
std::string value = actor->simcall_.observer_->dot_label();
/* Server -> client */
struct s_mc_message_simcall_handle_t {
simgrid::mc::MessageType type;
- unsigned long aid_;
+ aid_t aid_;
int times_considered_;
};
/* RPC */
struct s_mc_message_simcall_is_visible_t { // MessageType::SIMCALL_IS_VISIBLE
simgrid::mc::MessageType type;
- int aid;
+ aid_t aid;
};
struct s_mc_message_simcall_is_visible_answer_t { // MessageType::SIMCALL_IS_VISIBLE_ANSWER
simgrid::mc::MessageType type;
struct s_mc_message_simcall_to_string_t { // MessageType::SIMCALL_TO_STRING or MessageType::SIMCALL_DOT_LABEL
simgrid::mc::MessageType type;
- int aid;
+ aid_t aid;
int time_considered;
};
struct s_mc_message_simcall_to_string_answer_t { // MessageType::SIMCALL_TO_STRING_ANSWER