Menu

#23 Customization of dmtcp exit codes

open
nobody
2013-09-21
2011-08-25
No

It would be very convenient if dmtcp own exit codes could be customized. dmtcp_checkpoint and dmtcp_restart seem to return the application's exit code upon termination, which is excellent. However, when dmtcp_restart fails, e.g., because a file has to be removed manually, it returns with exit code 1. Most applications already use exit code 1, so it is not possible to distinguish a dmtcp exit code from an application exit code to take appropriate action without parsing the error message.
Hence, it would be nice if dmtcp's exit codes could be set using environment variables.

Discussion

  • Gene Cooperman

    Gene Cooperman - 2011-08-25

    That's an excellent point.

    The default DMTCP exit code should be some unusual number, such as 999. And of course, we can add an environment variable to set this differently from the default. I'll add that to the svn, and update the man page
    for DMTCP. This will then appear in the next DMTCP release.

    Best wishes,
    - the DMTCP team

     
  • Gene Cooperman

    Gene Cooperman - 2011-08-25

    P.S.: That should be a default of 99, not 999. Also, we may implement this as a "configure" option, ./configure --with-dmtcp-fail-return-code=NUM [ default: NUM=99]

     
  • Geert Jan Bex

    Geert Jan Bex - 2011-08-29

    Although using a oonfigure option is easier to implement as well as more robust, an environment variable is more generic. Although there are probably very few applications that have 99 as an exit code, I'm pretty sure I'll find one when I scan all software running on our HPC cluster. Using an environment variable (with a sensible default, such as, indeed, 99) enables the user to pick an appropriate exit code, rather than the administrator.

     
  • Nobody/Anonymous

    In the end, we did indeed decide for an environment variable. It's now in the latest svn, and will be part of the next DMTCP release. If you want to try it out, DMTCP_FAIL_RC is the environment variable to specify. Otherwise, DMTCP returns 99 on failure by DMTCP itself.

     
  • Gene Cooperman

    Gene Cooperman - 2011-09-02
    • status: open --> closed
     
  • Gene Cooperman

    Gene Cooperman - 2011-09-02

    P.S. ... and the last comment was also from gdc0.
    Best wishes,
    - the DMTCP developers

     
  • Gene Cooperman

    Gene Cooperman - 2011-09-02
    • status: closed --> open
     
  • Kapil Arya

    Kapil Arya - 2013-09-21

    Ticket moved from /p/dmtcp/feature-requests/1/

     

Log in to post a comment.