Skip to content

Conversation

@vidaldid-rte
Copy link
Collaborator

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

What kind of change does this PR introduce?
Support multithreading for AC Sensitivity analysis

What is the current behavior?
AC sensnsitivity analysis can only be computed in single threaded mode

What is the new behavior (if this is a feature change)?
a sensitivity analysis param is added: thredaCount
If set with value higher than 1, contingencies are partionned with one partition per thread.
Each thread computes the SA for its partition.

Results are consolidated. It is not visible that they are run in MT unless you stream with the sensi writer and see them apperaing in an unordered way.

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

  • Yes
  • No

@vidaldid-rte vidaldid-rte changed the title [WIP] Support multithreading for AC sensitivity analysis #1287 [WIP] Support multithreading for AC sensitivity analysis Oct 9, 2025
@vidaldid-rte vidaldid-rte force-pushed the feature/sensi_mt branch 2 times, most recently from be51bc9 to c52497a Compare October 9, 2025 15:29
@alicecaron alicecaron moved this from TODO to In Progress in Release 12/2025 Oct 10, 2025
Signed-off-by: Didier Vidal <[email protected]>
Signed-off-by: Didier Vidal <[email protected]>
Signed-off-by: Didier Vidal <[email protected]>
@vidaldid-rte vidaldid-rte changed the title [WIP] Support multithreading for AC sensitivity analysis Support multithreading for AC sensitivity analysis Oct 16, 2025
@sonarqubecloud

This comment was marked as outdated.

vidaldid-rte and others added 3 commits December 2, 2025 15:27

// create networks including all necessary switches
lfNetworks = Networks.load(network, parameters.getNetworkParameters(), partitionTopoConfig, threadRootNode);
lfNetworksList.add(0, lfNetworks); // FIXME to workaround variant removal bug, to fix in core
Copy link
Member

@SylvestreSakti SylvestreSakti Dec 2, 2025

Choose a reason for hiding this comment

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

It was already like this before, but what is the reason to add at index 0 ? (which can be renamed addFirst())

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe the mytserious FIXME comment ?
I decided to be disciplined and keep the same thing to focus this PR on adding MT support to AC sensi.

Given that it is something odd, I would prefer to keep shocking Sonar and use this add API.

Copy link
Member

Choose a reason for hiding this comment

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

Outch I confirm, there was a bug in the network variant management (an error was throw, so something very explicit), but I don't remenber having fixed it in powsybl core... So I guess the bug is still there. Maybe to test again and to try creating a test case on core side ?

@github-project-automation github-project-automation bot moved this from In Progress to Approved in Release 12/2025 Dec 3, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

@SylvestreSakti SylvestreSakti merged commit b80402b into main Dec 4, 2025
8 checks passed
@SylvestreSakti SylvestreSakti deleted the feature/sensi_mt branch December 4, 2025 14:35
@github-project-automation github-project-automation bot moved this from Approved to Done in Release 12/2025 Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants