#include <vector>
+#include <xbt/dynar.h>
+#include <xbt/automaton.h>
+#include <xbt/swag.h>
+
#include "mc_base.h"
#include "mc/mc.h"
#include "src/mc/mc_record.h"
#include "src/mc/mc_protocol.h"
#include "src/mc/Client.hpp"
+#include "src/mc/Transition.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
/* Restore the initial state */
simgrid::mc::restore_snapshot(simgrid::mc::initial_global_state->snapshot);
- /* At the moment of taking the snapshot the raw heap was set, so restoring
- * it will set it back again, we have to unset it to continue */
if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
// int n = xbt_dynar_length(incomplete_communications_pattern);
assert(n == xbt_dynar_length(initial_communications_pattern));
for (unsigned j=0; j < n ; j++) {
xbt_dynar_reset((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, j, xbt_dynar_t));
- xbt_dynar_get_as(initial_communications_pattern, j, mc_list_comm_pattern_t)->index_comm = 0;
+ xbt_dynar_get_as(initial_communications_pattern, j, simgrid::mc::PatternCommunicationList*)->index_comm = 0;
}
}
if (state == stack.back())
break;
- int value;
- smx_simcall_t saved_req = MC_state_get_executed_request(state.get(), &value);
+ int req_num = state->transition.argument;
+ smx_simcall_t saved_req = &state->executed_req;
if (saved_req) {
/* because we got a copy of the executed request, we have to fetch the
smx_simcall_t req = &issuer->simcall;
/* Debug information */
- if (XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)) {
- char* req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix);
- XBT_DEBUG("Replay: %s (%p)", req_str, state.get());
- xbt_free(req_str);
- }
+ XBT_DEBUG("Replay: %s (%p)",
+ simgrid::mc::request_to_string(
+ req, req_num, simgrid::mc::RequestType::simix).c_str(),
+ state.get());
/* TODO : handle test and testany simcalls */
e_mc_call_type_t call = MC_CALL_TYPE_NONE;
if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
call = MC_get_call_type(req);
- simgrid::mc::handle_simcall(req, value);
-
+ mc_model_checker->handle_simcall(state->transition);
if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
- MC_handle_comm_pattern(call, req, value, nullptr, 1);
-
+ MC_handle_comm_pattern(call, req, req_num, nullptr, 1);
mc_model_checker->wait_for_requests();
count++;