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

Support exit codes #4758

Merged
merged 1 commit into from Feb 22, 2023
Merged

Support exit codes #4758

merged 1 commit into from Feb 22, 2023

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Feb 20, 2023

Proposed changes

Define exit code 2 as "program incomplete, continue from checkpoint". This can be used to resubmit the job (working on that).

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@nilsvu nilsvu force-pushed the exit_codes branch 2 times, most recently from 8fc7056 to 499507d Compare February 21, 2023 02:51
* - 2: Program is incomplete and should be continued from the last checkpoint.
*
* \par Design decisions
* - We implement the exit code as an `int` instead of an enum because its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not have the values be hard-coded in an enum and then convert them to an int where we need them to be an int? I worry that the current approach requires us to match something in this documentation block. E.g.

enum class ExitCode : int {
  Complete = 0,
  Abort = 1,
  ContinueFromCheckpoint = 2
};

and then

static_cast<int>(ExitCode::ContinueFromCheckpoint)

If you choose to make the enum not an enum class you can just do an implicit cast.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also prefer using enums in this manner...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done!

Define exit code 2 as "continue from checkpoint".
Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :D

@nilsdeppe nilsdeppe merged commit a84801f into sxs-collaboration:develop Feb 22, 2023
@nilsvu nilsvu deleted the exit_codes branch March 2, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants