}
std::unique_ptr<simgrid::mc::State> initial_state =
- std::unique_ptr<simgrid::mc::State>(MC_state_new(++expandedStatesCount_));
+ std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
XBT_DEBUG("********* Start communication determinism verification *********");
/* Create the new expanded state */
std::unique_ptr<simgrid::mc::State> next_state =
- std::unique_ptr<simgrid::mc::State>(MC_state_new(++expandedStatesCount_));
+ std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
/* If comm determinism verification, we cannot stop the exploration if
some communications are not finished (at least, data are transferred).
{
std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(++expandedPairsCount_);
next_pair->automaton_state = state;
- next_pair->graph_state = std::shared_ptr<simgrid::mc::State>(MC_state_new(++expandedStatesCount_));
+ next_pair->graph_state = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
next_pair->atomic_propositions = std::move(propositions);
if (current_pair)
next_pair->depth = current_pair->depth + 1;
/* Create the new expanded state */
std::unique_ptr<simgrid::mc::State> next_state =
- std::unique_ptr<simgrid::mc::State>(MC_state_new(++expandedStatesCount_));
+ std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
if (_sg_mc_termination && this->checkNonTermination(next_state.get())) {
MC_show_non_termination();
XBT_DEBUG("Starting the safety algorithm");
std::unique_ptr<simgrid::mc::State> initial_state =
- std::unique_ptr<simgrid::mc::State>(MC_state_new(++expandedStatesCount_));
+ std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
XBT_DEBUG("**************************************************");
XBT_DEBUG("Initial state");
-/* Copyright (c) 2008-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
using simgrid::mc::remote;
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc,
- "Logging specific to MC (state)");
-
-/**
- * \brief Creates a state data structure used by the exploration algorithm
- */
-simgrid::mc::State* MC_state_new(unsigned long state_number)
-{
- simgrid::mc::State* state = new simgrid::mc::State();
- state->processStates.resize(MC_smx_get_maxpid());
- state->num = state_number;
- /* Stateful model checking */
- if((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination){
- state->system_state = simgrid::mc::take_snapshot(state->num);
- if(_sg_mc_comms_determinism || _sg_mc_send_determinism){
- MC_state_copy_incomplete_communications_pattern(state);
- MC_state_copy_index_communications_pattern(state);
- }
- }
- return state;
-}
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)");
namespace simgrid {
namespace mc {
-State::State()
+State::State(unsigned long state_number)
{
this->internal_comm.clear();
std::memset(&this->internal_req, 0, sizeof(this->internal_req));
std::memset(&this->executed_req, 0, sizeof(this->executed_req));
+
+ processStates.resize(MC_smx_get_maxpid());
+ num = state_number;
+ /* Stateful model checking */
+ if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
+ system_state = simgrid::mc::take_snapshot(num);
+ if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
+ MC_state_copy_incomplete_communications_pattern(this);
+ MC_state_copy_index_communications_pattern(this);
+ }
+ }
}
std::size_t State::interleaveSize() const
std::vector<std::vector<simgrid::mc::PatternCommunication>> incomplete_comm_pattern;
std::vector<unsigned> communicationIndices;
- State();
+ State(unsigned long state_number);
std::size_t interleaveSize() const;
void interleave(smx_actor_t process)
}
}
-XBT_PRIVATE simgrid::mc::State* MC_state_new(unsigned long state_number);
XBT_PRIVATE smx_simcall_t MC_state_get_request(simgrid::mc::State* state);
#endif