diff --git a/src/cltools/Benchmark.cpp b/src/cltools/Benchmark.cpp index afae904df5..846fbfef2e 100644 --- a/src/cltools/Benchmark.cpp +++ b/src/cltools/Benchmark.cpp @@ -195,7 +195,11 @@ class SignalHandlerGuard { extern "C" void signalHandler(int signal) { if (signal == SIGINT) { signalReceived.store(true); - fprintf(stderr, "Signal handler called\n"); + fprintf(stderr, "Signal interrupt received\n"); + } + if (signal == SIGTERM) { + signalReceived.store(true); + fprintf(stderr, "Signal termination received\n"); } } @@ -700,6 +704,7 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) { log<<"Use CTRL+C to stop at any time and collect timers (not working in MPI runs)\n"; // trap signals: SignalHandlerGuard sigIntGuard(SIGINT, signalHandler); + SignalHandlerGuard sigTermGuard(SIGTERM, signalHandler); for(int step=0; nf<0 || step<nf; ++step) { std::shuffle(kernels_ptr.begin(),kernels_ptr.end(),rng);