Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sigterm to the signal handler for Benchmark #1095

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/cltools/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -689,6 +693,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) {
Expand Down