Skip to content

MATLAB's outofprocess mode has massive overhead #2034

@ischoegl

Description

@ischoegl

Problem description

While the outofprocess mode introduced in #1868 resolves #1852, it comes at the cost of massive overhead due to repeated allocation/copying of arrays, see #1997 (comment). The migration to the generated CLib in #1997 may resolve crashes reported in #1852 when using LD_PRELOAD.

Behavior

After #1868, the Cantera toolbox defaults to outofprocess regardless of operating system. The MATLAB samples ignite.m, ignite_uv.m, ignite_hp.m and plug_flow_reactor.m have extreme performance penalties as they rely on integration with MATLAB's ode15s solver, and only use Cantera for the evaluation of properties and kinetics. Recent testing in #1974 showed runtimes for plug_flow_reactor.m on Windows of around 30 minutes (!). PS: With some of the problematic examples disabled, Windows runners are significantly slower than macOS and Linux actions.

System information

  • Cantera version: 3.2.0b1
  • OS: any (but more pronounced on Windows)
  • Python/MATLAB/other software versions: MATLAB 2025a

Additional context

I opened this issue to document previously reported behavior. Tagging @ssun30 and @rwest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions