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

Redundant reports issued by multi-threaded Security Analysis #1167

Open
Meklo opened this issue Jan 8, 2025 · 0 comments
Open

Redundant reports issued by multi-threaded Security Analysis #1167

Meklo opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Meklo
Copy link

Meklo commented Jan 8, 2025

Describe the current behavior

In AbstractSecurityAnalysis::runSync if the process is multi-threaded it results in redundant reports created through Reports::createDetailedSolverReporter, Reports::createNetworkInfoReporter and Reports::createPreContingencySimulation
because a network is loaded for each thread.
For example when running on 4 threads it gives the results pasted in Relevant Log Output section (data extracted from running OpenSecurityAnalysisTest::reportTest)

Describe the expected behavior

Reports generation shouldn't be affected by the configured number of threads. Ideally the result should match the content of https://github.com/powsybl/powsybl-open-loadflow/blob/main/src/test/resources/saReport.txt when running OpenSecurityAnalysisTest::reportTest on a multi-threaded process

Describe the steps

-Configure OpenSecurityAnalysisParameters's threadCount or set THREAD_COUNT_DEFAULT_VALUE to a value superior to one
-Run a Security Analysis
-Check the content of the resulting ReportNode

Environment

No response

Relevant Log Output

  • Test security analysis report
    • AC security analysis on network 'sim1'
      • Network CC0 SC0
        • Network info
          Network has 4 buses and 4 branches
          Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
          Angle reference bus: VLHV1_0
          Slack bus: VLHV1_0
        • Pre-contingency simulation
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (-1.4404045651219555 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
        • Post-contingency simulation 'NHV1_NHV2_1'
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (5.803741102800952 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
      • Network CC0 SC0
        • Network info
          Network has 4 buses and 4 branches
          Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
          Angle reference bus: VLHV1_0
          Slack bus: VLHV1_0
        • Pre-contingency simulation
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (-1.4404045651219555 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
        • Post-contingency simulation 'NHV1_NHV2_2'
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (5.803741102800952 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
      • Network CC0 SC0
        • Network info
          Network has 4 buses and 4 branches
          Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
          Angle reference bus: VLHV1_0
          Slack bus: VLHV1_0
        • Pre-contingency simulation
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (-1.4404045651219555 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
        • Post-contingency simulation 'NGEN_NHV1'
          Network must have at least one bus with generator voltage control enabled
          AC load flow completed with error (solverStatus=SOLVER_FAILED, outerloopStatus=STABLE)
      • Network CC0 SC0
        • Network info
          Network has 4 buses and 4 branches
          Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
          Angle reference bus: VLHV1_0
          Slack bus: VLHV1_0
        • Pre-contingency simulation
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (-1.4404045651219555 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
        • Post-contingency simulation 'NHV2_NLOAD'
          • Outer loop DistributedSlack
            • Outer loop iteration 1
              Slack bus active power (-5.4942194604343655 MW) distributed in 1 distribution iteration(s)
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              Outer loop DistributedSlack
              Outer loop VoltageMonitoring
              Outer loop ReactiveLimits
              AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)

Extra Information

Here's a patch of a fix I did on my side, it consists in reconciling the report content afterward but I'm not sure if this is the right approach, feel free to reuse it if it may help
factorize_multi-threaded_security_analysis_imports.zip

@Meklo Meklo added the bug Something isn't working label Jan 8, 2025
@vidaldid-rte vidaldid-rte self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants