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
further tidy the includes in MC
[simgrid.git]
/
src
/
mc
/
Session.cpp
diff --git
a/src/mc/Session.cpp
b/src/mc/Session.cpp
index
ce79e7c
..
8bb58f6
100644
(file)
--- a/
src/mc/Session.cpp
+++ b/
src/mc/Session.cpp
@@
-1,26
+1,20
@@
-/* Copyright (c) 2015-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2015-2019. 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. */
/* 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 <csignal>
-#include <fcntl.h>
-
-#include <functional>
-
-#include "xbt/log.h"
-#include "xbt/system_error.hpp"
-#include <mc/mc.h>
-#include <simgrid/modelchecker.h>
-#include <simgrid/sg_config.h>
-
#include "src/mc/Session.hpp"
#include "src/mc/Session.hpp"
-#include "src/mc/mc_state.h"
-#include "src/mc/mc_private.h"
#include "src/mc/checker/Checker.hpp"
#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_config.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_state.hpp"
+#include "xbt/log.h"
+#include "xbt/system_error.hpp"
-#include "src/smpi/include/private.hpp"
+#include <fcntl.h>
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session");
@@
-86,10
+80,13
@@
pid_t do_fork(F code)
Session::Session(pid_t pid, int socket)
{
std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, socket));
Session::Session(pid_t pid, int socket)
{
std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, socket));
+#if HAVE_SMPI
// TODO, automatic detection of the config from the process
// TODO, automatic detection of the config from the process
- process->privatized(smpi_privatize_global_variables != SMPI_PRIVATIZE_NONE);
- modelChecker_ = std::unique_ptr<ModelChecker>(
- new simgrid::mc::ModelChecker(std::move(process)));
+ process->privatized(smpi_privatize_global_variables != SmpiPrivStrategies::NONE);
+#else
+ process->privatized(false);
+#endif
+ modelChecker_.reset(new simgrid::mc::ModelChecker(std::move(process)));
xbt_assert(mc_model_checker == nullptr);
mc_model_checker = modelChecker_.get();
mc_model_checker->start();
xbt_assert(mc_model_checker == nullptr);
mc_model_checker = modelChecker_.get();
mc_model_checker->start();
@@
-122,7
+119,7
@@
void Session::logState()
{
mc_model_checker->getChecker()->logState();
{
mc_model_checker->getChecker()->logState();
- if (
(_sg_mc_dot_output_file != nullptr) && (_sg_mc_dot_output_file[0] != '\0'
)) {
+ if (
not _sg_mc_dot_output_file.get().empty(
)) {
fprintf(dot_output, "}\n");
fclose(dot_output);
}
fprintf(dot_output, "}\n");
fclose(dot_output);
}
@@
-133,7
+130,7
@@
void Session::logState()
}
// static
}
// static
-Session* Session::fork(
std::function<void()>
code)
+Session* Session::fork(
const std::function<void()>&
code)
{
// Create a AF_LOCAL socketpair used for exchanging messages
// between the model-checker process (ourselves) and the model-checked
{
// Create a AF_LOCAL socketpair used for exchanging messages
// between the model-checker process (ourselves) and the model-checked