Skip to content

Teuchos: TimeMonitor::report to YAML prints on each MPI process #14606

@ppraegla

Description

@ppraegla

Bug Report

@bartlettroscoe

Description

Using TimeMonitor:.report with output to YAML, writes the output on each MPI process. Using the Report format: Table writes correctly only on rank 0. The YAML output should also be only written once, i.e., on rank 0.

There seems to be an if (myRank == 0) missing when writing to the output stream. It may also be that the YAML and table report are different #1917. I have not looked into that

Steps to Reproduce

  1. SHA1: d8f7113
  2. Write TimeMonitor report
Teuchos::ParameterList params_report;
params_report.set("Report format", "YAML");
Teuchos::TimeMonitor::report(std::cout, Teuchos::rcpFromRef(params_report));
  1. Output
Output report format YAML

# Teuchos::TimeMonitor report
---
Output mode: spacious
Number of processes: 2
Time unit: s
Statistics collected: 
  - MinOverProcs
  - MeanOverProcs
  - MaxOverProcs
  - MeanOverCallCounts
Timer names: 
  - fun
Total times: 
  fun: 
    MinOverProcs: 1.8344e-05
    MeanOverProcs: 1.91755e-05
    MaxOverProcs: 2.0007e-05
    MeanOverCallCounts: 9.58775e-06
Call counts:
  fun: 
    MinOverProcs: 2
    MeanOverProcs: 2
    MaxOverProcs: 2
    MeanOverCallCounts: 2
# Teuchos::TimeMonitor report
---
Output mode: spacious
Number of processes: 2
Time unit: s
Statistics collected: 
  - MinOverProcs
  - MeanOverProcs
  - MaxOverProcs
  - MeanOverCallCounts
Timer names: 
  - fun
Total times: 
  fun: 
    MinOverProcs: 1.8344e-05
    MeanOverProcs: 1.91755e-05
    MaxOverProcs: 2.0007e-05
    MeanOverCallCounts: 9.58775e-06
Call counts:
  fun: 
    MinOverProcs: 2
    MeanOverProcs: 2
    MaxOverProcs: 2
    MeanOverCallCounts: 2

Output report format Table

=======================================================================================

                         TimeMonitor results over 2 processors

Timer Name    MinOverProcs     MeanOverProcs    MaxOverProcs     MeanOverCallCounts    
---------------------------------------------------------------------------------------
fun           2.808e-05 (2)    2.901e-05 (2)    2.994e-05 (2)    1.45e-05 (2)          
=======================================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugThe primary issue is a bug in Trilinos code or tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions