diff --git a/etc/controlDict b/etc/controlDict index 2176dc2f6d..99ac513fe0 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -74,10 +74,10 @@ OptimisationSwitches nProcsSimpleSum 0; // Force dumping (at next timestep) upon signal (-1 to disable) - writeNowSignal -1; // 10; + writeNowSignal -1; // 10; // SIGUSR1 - // Force dumping (at next timestep) upon signal (-1 to disable) and exit - stopAtWriteNowSignal -1; + // Force dumping and exit (at next timestep) upon signal (-1 to disable) + stopAtWriteNowSignal -1; // 12; // SIGUSR2 // Default dictionary scoping syntax inputSyntax slash; diff --git a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.H b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.H index abc1ef1239..9c5edf982b 100644 --- a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.H +++ b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,10 +25,20 @@ Class Foam::sigStopAtWriteNow Description - Signal handler for interrupt defined by - OptimisationSwitches::stopAtWriteNowSignal + Signal handler to write and exit when the stopAtWriteNowSignal is sent. - Write and stop the job. + stopAtWriteNowSignal is set in etc/controlDict::OptimisationSwitches, e.g. + \verbatim + OptimisationSwitches + { + . + . + // Force dumping and exit (at next timestep) upon signal (-1 to disable) + stopAtWriteNowSignal 12; // SIGUSR2 + . + . + } + \endverbatim SourceFiles sigStopAtWriteNow.C diff --git a/src/OSspecific/POSIX/signals/sigWriteNow.H b/src/OSspecific/POSIX/signals/sigWriteNow.H index e1d97068c5..92ab6f1e91 100644 --- a/src/OSspecific/POSIX/signals/sigWriteNow.H +++ b/src/OSspecific/POSIX/signals/sigWriteNow.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,9 +25,20 @@ Class Foam::sigWriteNow Description - Signal handler for interrupt defined by OptimisationSwitches::writeNowSignal + Signal handler to write when the writeNowSignal is sent. - Write once and continue. + writeNowSignal is set in etc/controlDict::OptimisationSwitches, e.g. + \verbatim + OptimisationSwitches + { + . + . + // Force dumping (at next timestep) upon signal (-1 to disable) + writeNowSignal 10; // SIGUSR1 + . + . + } + \endverbatim SourceFiles sigWriteNow.C