State::State(RemoteApp& remote_app, std::shared_ptr<State> parent_state)
: incoming_transition_(parent_state->get_transition_out()), num_(++expended_states_), parent_state_(parent_state)
{
-
- if (_sg_mc_strategy == "none")
+ if (_sg_mc_strategy == "none")
strategy_ = std::make_shared<BasicStrategy>();
else if (_sg_mc_strategy == "max_match_comm")
strategy_ = std::make_shared<MaxMatchComm>();
return std::make_pair(aid, depth_);
}
return std::make_pair(-1, depth_);
-
}
-
void execute_next(aid_t aid, RemoteApp& app) override { return; }
-
};
} // namespace simgrid::mc
/** Wait MC guiding class that aims at minimizing the number of in-fly communication.
* When possible, it will try to match corresponding in-fly communications. */
class MaxMatchComm : public Strategy {
-
/** Stores for each mailbox what kind of transition is waiting on it.
* Negative number means that much recv are waiting on that mailbox, while
* a positiv number means that much send are waiting there. */
aid_value--; // This means we have waiting recv corresponding to this recv
} else {
aid_value++;
-
}
}
if (cast_send != nullptr)
last_mailbox_ = cast_send->get_mailbox();
}
-
};
} // namespace simgrid::mc
/** Wait MC guiding class that aims at maximizing the number of in-fly communication.
* When possible, it will try not to match communications. */
class MinMatchComm : public Strategy {
-
-
/** Stores for each mailbox what kind of transition is waiting on it.
* Negative number means that much recv are waiting on that mailbox, while
* a positiv number means that much send are waiting there. */
if (cast_send != nullptr)
last_mailbox_ = cast_send->get_mailbox();
}
-
};
} // namespace simgrid::mc
return std::make_pair(-1, 0);
}
-
void execute_next(aid_t aid, RemoteApp& app) override {}
-
};
} // namespace simgrid::mc
} else if (const CommRecvTransition* e_issuer_recv =
dynamic_cast<const CommRecvTransition*>(e_issuer->get_transition());
e_issuer_recv != nullptr) {
-
for (const auto e : C) {
// If the provider of the communication for `CommTest` is a
// `CommRecv(m)`, then we only care about `e` if `λ(e) == `CommSend(m)`.
// Check for other locks on the same mutex
if (const MutexTransition* e_mutex = dynamic_cast<const MutexTransition*>(e->get_transition());
e_mutex != nullptr) {
-
if (e_mutex->type_ == Transition::Type::MUTEX_ASYNC_LOCK && mutex_lock->get_mutex() == e_mutex->get_mutex()) {
const EventSet K = EventSet({e, pre_event_a_C.value_or(e)});
exC.insert(U->discover_event(std::move(K), mutex_lock));
// Check for MutexTest
if (const MutexTransition* e_mutex = dynamic_cast<const MutexTransition*>(e->get_transition());
e_mutex != nullptr) {
-
if (e_mutex->type_ == Transition::Type::MUTEX_TEST || e_mutex->type_ == Transition::Type::MUTEX_WAIT) {
// TODO: Check if dependent or not
// This entails getting information about