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
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git]
/
src
/
mc
/
transition
/
Transition.cpp
diff --git
a/src/mc/transition/Transition.cpp
b/src/mc/transition/Transition.cpp
index 70537d95d64f6e2bb1d2a50a49a204ea0b04a5ba..3fb8ced4ac329b5d8d532b8c02a8e110d63326b8 100644
(file)
--- a/
src/mc/transition/Transition.cpp
+++ b/
src/mc/transition/Transition.cpp
@@
-20,8
+20,7
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_transition, mc, "Logging specific to MC transitions");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_transition, mc, "Logging specific to MC transitions");
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
unsigned long Transition::executed_transitions_ = 0;
unsigned long Transition::replayed_transitions_ = 0;
unsigned long Transition::executed_transitions_ = 0;
unsigned long Transition::replayed_transitions_ = 0;
@@
-57,12
+56,12
@@
Transition* deserialize_transition(aid_t issuer, int times_considered, std::stri
#if SIMGRID_HAVE_MC
short type;
xbt_assert(stream >> type);
#if SIMGRID_HAVE_MC
short type;
xbt_assert(stream >> type);
- xbt_assert(type >= 0 && type <= static_cast<short>(Transition::Type::UNKNOWN), "Invalid transition type %d received",
- type);
- auto simcall = static_cast<Transition::Type>(type);
+ switch (auto simcall = static_cast<Transition::Type>(type)) {
+ case Transition::Type::BARRIER_LOCK:
+ case Transition::Type::BARRIER_WAIT:
+ return new BarrierTransition(issuer, times_considered, simcall, stream);
- switch (simcall) {
case Transition::Type::COMM_RECV:
return new CommRecvTransition(issuer, times_considered, stream);
case Transition::Type::COMM_SEND:
case Transition::Type::COMM_RECV:
return new CommRecvTransition(issuer, times_considered, stream);
case Transition::Type::COMM_SEND:
@@
-94,12
+93,14
@@
Transition* deserialize_transition(aid_t issuer, int times_considered, std::stri
case Transition::Type::UNKNOWN:
return new Transition(Transition::Type::UNKNOWN, issuer, times_considered);
case Transition::Type::UNKNOWN:
return new Transition(Transition::Type::UNKNOWN, issuer, times_considered);
+
+ default:
+ break;
}
}
- THROW_IMPOSSIBLE; // Some compilers don't detect that each branch of the above switch has a return
+ xbt_die("Invalid transition type %d received", type);
#else
xbt_die("Deserializing transitions is only interesting in MC mode.");
#endif
}
#else
xbt_die("Deserializing transitions is only interesting in MC mode.");
#endif
}
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc