Skip to content

Conversation

@stv0g
Copy link
Contributor

@stv0g stv0g commented Jun 12, 2025

This PR is adding a new node-type for improving the interface between VILLASnode and OPAL-RT software platforms using OPAL-RT Orchestra Co-simulation framework.

We are using this new node-type both in the ENSURE and SEGuRo projects.

See:

@stv0g stv0g requested review from al3xa23 and fwege June 12, 2025 11:09
@stv0g stv0g self-assigned this Jun 12, 2025
@stv0g stv0g added the enhancement New feature or request label Jun 12, 2025
@stv0g stv0g requested a review from n-eiling as a code owner June 12, 2025 11:09
return *reinterpret_cast<const double *>(orchestraData);

default:
throw RuntimeError("Orchestra signal type {} is not supported",
Copy link
Member

Choose a reason for hiding this comment

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

Avoid exception

@stv0g stv0g force-pushed the node-opal-orchestra branch from 14c5307 to 8f323f8 Compare June 13, 2025 05:32
Copy link
Contributor

@al3xa23 al3xa23 left a comment

Choose a reason for hiding this comment

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

Hi, nice work. I added some minor comments since I am not yet that familiar with code reviews.
General question: I assume the tests are following in the next PR?

@stv0g stv0g force-pushed the node-opal-orchestra branch from 3989418 to d7d2e08 Compare July 17, 2025 17:18
@stv0g
Copy link
Contributor Author

stv0g commented Jul 17, 2025

Hi @al3xa23,

General question: I assume the tests are following in the next PR?

Good point. I dont think we can test this node-type via an integration test unfortunately, as it depends on an Orchestra framework which is provided by an OPAL-RT real-time simulation model. As this is closed-source software, we can not simply include it into our CI tests.

Do you think this qualifies for an exception?

@al3xa23
Copy link
Contributor

al3xa23 commented Jul 18, 2025

Ah okay, I understand. It is fine from my side :)

@n-eiling
Copy link
Member

Would be interesting to know what the license states specifically. Can we even publish this as open source? If yes, then at least the header needs to be open source as well, right? Or is there some clause specifying terms for use as a library?

@stv0g
Copy link
Contributor Author

stv0g commented Aug 16, 2025

Would be interesting to know what the license states specifically. Can we even publish this as open source? If yes, then at least the header needs to be open source as well, right? Or is there some clause specifying terms for use as a library?

The libOpalOrchestra library and its header which are not licensed under an open-source license. This contribution includes neither the library itself or its header.

It merely uses it by dynamically linking against it.

I do not see an issue here as we are licensing the node-type itself (this contribution) under a permissive OSS license (Apache-2.0).

@stv0g stv0g force-pushed the node-opal-orchestra branch from 5ad58b6 to e6b015a Compare August 18, 2025 13:12
@stv0g
Copy link
Contributor Author

stv0g commented Aug 18, 2025

@n-eiling I have addressed most your comments. I only kept using exceptions for now. Which is something I would like to reconsider and also discuss among other contributors (@pjungkamp, @windrad6).

Are you fine with the changes so far (ignoring the exceptions for now)?

@stv0g stv0g requested a review from n-eiling August 18, 2025 13:14
@stv0g
Copy link
Contributor Author

stv0g commented Aug 18, 2025

@al3xa23 Would you mind doing another round of review, and/or approving the PR if you are fine with it?

@pjungkamp
Copy link
Contributor

Just a small nitpick from my side. You're using std::map which requires all entries to be sorted by the key when iterating. This leads most implementations to implement this as e.g. a red-black tree. See https://en.cppreference.com/w/cpp/container/map.html.

I'd prefer to see at least a std::unordered_map here, which is a hash table, since you don't seem to rely on the key ordering in std::map. See https://en.cppreference.com/w/cpp/container/unordered_map.html.

The tree structure of std::map leads to memory access patterns that are hostile to CPU caches for almost everything from lookup to traversal and should almost never be used.

@pjungkamp
Copy link
Contributor

And another nitpick.

Please don't use const std::string & in new code. This much better served by either a plain std::string if you intend to store it somewhere (e.g. in constructors) or by a std::string_view if you're just inspecting/viewing it but don't want to own it.


example

class SomeItem {
private:
  std::string some_string;

public:
  explicit SomeItem(std::string some_string) : some_string(std::move(some_string)) {}
}

@stv0g stv0g force-pushed the node-opal-orchestra branch 2 times, most recently from 78e2259 to 73d36c9 Compare August 26, 2025 07:06
@stv0g stv0g force-pushed the node-opal-orchestra branch from 73d36c9 to 12b3271 Compare October 28, 2025 16:54
@stv0g stv0g force-pushed the node-opal-orchestra branch from 12b3271 to a996757 Compare October 28, 2025 17:06
stv0g added 5 commits October 28, 2025 19:01
This is required as the standard builds of VILLASnode does not include support for the opal.orchestra node-type

Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
@stv0g stv0g merged commit 54d8fb3 into master Oct 30, 2025
3 checks passed
@stv0g stv0g deleted the node-opal-orchestra branch October 30, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request node::opal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants