Cactus should exit with a nonzero exit code if an error occurs

Create issue
Issue #1689 closed
Ian Hinder created an issue

In WarnLevel.c, in CCTK_VWarn (called by CCTK_Warn), it says

if (level <= error_level) { CCTK_Abort (NULL, 0); }

The second argument to CCTK_Abort is the exit code of the process. So if there is an "error" warning, the process exits with 0 exit code; i.e. success! This happens in several places in this file.

The user guide does not say anything about the exit code of Cactus. I think that if Cactus has a level-0 warning, i.e. an error, then it should exit with a non-zero exit code, and Erik agrees.



Comments (5)

  1. Frank Löffler
    • removed comment

    Fine with me too. Related: even if Cactus exits with non-zero, this might not be handed correctly down to the runscript. We should think about letting Cactus indicate a successful exit by writing a special file. Any crash or other unsuccessful exit would not generate this file, and it would be easy to check for the existence of that file - easier than for an exit code, routed through mpirun and possibly other helper scripts on various machines.

  2. Ian Hinder reporter
    • changed status to open
    • marked as
    • removed comment

    Setting priority to major due to potential impact on the test system, and causing tests to appear to have passed when in fact there were fatal errors.

  3. Ian Hinder reporter
    • changed status to resolved
    • removed comment

    Implemented in 1cde3115. Note that CCTK_Abort ignores this if asserts are enabled, as it just triggers an assert, so this change should have no effect on the operation of the system in most cases.

  4. Log in to comment