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

Consolidating logging and error handling in CABLE #486

Open
SeanBryan51 opened this issue Nov 25, 2024 · 1 comment
Open

Consolidating logging and error handling in CABLE #486

SeanBryan51 opened this issue Nov 25, 2024 · 1 comment

Comments

@SeanBryan51
Copy link
Collaborator

Currently, CABLE is inconsistent in how the program is aborted or STOPed throughout the code base. For example, when using an MPI build, STOP should be replaced with a call to MPI_Abort (via mpi_grp_abort) and there is also an abort subroutine defined in cable_abort_module which is sometimes used. It would be nice if these approaches were consolidated across the codebase (also potentially for use in the coupled model).

A nice (but maybe naive) approach would be to use the existing abort functionality to encapsulate the abort logic however this will probably depend on some state in the top level scope (e.g. the current MPI rank or the total number of MPI ranks). Passing this state information as an argument to abort seems like it will be a bit burdensome to pass throughout the entire code base. A better approach could be to instantiate a singleton logging object to handle the logging and abort behaviour.

This also raises questions on how we want do error handling and logging in general (also in a coupled model context noting that CABLE maybe built as a library in the future). It would be good to have an idea of the key requirements for a consolidated logging and error handling framework for CABLE.

@SeanBryan51
Copy link
Collaborator Author

SeanBryan51 commented Nov 27, 2024

Requirements:

  • Runtime switch which controls: 1. writing logs only to the log file or 2. writing logs only to standard output/error or 3. writing logs both to the log file and standard output/error
  • Runtime switch which controls the amount of logging for different severity/verbosity levels.

Potentially relevant:

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

No branches or pull requests

1 participant