Skip to content

'Reading <host/scheme> metadata' logging message repeated twice when capgen-v1 called from CAM-SIMA #781

Description

@nusbaume

Description

when capgen-v1 is run it writes the messages Reading host metadata: and Reading scheme metadata: to the logger, which itself goes to stdout. For most of the routines in capgen-v1 it checks if the caller is providing its own python log, and then uses that to write messages. However, for the _load_metadata_files() routine it only uses the internal _LOGGER variable, which in the case of CAM-SIMA was pointing to the same stream as CIME's logger, resulting in the Reading XYZ metadata messages being written twice each time.

This bug can be fixed by simply updating _load_metadata_files to use a host-provided logger when it exists, which is the same strategy that other capgen-v1 routines use.

A PR is incoming.

Steps to Reproduce

  1. Use the head of the feature/capgen-v1 branch (e.g. hash 09ae1d7) in CAM-SIMA.
  2. Create a case with any physics suite.
  3. Run case.setup in the case directory.
  4. Run preview_namelists in the case directory, which triggers the code generation step for capgen-v1
  5. Examine the messages being printed to the screen, and notice the ones that are being repeated twice each time.

Additional Context

I am guessing this issue is only present when using CAM-SIMA as it would only appear when using the python interface. The CLI is likely fine.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor issues describing bugs, or PRs fixing bugs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions