Skip to content

Avoid redundant ThreadMap construction for multi-node continuity penalties #1101

Description

@mickaelbegon

Problem

For multi-threaded direct-collocation OCPs, continuity penalties may build repeated ThreadMap wrappers during penalty preparation even though threaded dispatch consumes the representative mapped function only.

Proposed change

For multi-threaded STATE_CONTINUITY penalties whose node range begins at zero, construct the mapped function and mapped weighted function only for the representative node. Keep the regular per-node non-threaded functions and preserve current behavior for other penalty types.

Acceptance criteria

  • unchanged objective, constraints, Jacobian and Hessian on a collocation OCP;
  • unchanged IPOPT trajectory;
  • regression test that redundant wrappers are not created;
  • no persistent cache, avoiding graph invalidation risks.

A downstream minimal fix and tests are being prepared for a future pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions