Skip to content

Change log levels for post-contingency and action messages in Fast DC Security Analysis#1222

Merged
jeandemanged merged 10 commits intomainfrom
debug-log-level-in-fast-dc-sa
Apr 18, 2025
Merged

Change log levels for post-contingency and action messages in Fast DC Security Analysis#1222
jeandemanged merged 10 commits intomainfrom
debug-log-level-in-fast-dc-sa

Conversation

@p-arvy
Copy link
Copy Markdown
Member

@p-arvy p-arvy commented Apr 11, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

No, but the development is based on the collaborative work of #1169, aiming to improve the performance of the fast DC SA.

What kind of change does this PR introduce?

In default and fast DC security analyses, the logs indicating the start and end of a post-contingency or post-operator strategy simulation are at the INFO level. For the fast DC SA, these logs are changed to the DEBUG level.

What is the current behavior?

Currently, the logs are displayed via method calls defined in the AbstractSecurityAnalysis class, which log at the INFO level. This represents about 5% of the CPU time for a fast DC SA run, and slows down the total execution time.
2-per-cent-log
3-per-cent-log

Since the computation cost is roughly the same for all contingencies in fast DC SA, these logs should be displayed at a higher level of detail.

What is the new behavior (if this is a feature change)?

The logging methods in the AbstractSecurityAnalysis class have been modified so that the log level is configurable. In the fast DC SA, the log level is now set to DEBUG, which makes the logs cleaner and improves performances.

The DEBUG level was chosen to keep the logs consistent with those related to active power distribution, when overriding pre-contingency states in the fast DC SA (the following logs are from the unit test WoodburyDcSecurityAnalysisWithActionsTest.testSaDcPhaseTapChangerTapPositionChangeWithConnectivityBreak).

image

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

To enable the display of detailed logs for post-contingency and post-operator strategy simulations in fast DC Security Analysis, you can set the com.powsybl.openloadflow.sa.AbstractSecurityAnalysis logger to DEBUG in your logging configuration file. For better performance, it is recommended to avoid enabling these logs. It should be used only when needed for debugging or detailed analysis.

Other information:

p-arvy added 5 commits April 11, 2025 12:43
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
@p-arvy p-arvy requested a review from Hadrien-Godard April 11, 2025 13:35
@p-arvy p-arvy changed the title Change logs level in Fast DC Security Analysis for DEBUG level Change level of post-contingency and action logs in Fast DC Security Analysis Apr 11, 2025
Hadrien-Godard
Hadrien-Godard previously approved these changes Apr 11, 2025
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Hadrien-Godard
Hadrien-Godard previously approved these changes Apr 11, 2025
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Comment thread docs/security/parameters.md Outdated
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
@jeandemanged jeandemanged changed the title Change level of post-contingency and action logs in Fast DC Security Analysis Change log levels for post-contingency and action messages in Fast DC Security Analysis Apr 18, 2025
@sonarqubecloud
Copy link
Copy Markdown

@jeandemanged jeandemanged merged commit dea6673 into main Apr 18, 2025
8 checks passed
@jeandemanged jeandemanged deleted the debug-log-level-in-fast-dc-sa branch April 18, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants