1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

restart: fix restart hook

This commit is contained in:
Steffen Vogel 2019-04-08 10:05:01 +02:00
parent 06292524a1
commit a0fd932ee2

View file

@ -66,13 +66,13 @@ public:
if (prev) {
/* A wrap around of the sequence no should not be treated as a simulation restart */
if (smp->sequence == 0 && prev->sequence != 0 && prev->sequence > UINT64_MAX - 16) {
if (smp->sequence == 0 && prev->sequence != 0 && prev->sequence < UINT64_MAX - 16) {
logger->warn("Simulation from node {} restarted (previous->sequence={}, current->sequence={})",
node_name(node), prev->sequence, smp->sequence);
smp->flags |= SAMPLE_IS_FIRST;
/* Run restart hooks */
/* Restart hooks */
for (size_t i = 0; i < vlist_length(&node->in.hooks); i++) {
Hook *k = (Hook *) vlist_at(&node->in.hooks, i);