Skip to content

Parallelise investment step #1101

@alexdewar

Description

@alexdewar

Currently we don't have any parallel code, which keeps things simple, though we are leaving some performance on the floor, particularly for larger models.

Much of the investment code could be easily parallelised. The usual library for doing this in Rust is rayon, which provides convenient interfaces for parallel for loops etc. You can nest these parallel for loops and the jobs will be divided between cores appropriately.

Considerations:

  • If we are sharing data structures between threads, we might need to change to variants which allow this in some places (e.g. Arc rather than Rc)
  • As HiGHS already runs in parallel, with the number of threads set to the number of CPU cores by default, we may want to constrain this (this might take experimentation). At the very least, we should constraint it to rayon::current_num_threads().

We should find a big model (preferably a realistic one) to benchmark the code with before and after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions