#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_request.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_request.hpp"
for (size_t i = 0; i < initial_communications_pattern.size(); i++)
initial_communications_pattern[i].index_comm = state->communication_indices_[i];
for (size_t i = 0; i < initial_communications_pattern.size(); i++)
initial_communications_pattern[i].index_comm = state->communication_indices_[i];
static void update_comm_pattern(simgrid::mc::PatternCommunication* comm_pattern,
simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> const& comm_addr)
{
static void update_comm_pattern(simgrid::mc::PatternCommunication* comm_pattern,
simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> const& comm_addr)
{
- auto src_proc = api::get().get_src_actor(comm_addr.local());
- auto dst_proc = api::get().get_dst_actor(comm_addr.local());
+ auto src_proc = api::get().get_src_actor(comm_addr);
+ auto dst_proc = api::get().get_dst_actor(comm_addr);
- comm_pattern->src_host = api::get().get_actor_host_name(src_proc);
- comm_pattern->dst_host = api::get().get_actor_host_name(dst_proc);
+ comm_pattern->src_host = &api::get().get_actor_host_name(src_proc);
+ comm_pattern->dst_host = &api::get().get_actor_host_name(dst_proc);
/* Create comm pattern */
pattern->type = PatternCommunicationType::send;
pattern->comm_addr = api::get().get_comm_isend_raw_addr(request);
/* Create comm pattern */
pattern->type = PatternCommunicationType::send;
pattern->comm_addr = api::get().get_comm_isend_raw_addr(request);
- pattern->rdv = api::get().get_pattern_comm_rdv(pattern->comm_addr);
- pattern->src_proc = api::get().get_pattern_comm_src_proc(pattern->comm_addr);
- pattern->src_host = Api::get().get_actor_host_name(issuer);
+ pattern->rdv = api::get().get_pattern_comm_rdv(pattern->comm_addr);
+ pattern->src_proc = api::get().get_pattern_comm_src_proc(pattern->comm_addr);
+ pattern->src_host = &api::get().get_actor_host_name(issuer);
#endif
pattern->rdv = api::get().get_pattern_comm_rdv(pattern->comm_addr);
pattern->dst_proc = api::get().get_pattern_comm_dst_proc(pattern->comm_addr);
#endif
pattern->rdv = api::get().get_pattern_comm_rdv(pattern->comm_addr);
pattern->dst_proc = api::get().get_pattern_comm_dst_proc(pattern->comm_addr);
std::vector<std::string> trace;
for (auto const& state : stack_) {
smx_simcall_t req = &state->executed_req_;
std::vector<std::string> trace;
for (auto const& state : stack_) {
smx_simcall_t req = &state->executed_req_;
auto actors = api::get().get_actors();
for (auto& actor : actors)
if (api::get().actor_is_enabled(actor.copy.get_buffer()->get_pid()))
auto actors = api::get().get_actors();
for (auto& actor : actors)
if (api::get().actor_is_enabled(actor.copy.get_buffer()->get_pid()))
for (size_t current_actor = 1; current_actor < maxpid; current_actor++) {
if (not incomplete_communications_pattern[current_actor].empty()) {
XBT_DEBUG("Some communications are not finished, cannot stop the exploration! State not visited.");
for (size_t current_actor = 1; current_actor < maxpid; current_actor++) {
if (not incomplete_communications_pattern[current_actor].empty()) {
XBT_DEBUG("Some communications are not finished, cannot stop the exploration! State not visited.");
/* Intermediate backtracking */
State* last_state = stack_.back().get();
if (last_state->system_state_) {
/* Intermediate backtracking */
State* last_state = stack_.back().get();
if (last_state->system_state_) {
- unsigned long n = api::get().get_maxpid();
- assert(n == incomplete_communications_pattern.size());
- assert(n == initial_communications_pattern.size());
- for (unsigned long j = 0; j < n; j++) {
+ const unsigned long maxpid = api::get().get_maxpid();
+ assert(maxpid == incomplete_communications_pattern.size());
+ assert(maxpid == initial_communications_pattern.size());
+ for (unsigned long j = 0; j < maxpid; j++) {
case CallType::WAITANY: {
RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr;
if (call_type == CallType::WAIT)
case CallType::WAITANY: {
RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr;
if (call_type == CallType::WAIT)
else
comm_addr = api::get().get_comm_waitany_raw_addr(req, value);
auto simcall_issuer = api::get().simcall_get_issuer(req);
else
comm_addr = api::get().get_comm_waitany_raw_addr(req, value);
auto simcall_issuer = api::get().simcall_get_issuer(req);
XBT_DEBUG("**************************************************");
XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), cur_state->num_,
XBT_DEBUG("**************************************************");
XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), cur_state->num_,
- XBT_DEBUG("Execute: %s", api::get().request_to_string(req, req_num, RequestType::simix).c_str());
+ XBT_DEBUG("Execute: %s", api::get().request_to_string(req, req_num).c_str());
auto actors = api::get().get_actors();
for (auto& actor : actors)
if (api::get().actor_is_enabled(actor.copy.get_buffer()->get_pid()))
auto actors = api::get().get_actors();
for (auto& actor : actors)
if (api::get().actor_is_enabled(actor.copy.get_buffer()->get_pid()))
if (dot_output != nullptr)
fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num_, next_state->num_, req_str.c_str());
if (dot_output != nullptr)
fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num_, next_state->num_, req_str.c_str());
- /* Check for deadlocks */
- if (api::get().mc_check_deadlock()) {
- api::get().mc_show_deadlock();
- throw simgrid::mc::DeadlockError();
- }
+ api::get().mc_check_deadlock();
/* We found a back-tracking point, let's loop */
XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num_, stack_.size() + 1);
stack_.push_back(std::move(state));
/* We found a back-tracking point, let's loop */
XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num_, stack_.size() + 1);
stack_.push_back(std::move(state));