A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MC further cleanups (let it compile, this time)
[simgrid.git]
/
src
/
mc
/
api.cpp
diff --git
a/src/mc/api.cpp
b/src/mc/api.cpp
index
a9aaba9
..
f854af4
100644
(file)
--- a/
src/mc/api.cpp
+++ b/
src/mc/api.cpp
@@
-12,7
+12,6
@@
#include "src/mc/explo/Exploration.hpp"
#include "src/mc/mc_base.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/explo/Exploration.hpp"
#include "src/mc/mc_base.hpp"
#include "src/mc/mc_exit.hpp"
-#include "src/mc/mc_pattern.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/remote/RemoteProcess.hpp"
#include "src/surf/HostImpl.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/remote/RemoteProcess.hpp"
#include "src/surf/HostImpl.hpp"
@@
-28,15
+27,20
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Api, mc, "Logging specific to MC Facade APIs ");
XBT_LOG_EXTERNAL_CATEGORY(mc_global);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Api, mc, "Logging specific to MC Facade APIs ");
XBT_LOG_EXTERNAL_CATEGORY(mc_global);
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
-simgrid::mc::Exploration* Api::initialize(char** argv, simgrid::mc::ExplorationAlgorithm algo)
+simgrid::mc::Exploration* Api::initialize(char** argv, const std::unordered_map<std::string, std::string>& env,
+ simgrid::mc::ExplorationAlgorithm algo)
{
{
- session_ = std::make_unique<simgrid::mc::Session>([argv] {
+ session_ = std::make_unique<simgrid::mc::Session>([argv
, &env
] {
int i = 1;
while (argv[i] != nullptr && argv[i][0] == '-')
i++;
int i = 1;
while (argv[i] != nullptr && argv[i][0] == '-')
i++;
+
+ for (auto const& [key, val] : env) {
+ XBT_INFO("setenv '%s'='%s'", key.c_str(), val.c_str());
+ setenv(key.c_str(), val.c_str(), 1);
+ }
xbt_assert(argv[i] != nullptr,
"Unable to find a binary to exec on the command line. Did you only pass config flags?");
execvp(argv[i], argv + i);
xbt_assert(argv[i] != nullptr,
"Unable to find a binary to exec on the command line. Did you only pass config flags?");
execvp(argv[i], argv + i);
@@
-69,11
+73,6
@@
simgrid::mc::Exploration* Api::initialize(char** argv, simgrid::mc::ExplorationA
return explo;
}
return explo;
}
-std::vector<simgrid::mc::ActorInformation>& Api::get_actors() const
-{
- return mc_model_checker->get_remote_process().actors();
-}
-
unsigned long Api::get_maxpid() const
{
return mc_model_checker->get_remote_process().get_maxpid();
unsigned long Api::get_maxpid() const
{
return mc_model_checker->get_remote_process().get_maxpid();
@@
-101,7
+100,7
@@
void Api::mc_exit(int status) const
mc_model_checker->exit(status);
}
mc_model_checker->exit(status);
}
-void Api::restore_state(simgrid::mc::Snapshot* system_state) const
+void Api::restore_state(
const
simgrid::mc::Snapshot* system_state) const
{
system_state->restore(&mc_model_checker->get_remote_process());
}
{
system_state->restore(&mc_model_checker->get_remote_process());
}
@@
-183,5
+182,4
@@
xbt_automaton_state_t Api::get_automaton_transition_dst(xbt_dynar_t const& dynar
return transition->dst;
}
return transition->dst;
}
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc