MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
239 stars 319 forks source link

Introduce framework routine `mpas_framework_report_settings` for reporting compile-time options and run-time settings #1163

Closed mgduda closed 5 months ago

mgduda commented 5 months ago

This PR introduces a new framework routine, mpas_framework_report_settings, that reports compile-time options and run-time settings to the log file. For example, the following is written by the routine when MPAS is compiled with the nvhpc build target with OPENACC=true:

 Output from 'git describe --dirty': v8.1.0-dirty

 Compile-time options:
   Build target: nvhpc
   OpenMP support: no
   OpenACC support: yes
   Default real precision: single
   Compiler flags: optimize
   I/O layer: SMIOL

 Run-time settings:
   MPI task count: 4

The output is core-independent, and any core can therefore invoke the mpas_framework_report_settings, for example, in its setup_log routine.

As part of this PR, a call to mpas_framework_report_settings has been added to the test core's test_setup_log routine, and copy-and-paste code for writing the same compile-time option and run-time setting information in the init_atmosphere and atmosphere cores has been replaced with calls to mpas_framework_report_settings.