Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow different number of out-of-place args for isinplace #776

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Aug 30, 2024

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

This helps us at https://github.com/SKopecz/PositiveIntegrators.jl

@ChrisRackauckas
Copy link
Member

What's this for?

@ranocha
Copy link
Member Author

ranocha commented Aug 30, 2024

For PositiveIntegrators.jl, we need to partition the ODE right-hand side into (positive) production and (negative) destruction terms. Up to now, we have used two functions for this that can either be in-place (like production!(production_terms, u, p, t)) or out-of-place (like production_terms = production(u, p, t)). Thus, we could use isinplace as it is. To improve the performance of some applications, we want to use a single function with in-place form rhs!(production_terms, destruction_terms, u, p, t) and out-of-place form production_terms, destruction_terms = rhs(u, p, t). With the current version of isinplace, it's hardcoded that the out-of-place form has exactly one argument less than the in-place form. Thus, we cannot use it as it is right now for our new desired dispatches.

@ranocha
Copy link
Member Author

ranocha commented Aug 30, 2024

The downgrade action as well as many integration tests fail already on master

@ranocha
Copy link
Member Author

ranocha commented Sep 1, 2024

Is that something we can support with SciMLBase.jl, @ChrisRackauckas? The only other option we have is to replicate code in PositiveIntegrators.jl.

@ChrisRackauckas ChrisRackauckas merged commit e6b9dca into SciML:master Sep 2, 2024
37 of 43 checks passed
@ranocha ranocha deleted the hr/isinplace branch September 2, 2024 16:04
@ranocha
Copy link
Member Author

ranocha commented Sep 2, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants