"Native initialization of msg/Host failed. Please report that bug");
}
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jclass cls, jstring jname) {
-
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName(JNIEnv* env, jclass cls, jstring jname)
+{
/* get the C string from the java string */
if (jname == nullptr) {
jxbt_throw_null(env, "No host can have a null name");
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_all(JNIEnv * env, jclass cls_arg)
{
-
xbt_dynar_t table = MSG_hosts_as_dynar();
int count = xbt_dynar_length(table);
void Container::create_hierarchy(sg_netzone_t from_as)
{
-
if (from_as->get_children().empty()) {
// I am no AS
// add hosts to jedule platform
std::vector<int> Container::get_hierarchy()
{
if(this->parent != nullptr ) {
-
if (not this->parent->children.empty()) {
// we are in the last level
return this->parent->get_hierarchy();
fprintf(jed_file, " </res>\n");
}
-}
-}
+} // namespace jedule
+} // namespace simgrid
static void add_subsets_to(std::vector<simgrid::jedule::Subset>& subset_list, std::vector<const char*> hostgroup,
jed_container_t parent)
pos = i;
}
}
-
}
void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
}
switch (state_) {
-
case State::DONE:
/* do nothing, synchro done */
XBT_DEBUG("ExecImpl::finish(): execution successful");
/* Add the loopback if needed */
if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
-
xbt_dynar_foreach (xbt_graph_get_nodes(route_graph_), cursor, node) {
bool found = false;
xbt_edge_t edge = nullptr;
/* if the src and dst are the same */
if (src_node_id == dst_node_id) {
-
xbt_node_t node_s_v = xbt_dynar_get_as(nodes, src_node_id, xbt_node_t);
xbt_node_t node_e_v = xbt_dynar_get_as(nodes, dst_node_id, xbt_node_t);
xbt_edge_t edge = xbt_graph_get_edge(route_graph_, node_s_v, node_e_v);
new_edge(dst->id(), src->id(), new_extended_route(hierarchy_, dst, src, gw_dst, gw_src, link_list, symmetrical, 0));
}
-void DijkstraZone::new_edge(int src_id, int dst_id, simgrid::kernel::routing::RouteCreationArgs* route)
+void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route)
{
XBT_DEBUG("Create Route from '%d' to '%d'", src_id, dst_id);
// Finally add it
xbt_graph_new_edge(route_graph_, src, dst, route);
}
-}
-}
-} // namespace
+} // namespace routing
+} // namespace kernel
+} // namespace simgrid
void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
{
-
if (dst->is_router() || src->is_router())
return;
xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, std::map<std::string, xbt_node_t>* nodes)
{
-
auto elm = nodes->find(name);
if (elm == nodes->end()) {
xbt_node_t ret = xbt_graph_new_node(graph, xbt_strdup(name));
void RoutedZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
std::map<std::string, xbt_edge_t>* edges)
{
- std::vector<kernel::routing::NetPoint*> vertices = get_vertices();
+ std::vector<NetPoint*> vertices = get_vertices();
for (auto const& my_src : vertices) {
for (auto const& my_dst : vertices) {
dstName, gw_dst->get_cname());
}
- simgrid::s4u::NetZone::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, link_list);
-}
-}
-}
+ s4u::NetZone::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, link_list);
}
+} // namespace routing
+} // namespace kernel
+} // namespace simgrid
void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
-
XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (dst->is_router() || src->is_router())
const unsigned cur_dim = dimensions_[j];
// current_node/dim_product = position in current dimension
if ((current_node / dim_product) % cur_dim != (dst->id() / dim_product) % cur_dim) {
-
if ((targetCoords[j] > myCoords[j] &&
targetCoords[j] <= myCoords[j] + cur_dim / 2) // Is the target node on the right, without the wrap-around?
|| (myCoords[j] > cur_dim / 2 &&
delete[] myCoords;
delete[] targetCoords;
}
-}
-}
-} // namespace
+} // namespace routing
+} // namespace kernel
+} // namespace simgrid
VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
std::shared_ptr<const std::vector<int>> atomic_propositions,
- std::shared_ptr<simgrid::mc::State> graph_state)
+ std::shared_ptr<State> graph_state)
: num(pair_num), automaton_state(automaton_state)
{
RemoteClient* process = &(mc_model_checker->process());
mc_model_checker->executed_transitions++;
depth++;
-
}
-
XBT_DEBUG("**** End Replay ****");
}
this->previous_request_.clear();
}
this->previous_pair_ = current_pair->num;
- this->previous_request_ = simgrid::mc::request_get_dot_output(req, req_num);
+ this->previous_request_ = request_get_dot_output(req, req_num);
if (current_pair->search_cycle)
fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
fflush(dot_output);
if (evaluate_label(transition_succ->label, *prop_values))
exploration_stack_.push_back(this->create_pair(current_pair.get(), transition_succ->dst, prop_values));
}
-
}
XBT_INFO("No property violation found.");
- simgrid::mc::session->log_state();
+ mc::session->log_state();
}
Checker* createLivenessChecker(Session& s)
#include "src/xbt/mmalloc/mmprivate.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_safety, mc,
- "Logging specific to MC safety verification ");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_safety, mc, "Logging specific to MC safety verification ");
+
namespace simgrid {
namespace mc {
-void SafetyChecker::check_non_termination(simgrid::mc::State* current_state)
+void SafetyChecker::check_non_termination(State* current_state)
{
for (auto state = stack_.rbegin(); state != stack_.rend(); ++state)
if (snapshot_equal((*state)->system_state.get(), current_state->system_state.get())) {
XBT_INFO("Counter-example execution trace:");
for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
XBT_INFO(" %s", s.c_str());
- simgrid::mc::dumpRecordPath();
- simgrid::mc::session->log_state();
+ dumpRecordPath();
+ session->log_state();
- throw simgrid::mc::TerminationError();
+ throw TerminationError();
}
}
int value = state->transition_.argument_;
smx_simcall_t req = &state->executed_req_;
if (req)
- trace.push_back(simgrid::mc::request_to_string(
- req, value, simgrid::mc::RequestType::executed));
+ trace.push_back(request_to_string(req, value, RequestType::executed));
}
return trace;
}
* This allows one to explore the call stack at will. */
while (not stack_.empty()) {
-
/* Get current state */
- simgrid::mc::State* state = stack_.back().get();
+ State* state = stack_.back().get();
XBT_DEBUG("**************************************************");
XBT_VERB("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num_,
// If there are processes to interleave and the maximum depth has not been
// reached then perform one step of the exploration algorithm.
- XBT_DEBUG(
- "Execute: %s",
- simgrid::mc::request_to_string(req, state->transition_.argument_, simgrid::mc::RequestType::simix).c_str());
+ XBT_DEBUG("Execute: %s", request_to_string(req, state->transition_.argument_, RequestType::simix).c_str());
std::string req_str;
if (dot_output != nullptr)
- req_str = simgrid::mc::request_get_dot_output(req, state->transition_.argument_);
+ req_str = request_get_dot_output(req, state->transition_.argument_);
mc_model_checker->executed_transitions++;
this->get_session().execute(state->transition_);
/* Create the new expanded state (copy the state of MCed into our MCer data) */
- std::unique_ptr<simgrid::mc::State> next_state =
- std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expanded_states_count_));
+ std::unique_ptr<State> next_state = std::unique_ptr<State>(new State(++expanded_states_count_));
if (_sg_mc_termination)
this->check_non_termination(next_state.get());
/* Get an enabled process and insert it in the interleave set of the next state */
for (auto& remoteActor : mc_model_checker->process().actors()) {
auto actor = remoteActor.copy.get_buffer();
- if (simgrid::mc::actor_is_enabled(actor)) {
+ if (actor_is_enabled(actor)) {
next_state->add_interleaving_set(actor);
- if (reductionMode_ == simgrid::mc::ReductionMode::dpor)
+ if (reductionMode_ == ReductionMode::dpor)
break; // With DPOR, we take the first enabled transition
}
}
}
XBT_INFO("No property violation found.");
- simgrid::mc::session->log_state();
+ session->log_state();
}
void SafetyChecker::backtrack()
/* Check for deadlocks */
if (mc_model_checker->checkDeadlock()) {
MC_show_deadlock();
- throw simgrid::mc::DeadlockError();
+ throw DeadlockError();
}
- /* Traverse the stack backwards until a state with a non empty interleave
- set is found, deleting all the states that have it empty in the way.
- For each deleted state, check if the request that has generated it
- (from it's predecessor state), depends on any other previous request
- executed before it. If it does then add it to the interleave set of the
- state that executed that previous request. */
+ /* Traverse the stack backwards until a state with a non empty interleave set is found, deleting all the states that
+ * have it empty in the way. For each deleted state, check if the request that has generated it (from its
+ * predecessor state), depends on any other previous request executed before it. If it does then add it to the
+ * interleave set of the state that executed that previous request. */
while (not stack_.empty()) {
- std::unique_ptr<simgrid::mc::State> state = std::move(stack_.back());
+ std::unique_ptr<State> state = std::move(stack_.back());
stack_.pop_back();
- if (reductionMode_ == simgrid::mc::ReductionMode::dpor) {
+ if (reductionMode_ == ReductionMode::dpor) {
smx_simcall_t req = &state->internal_req;
if (req->call_ == SIMCALL_MUTEX_LOCK || req->call_ == SIMCALL_MUTEX_TRYLOCK)
xbt_die("Mutex is currently not supported with DPOR, use --cfg=model-check/reduction:none");
const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
- simgrid::mc::State* prev_state = i->get();
- if (simgrid::mc::request_depend(req, &prev_state->internal_req)) {
+ State* prev_state = i->get();
+ if (request_depend(req, &prev_state->internal_req)) {
if (XBT_LOG_ISENABLED(mc_safety, xbt_log_priority_debug)) {
XBT_DEBUG("Dependent Transitions:");
int value = prev_state->transition_.argument_;
smx_simcall_t prev_req = &prev_state->executed_req_;
- XBT_DEBUG("%s (state=%d)",
- simgrid::mc::request_to_string(prev_req, value, simgrid::mc::RequestType::internal).c_str(),
+ XBT_DEBUG("%s (state=%d)", simgrid::mc::request_to_string(prev_req, value, RequestType::internal).c_str(),
prev_state->num_);
value = state->transition_.argument_;
prev_req = &state->executed_req_;
- XBT_DEBUG("%s (state=%d)",
- simgrid::mc::request_to_string(prev_req, value, simgrid::mc::RequestType::executed).c_str(),
+ XBT_DEBUG("%s (state=%d)", simgrid::mc::request_to_string(prev_req, value, RequestType::executed).c_str(),
state->num_);
}
prev_state->add_interleaving_set(issuer);
else
XBT_DEBUG("Process %p is in done set", req->issuer_);
-
break;
-
} else if (req->issuer_ == prev_state->internal_req.issuer_) {
-
XBT_DEBUG("Simcall %s and %s with same issuer", SIMIX_simcall_name(req->call_),
SIMIX_simcall_name(prev_state->internal_req.call_));
break;
-
} else {
-
const smx_actor_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
XBT_DEBUG("Simcall %s, process %ld (state %d) and simcall %s, process %ld (state %d) are independent",
SIMIX_simcall_name(req->call_), issuer->get_pid(), state->num_,
void SafetyChecker::restore_state()
{
/* Intermediate backtracking */
- simgrid::mc::State* last_state = stack_.back().get();
+ State* last_state = stack_.back().get();
if (last_state->system_state) {
last_state->system_state->restore(&mc_model_checker->process());
return;
}
/* Restore the initial state */
- simgrid::mc::session->restore_initial_state();
+ session->restore_initial_state();
/* Traverse the stack from the state at position start and re-execute the transitions */
- for (std::unique_ptr<simgrid::mc::State> const& state : stack_) {
+ for (std::unique_ptr<State> const& state : stack_) {
if (state == stack_.back())
break;
session->execute(state->transition_);
SafetyChecker::SafetyChecker(Session& s) : Checker(s)
{
- reductionMode_ = simgrid::mc::reduction_mode;
+ reductionMode_ = reduction_mode;
if (_sg_mc_termination)
- reductionMode_ = simgrid::mc::ReductionMode::none;
- else if (reductionMode_ == simgrid::mc::ReductionMode::unset)
- reductionMode_ = simgrid::mc::ReductionMode::dpor;
+ reductionMode_ = ReductionMode::none;
+ else if (reductionMode_ == ReductionMode::unset)
+ reductionMode_ = ReductionMode::dpor;
if (_sg_mc_termination)
XBT_INFO("Check non progressive cycles");
else
XBT_INFO("Check a safety property. Reduction is: %s.",
- (reductionMode_ == simgrid::mc::ReductionMode::none ? "none":
- (reductionMode_ == simgrid::mc::ReductionMode::dpor ? "dpor": "unknown")));
- simgrid::mc::session->initialize();
+ (reductionMode_ == ReductionMode::none ? "none"
+ : (reductionMode_ == ReductionMode::dpor ? "dpor" : "unknown")));
+ session->initialize();
XBT_DEBUG("Starting the safety algorithm");
- std::unique_ptr<simgrid::mc::State> initial_state =
- std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expanded_states_count_));
+ std::unique_ptr<State> initial_state = std::unique_ptr<State>(new State(++expanded_states_count_));
XBT_DEBUG("**************************************************");
XBT_DEBUG("Initial state");
/* Get an enabled actor and insert it in the interleave set of the initial state */
for (auto& actor : mc_model_checker->process().actors())
- if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer())) {
+ if (actor_is_enabled(actor.copy.get_buffer())) {
initial_state->add_interleaving_set(actor.copy.get_buffer());
- if (reductionMode_ != simgrid::mc::ReductionMode::none)
+ if (reductionMode_ != ReductionMode::none)
break;
}
return new SafetyChecker(s);
}
-}
-}
+} // namespace mc
+} // namespace simgrid
class ProcessComparisonState {
public:
- const std::vector<simgrid::mc::IgnoredHeapRegion>* to_ignore = nullptr;
+ const std::vector<IgnoredHeapRegion>* to_ignore = nullptr;
std::vector<HeapArea> equals_to;
- std::vector<simgrid::mc::Type*> types;
+ std::vector<Type*> types;
std::size_t heapsize = 0;
- void initHeapInformation(xbt_mheap_t heap, const std::vector<simgrid::mc::IgnoredHeapRegion>& i);
+ void initHeapInformation(xbt_mheap_t heap, const std::vector<IgnoredHeapRegion>& i);
};
class StateComparator {
compared_pointers.clear();
}
- int initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2, const std::vector<simgrid::mc::IgnoredHeapRegion>& i1,
- const std::vector<simgrid::mc::IgnoredHeapRegion>& i2);
+ int initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2, const std::vector<IgnoredHeapRegion>& i1,
+ const std::vector<IgnoredHeapRegion>& i2);
template <int rank> HeapArea& equals_to_(std::size_t i, std::size_t j)
{
void match_equals(HeapLocationPairs* list);
};
-}
-}
+} // namespace mc
+} // namespace simgrid
/************************************************************************************/
{
for (auto const& pair : *list) {
if (pair[0].fragment_ != -1) {
- this->equals_to_<1>(pair[0].block_, pair[0].fragment_) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
- this->equals_to_<2>(pair[1].block_, pair[1].fragment_) = simgrid::mc::HeapArea(pair[0].block_, pair[0].fragment_);
+ this->equals_to_<1>(pair[0].block_, pair[0].fragment_) = HeapArea(pair[1].block_, pair[1].fragment_);
+ this->equals_to_<2>(pair[1].block_, pair[1].fragment_) = HeapArea(pair[0].block_, pair[0].fragment_);
} else {
- this->equals_to_<1>(pair[0].block_, 0) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
- this->equals_to_<2>(pair[1].block_, 0) = simgrid::mc::HeapArea(pair[0].block_, pair[0].fragment_);
+ this->equals_to_<1>(pair[0].block_, 0) = HeapArea(pair[1].block_, pair[1].fragment_);
+ this->equals_to_<2>(pair[1].block_, 0) = HeapArea(pair[0].block_, pair[0].fragment_);
}
}
}
-void ProcessComparisonState::initHeapInformation(xbt_mheap_t heap, const std::vector<simgrid::mc::IgnoredHeapRegion>& i)
+void ProcessComparisonState::initHeapInformation(xbt_mheap_t heap, const std::vector<IgnoredHeapRegion>& i)
{
auto heaplimit = heap->heaplimit;
this->heapsize = heap->heapsize;
this->types.assign(heaplimit * MAX_FRAGMENT_PER_BLOCK, nullptr);
}
-int StateComparator::initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2,
- const std::vector<simgrid::mc::IgnoredHeapRegion>& i1,
- const std::vector<simgrid::mc::IgnoredHeapRegion>& i2)
+int StateComparator::initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2, const std::vector<IgnoredHeapRegion>& i1,
+ const std::vector<IgnoredHeapRegion>& i2)
{
if ((heap1->heaplimit != heap2->heaplimit) || (heap1->heapsize != heap2->heapsize))
return -1;
static inline Region* MC_get_heap_region(const Snapshot& snapshot)
{
for (auto const& region : snapshot.snapshot_regions_)
- if (region->region_type() == simgrid::mc::RegionType::Heap)
+ if (region->region_type() == RegionType::Heap)
return region.get();
xbt_die("No heap region");
}
static bool heap_area_differ(StateComparator& state, const void* area1, const void* area2, const Snapshot& snapshot1,
const Snapshot& snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level);
-static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgrid::mc::Snapshot& snapshot1,
- const simgrid::mc::Snapshot& snapshot2)
+static bool mmalloc_heap_differ(StateComparator& state, const Snapshot& snapshot1, const Snapshot& snapshot2)
{
- const simgrid::mc::RemoteClient& process = mc_model_checker->process();
+ const RemoteClient& process = mc_model_checker->process();
/* Check busy blocks */
size_t i1 = 1;
malloc_info heapinfo_temp2;
malloc_info heapinfo_temp2b;
- simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
- simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
+ Region* heap_region1 = MC_get_heap_region(snapshot1);
+ Region* heap_region2 = MC_get_heap_region(snapshot2);
// This is the address of std_heap->heapinfo in the application process:
void* heapinfo_address = &((xbt_mheap_t)process.heap_address)->heapinfo;
equal = true;
i1 += heapinfo1->busy_block.size;
}
-
i2++;
}
XBT_DEBUG("Block %zu not found (size_used = %zu, addr = %p)", i1, heapinfo1->busy_block.busy_size, addr_block1);
return true;
}
-
- } else { /* Fragmented block */
-
+ } else { /* Fragmented block */
for (size_t j1 = 0; j1 < (size_t)(BLOCKSIZE >> heapinfo1->type); j1++) {
-
if (heapinfo1->busy_frag.frag_size[j1] == -1) /* Free fragment_ */
continue;
break;
}
}
-
i2++;
}
return true;
}
}
-
i1++;
}
}
return true;
}
}
-
return false;
}
* @param check_ignore
* @return true when different, false otherwise (same or unknown)
*/
-static bool heap_area_differ_without_type(simgrid::mc::StateComparator& state, const void* real_area1,
- const void* real_area2, const simgrid::mc::Snapshot& snapshot1,
- const simgrid::mc::Snapshot& snapshot2, HeapLocationPairs* previous, int size,
- int check_ignore)
+static bool heap_area_differ_without_type(StateComparator& state, const void* real_area1, const void* real_area2,
+ const Snapshot& snapshot1, const Snapshot& snapshot2,
+ HeapLocationPairs* previous, int size, int check_ignore)
{
- const simgrid::mc::RemoteClient& process = mc_model_checker->process();
- simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
- simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
+ const RemoteClient& process = mc_model_checker->process();
+ Region* heap_region1 = MC_get_heap_region(snapshot1);
+ Region* heap_region2 = MC_get_heap_region(snapshot2);
for (int i = 0; i < size; ) {
if (check_ignore > 0) {
i = pointer_align + sizeof(void *);
continue;
}
-
return true;
}
-
i++;
}
-
return false;
}
* @param pointer_level
* @return true when different, false otherwise (same or unknown)
*/
-static bool heap_area_differ_with_type(simgrid::mc::StateComparator& state, const void* real_area1,
- const void* real_area2, const simgrid::mc::Snapshot& snapshot1,
- const simgrid::mc::Snapshot& snapshot2, HeapLocationPairs* previous,
- simgrid::mc::Type* type, int area_size, int check_ignore, int pointer_level)
+static bool heap_area_differ_with_type(StateComparator& state, const void* real_area1, const void* real_area2,
+ const Snapshot& snapshot1, const Snapshot& snapshot2,
+ HeapLocationPairs* previous, Type* type, int area_size, int check_ignore,
+ int pointer_level)
{
// HACK: This should not happen but in practice, there are some
// DW_TAG_typedef without an associated DW_AT_type:
return false;
}
- simgrid::mc::Type* subtype;
- simgrid::mc::Type* subsubtype;
+ Type* subtype;
+ Type* subsubtype;
int elm_size;
const void* addr_pointed1;
const void* addr_pointed2;
- simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
- simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
+ Region* heap_region1 = MC_get_heap_region(snapshot1);
+ Region* heap_region2 = MC_get_heap_region(snapshot2);
switch (type->type) {
case DW_TAG_unspecified_type:
} else {
for (simgrid::mc::Member& member : type->members) {
// TODO, optimize this? (for the offset case)
- void* real_member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, &snapshot1);
- void* real_member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, &snapshot2);
+ void* real_member1 = dwarf::resolve_member(real_area1, type, &member, &snapshot1);
+ void* real_member2 = dwarf::resolve_member(real_area2, type, &member, &snapshot2);
if (heap_area_differ_with_type(state, real_member1, real_member2, snapshot1, snapshot2, previous,
member.type, -1, check_ignore, 0))
return true;
* @param area_size
* @return DWARF type ID for given offset
*/
-static simgrid::mc::Type* get_offset_type(void* real_base_address, simgrid::mc::Type* type, int offset, int area_size,
- const simgrid::mc::Snapshot& snapshot)
+static Type* get_offset_type(void* real_base_address, Type* type, int offset, int area_size, const Snapshot& snapshot)
{
// Beginning of the block, the inferred variable type if the type of the block:
if (offset == 0)
if (member.offset() == offset)
return member.type;
} else {
- void* real_member = simgrid::dwarf::resolve_member(real_base_address, type, &member, &snapshot);
+ void* real_member = dwarf::resolve_member(real_base_address, type, &member, &snapshot);
if ((char*)real_member - (char*)real_base_address == offset)
return member.type;
}
* @param pointer_level
* @return true when different, false otherwise (same or unknown)
*/
-static bool heap_area_differ(simgrid::mc::StateComparator& state, const void* area1, const void* area2,
- const simgrid::mc::Snapshot& snapshot1, const simgrid::mc::Snapshot& snapshot2,
- HeapLocationPairs* previous, simgrid::mc::Type* type, int pointer_level)
+static bool heap_area_differ(StateComparator& state, const void* area1, const void* area2, const Snapshot& snapshot1,
+ const Snapshot& snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level)
{
const simgrid::mc::RemoteClient& process = mc_model_checker->process();
int new_size1 = -1;
int new_size2 = -1;
- simgrid::mc::Type* new_type1 = nullptr;
- simgrid::mc::Type* new_type2 = nullptr;
+ Type* new_type1 = nullptr;
+ Type* new_type2 = nullptr;
bool match_pairs = false;
return false;
}
- if (heapinfo1->busy_block.ignore > 0
- && heapinfo2->busy_block.ignore == heapinfo1->busy_block.ignore)
+ if (heapinfo1->busy_block.ignore > 0 && heapinfo2->busy_block.ignore == heapinfo1->busy_block.ignore)
check_ignore = heapinfo1->busy_block.ignore;
} else if ((heapinfo1->type > 0) && (heapinfo2->type > 0)) { /* Fragmented block */
}
if (new_type1 != nullptr && new_type2 != nullptr && new_type1 != new_type2) {
-
type = new_type1;
while (type->byte_size == 0 && type->subtype != nullptr)
type = type->subtype;
if ((heapinfo1->busy_frag.ignore[frag1] > 0) &&
(heapinfo2->busy_frag.ignore[frag2] == heapinfo1->busy_frag.ignore[frag1]))
check_ignore = heapinfo1->busy_frag.ignore[frag1];
-
} else
return true;
state.match_equals(previous);
return false;
}
-
-}
-}
+} // namespace mc
+} // namespace simgrid
/************************** Snapshot comparison *******************************/
/******************************************************************************/
}
/* Init heap information used in heap comparison algorithm */
- xbt_mheap_t heap1 =
- static_cast<xbt_mheap_t>(s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
- remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
- xbt_mheap_t heap2 =
- static_cast<xbt_mheap_t>(s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
- remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
+ xbt_mheap_t heap1 = static_cast<xbt_mheap_t>(s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+ remote(process.heap_address), ReadOptions::lazy()));
+ xbt_mheap_t heap2 = static_cast<xbt_mheap_t>(s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+ remote(process.heap_address), ReadOptions::lazy()));
if (state_comparator.initHeapInformation(heap1, heap2, s1->to_ignore_, s2->to_ignore_) == -1) {
XBT_VERB("(%d - %d) Different heap information", s1->num_state_, s2->num_state_);
return false;
return true;
}
-
-}
-}
+} // namespace mc
+} // namespace simgrid
static TagClass classify_tag(int tag)
{
switch (tag) {
-
case DW_TAG_array_type:
case DW_TAG_class_type:
case DW_TAG_enumeration_type:
*/
inline XBT_PRIVATE const char* tagname(Dwarf_Die* die)
{
- return simgrid::dwarf::tagname(dwarf_tag(die));
+ return tagname(dwarf_tag(die));
}
} // namespace dwarf
namespace mc {
/** @brief Finds informations about a given shared object/executable */
-std::shared_ptr<simgrid::mc::ObjectInformation> createObjectInformation(std::vector<simgrid::xbt::VmMap> const& maps,
- const char* name)
+std::shared_ptr<ObjectInformation> createObjectInformation(std::vector<xbt::VmMap> const& maps, const char* name)
{
- std::shared_ptr<simgrid::mc::ObjectInformation> result = std::make_shared<simgrid::mc::ObjectInformation>();
- result->file_name = name;
+ std::shared_ptr<ObjectInformation> result = std::make_shared<ObjectInformation>();
+ result->file_name = name;
simgrid::mc::find_object_address(maps, result.get());
MC_load_dwarf(result.get());
MC_post_process_variables(result.get());
/*************************************************************************/
-void postProcessObjectInformation(simgrid::mc::RemoteClient* process, simgrid::mc::ObjectInformation* info)
+void postProcessObjectInformation(RemoteClient* process, ObjectInformation* info)
{
for (auto& t : info->types) {
- simgrid::mc::Type* type = &(t.second);
- simgrid::mc::Type* subtype = type;
+ Type* type = &(t.second);
+ Type* subtype = type;
while (subtype->type == DW_TAG_typedef || subtype->type == DW_TAG_volatile_type ||
subtype->type == DW_TAG_const_type)
if (subtype->subtype)
*/
msg_error_t MSG_comm_get_status(msg_comm_t comm)
{
-
return comm->get_status();
}
return &i->second;
}
-}
-}
+} // namespace util
+} // namespace simgrid
#endif
//Make the backbone
if ((cluster->bb_bw > 0) || (cluster->bb_lat > 0)) {
-
simgrid::kernel::routing::LinkCreationArgs link;
link.id = std::string(cluster->id)+ "_backbone";
link.bandwidths.push_back(cluster->bb_bw);
host->pimpl_->add_actor_at_boot(arg);
if (start_time > SIMIX_get_clock()) {
-
arg = new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart);
XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time);
if (done) {
appender->do_append(appender, buff);
} else {
-
/* The static buffer was too small, use a dynamically expanded one */
ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
ev->buffer = static_cast<char*>(xbt_malloc(ev->buffer_size));