VisitedState::VisitedState(unsigned long state_number, unsigned int actor_count)
: actor_count_(actor_count), num(state_number)
{
- this->heap_bytes_used = Api::get().get_remote_heap_bytes();
+ this->heap_bytes_used = mc_model_checker->get_remote_process().get_remote_heap_bytes();
this->system_state = std::make_shared<simgrid::mc::Snapshot>(state_number);
}
+++ /dev/null
-/* Copyright (c) 2020-2022. 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. */
-
-#include "api.hpp"
-
-#include "src/kernel/activity/MailboxImpl.hpp"
-#include "src/kernel/activity/MutexImpl.hpp"
-#include "src/kernel/actor/SimcallObserver.hpp"
-#include "src/mc/api/RemoteApp.hpp"
-#include "src/mc/explo/Exploration.hpp"
-#include "src/mc/mc_base.hpp"
-#include "src/mc/mc_exit.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
-#include "src/surf/HostImpl.hpp"
-
-#include <xbt/asserts.h>
-#include <xbt/log.h>
-#include "simgrid/s4u/Host.hpp"
-#include "xbt/string.hpp"
-#if HAVE_SMPI
-#include "src/smpi/include/smpi_request.hpp"
-#endif
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Api, mc, "Logging specific to MC Facade APIs ");
-XBT_LOG_EXTERNAL_CATEGORY(mc_global);
-
-namespace simgrid::mc {
-
-std::size_t Api::get_remote_heap_bytes() const
-{
- RemoteProcess& process = mc_model_checker->get_remote_process();
- auto heap_bytes_used = mmalloc_get_bytes_used_remote(process.get_heap()->heaplimit, process.get_malloc_info());
- return heap_bytes_used;
-}
-} // namespace simgrid::mc
namespace simgrid::mc {
-XBT_DECLARE_ENUM_CLASS(ExplorationAlgorithm, Safety, UDPOR, Liveness, CommDeterminism);
-
/*
** This class aimes to implement FACADE APIs for simgrid. The FACADE layer sits between the CheckerSide
** (Unfolding_Checker, DPOR, ...) layer and the
};
public:
- // No copy:
- Api(Api const&) = delete;
- void operator=(Api const&) = delete;
-
static Api& get()
{
static Api api;
return api;
}
- // REMOTE APIs
- std::size_t get_remote_heap_bytes() const;
-
// AUTOMATION APIs
inline DerefAndCompareByActorsCountAndUsedHeap compare_pair() const
{
this->app_state_ = std::move(app_state);
if (not this->app_state_->get_system_state())
this->app_state_->set_system_state(std::make_shared<Snapshot>(pair_num));
- this->heap_bytes_used = Api::get().get_remote_heap_bytes();
+ this->heap_bytes_used = mc_model_checker->get_remote_process().get_remote_heap_bytes();
this->actor_count_ = app_state_->get_actor_count();
this->other_num = -1;
this->atomic_propositions = std::move(atomic_propositions);
this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo));
this->cache_flags_ |= RemoteProcess::cache_malloc;
}
+std::size_t RemoteProcess::get_remote_heap_bytes()
+{
+ return mmalloc_get_bytes_used_remote(get_heap()->heaplimit, get_malloc_info());
+}
/** @brief Finds the range of the different memory segments and binary paths */
void RemoteProcess::init_memory_map_info()
this->refresh_malloc_info();
return this->heap_info.data();
}
+ /* Get the amount of memory mallocated in the remote process (requires mmalloc) */
+ std::size_t get_remote_heap_bytes();
void clear_cache() { this->cache_flags_ = RemoteProcess::cache_none; }
src/mc/ModelChecker.hpp
src/mc/VisitedState.cpp
src/mc/VisitedState.hpp
- src/mc/api.cpp
src/mc/api.hpp
src/mc/api/ActorState.hpp
src/mc/api/State.cpp