From 25e9ae736ebb0450268ccf110ca016e5a48382d6 Mon Sep 17 00:00:00 2001 From: Bruno Date: Tue, 12 Mar 2024 11:20:38 +0800 Subject: [PATCH] Fix Timeout Bug and Improve Docker script --- .../algorithms/dse/ThroughputBufferingDSE.cpp | 26 +++++++++++----- tools/docker/DockerFile.f29 | 8 ----- tools/docker/DockerFile.ubuntu | 30 ++++++++++++++----- 3 files changed, 41 insertions(+), 23 deletions(-) delete mode 100644 tools/docker/DockerFile.f29 diff --git a/src/libkiter/algorithms/dse/ThroughputBufferingDSE.cpp b/src/libkiter/algorithms/dse/ThroughputBufferingDSE.cpp index 1a2078ba..a5576ea7 100644 --- a/src/libkiter/algorithms/dse/ThroughputBufferingDSE.cpp +++ b/src/libkiter/algorithms/dse/ThroughputBufferingDSE.cpp @@ -460,18 +460,28 @@ namespace algorithms { VERBOSE_INFO("Start waiting for exploration_future."); - if (std::future_status::timeout == exploration_future.wait_for(std::chrono::seconds(params.timeout_sec))) { - VERBOSE_INFO("Timeout, sending a stop signal."); - dse.stop(); - VERBOSE_INFO("Wait for stop signal effect."); - exploration_future.wait(); + bool timeout_happenend = false; + if (params.timeout_sec > 0) { + // Manage the end with a timeout + if (std::future_status::timeout == + exploration_future.wait_for(std::chrono::seconds(params.timeout_sec))) { + // The timeout happened, we need to force the end. + timeout_happenend = true; + VERBOSE_INFO("Timeout, sending a stop signal."); + dse.stop(); + VERBOSE_INFO("Wait for stop signal effect."); + } else { + VERBOSE_INFO("exploration_future ended by itself, without stop signal."); + } + } + + exploration_future.wait(); + + if (timeout_happenend) { VERBOSE_INFO("Exploration_future ended, after stop signal."); VERBOSE_WARNING("Incomplete exploration."); - } else { - VERBOSE_INFO("exploration_future ended by itself, without stop signal."); } - return dse.getResults(); } diff --git a/tools/docker/DockerFile.f29 b/tools/docker/DockerFile.f29 deleted file mode 100644 index cb44e81f..00000000 --- a/tools/docker/DockerFile.f29 +++ /dev/null @@ -1,8 +0,0 @@ -FROM fedora:29 - -RUN yum install -y glpk-devel=4.65-2.fc29 cmake=3.14.5-1.fc29 findutils-1:4.6.0-21.fc29 unzip-6.0-42.fc29 gcc-8.3.1-2.fc29 make-1:4.2.1-10.fc29 gcc-c++-8.3.1-2.fc29 libxml2-devel-2.9.8-5.fc29 boost-devel-1.66.0-14.fc29 git-2.20.1-1.fc29 wget-1.20.3-1.fc29 && yum clean all - -RUN mkdir /kiter/ -COPY . /kiter/ -WORKDIR /kiter/ -RUN make clean && make test diff --git a/tools/docker/DockerFile.ubuntu b/tools/docker/DockerFile.ubuntu index 821bee62..5ed4bdb6 100644 --- a/tools/docker/DockerFile.ubuntu +++ b/tools/docker/DockerFile.ubuntu @@ -2,14 +2,30 @@ FROM ubuntu:noble -################################### PACKAGE INSTALL ########################## +################################### INSTALL DEPS ########################## RUN apt-get update && apt-get install --no-install-recommends -y git make cmake gcc g++ libboost-all-dev libxml2-dev libglpk-dev glpk-utils && apt-get clean && rm -rf /var/lib/apt/lists/* -################################################################################ + +################################### PREPARE ########################## RUN mkdir /kiter/ -COPY . /kiter/ -WORKDIR /kiter/ -RUN make clean -RUN make release -j12 -RUN ./Release/bin/kiter -h +COPY ./src /kiter/src +COPY ./benchmarks /kiter/benchmarks +COPY ./modules /kiter/modules +COPY ./tests /kiter/tests +COPY ./tools /kiter/tools +COPY ./CMakeLists.txt /kiter/CMakeLists.txt +COPY ./Makefile /kiter/Makefile + +################################### CLEAN ########################## +RUN make clean -C /kiter/ +RUN make sdf3_benchmarks -C /kiter/ + +################################### COMPILE ########################## +RUN make release -j12 -C /kiter/ + +################################### TEST ########################## +RUN /kiter/Release/bin/kiter -h + + +WORKDIR /kiter/