Skip to content

[BUG] Kinsol always calls KINPrintInfo due to inexistent preprocessor define SUNDIALS_LOGLEVEL_INFO #801

@RobertTrieblAVL

Description

@RobertTrieblAVL

Current Behavior:

I experienced performance loss between Kinsol v5.3.0 and Kinsol v7.3.0. Profiling revealed that KINPrintInfo consumes 4% of computation time. This came as a surprise since default builds use define SUNDIALS_LOGGING_LEVEL = 2 which does not include info level message as per the documentation.

Looking at the Kinsol code, I see that the KINPrintInfo should only be called depending on a preprocessor define:
#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO

The problem is that SUNDIALS_LOGLEVEL_INFO is defined nowhere (in an IDE this can be seen since the code is not greyed out for the build). Other solvers use the preprocessor define SUNDIALS_LOGGING_INFO which has the value 3 and thus KINPrintInfo would never be called for a standard build.

This affects files kinsol.c and kinsol_ls.c.

Expected Behavior:

A standard build with SUNDIALS_LOGGING_LEVEL = 2 should not call KINPrintInfo.

Environment:

  • SUNDIALS version: 7.3.0
    Independent of OS and Compiler.

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions