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

TinyProfiler:: Add more runtime parameters #4100

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Docs/sphinx_documentation/source/RuntimeParameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1204,3 +1204,35 @@ enabled.
which are unnecessary for correctness, could potentially degrade the
performance.

.. py:data:: tiny_profiler.enabled
:type: bool
:value: true

.. versionadded:: 24.09
Runtime parameter `tiny_profiler.enabled``.

This parameter can be used to disable tiny profiling including
:cpp:`CArena` memory profiling at run time.

.. py:data:: tiny_profiler.memprof_enabled
:type: bool
:value: true

.. versionadded:: 24.09
Runtime parameter ``tiny_profiler.memprof_enabled``.

This parameter can be used to disable :cpp:`CArena` memory profiling at
run time. If ``tiny_profiler.enabled`` is false, this parameter has no
effects.

.. py:data:: tiny_profiler.output_file
:type: string
:value: [empty]

.. versionadded:: 24.09
Runtime parameter ``tiny_profiler.output_file``.

If this parameter is empty, the output of tiny profiling is dumped on the
default out stream of AMReX. If it's not empty, it specifies the file
name for the output. Note that ``/dev/null`` is a special name that mean
a null file.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe that means no output.?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will add that to the TinyProfiler::flush PR I am preparing.

8 changes: 6 additions & 2 deletions Src/Base/AMReX_TinyProfiler.H
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,15 @@ private:
static int n_print_tabs;
static int verbose;
static double print_threshold;
static bool enabled;
static bool memprof_enabled;
static std::string output_file;

static void PrintStats (std::map<std::string,Stats>& regstats, double dt_max);
static void PrintStats (std::map<std::string,Stats>& regstats, double dt_max,
std::ostream* os);
static void PrintMemStats (std::map<std::string, MemStat>& memstats,
std::string const& memname, double dt_max,
double t_final);
double t_final, std::ostream* os);
};

class TinyProfileRegion
Expand Down
Loading
Loading