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

Add basic MPI logging capabilities #100

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Add basic MPI logging capabilities #100

merged 1 commit into from
Jan 9, 2025

Conversation

nefrathenrici
Copy link
Member

@nefrathenrici nefrathenrici commented Dec 21, 2024

This PR implements two loggers using LoggingExtras.jl. These loggers do not change the ClimaComms API.

  • MPILogger(ctx, iostream = stdout): This adds a ClimaComms PID prefix in front of each log message, for example [P1] Info: smoke test
  • MPIFileLogger(ctx, log_dir): Log MPI ranks to different files within the log_dir.

A few questions

  • Should we have a default logger constructor depending on the context? Should the MPILogger only be used if MPI is initialized?
  • What should the minimal compat be for Logging? It could be set higher

Copy link
Member

@charleskawczynski charleskawczynski left a comment

Choose a reason for hiding this comment

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

I do like the idea of some of these helpers, but I think the optional contexts introduces some risk.

Also, the macros look risky to me, partly for the same reason (what is the default? will it match what the user has if it's different?). The macros are a bit difficult to extend, I'm not sure they're buying us anything useful other than hiding conditionals

@nefrathenrici
Copy link
Member Author

Thanks for the feedback, I removed the root macros/loggers and made the comms context the first argument for both remaining loggers:

  • MPIFileLogger(ctx, log_dir)
  • MPILogger(ctx, iostream = stdout)

src/logging.jl Outdated Show resolved Hide resolved
@charleskawczynski charleskawczynski merged commit 0b580b7 into main Jan 9, 2025
6 checks passed
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.

2 participants