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

Sk/update basic examples and docstrings #96

Merged
merged 17 commits into from
Jul 15, 2024

Conversation

SKopecz
Copy link
Owner

@SKopecz SKopecz commented Jul 11, 2024

This is to take care of #7.

@SKopecz SKopecz marked this pull request as draft July 11, 2024 14:49
@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.32%. Comparing base (2389d44) to head (c37dbba).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #96   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files           6        6           
  Lines        1250     1250           
=======================================
  Hits         1229     1229           
  Misses         21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SKopecz SKopecz linked an issue Jul 11, 2024 that may be closed by this pull request
9 tasks
@SKopecz
Copy link
Owner Author

SKopecz commented Jul 11, 2024

I have some issues regarding PDSProblem. See https://github.com/SKopecz/PositiveIntegrators.jl/blob/2389d44d8037e2d3a2c1ba0d3be67a179dfd3569/src/proddest.jl#L7C24-L7C45.

  1. I don't see why we need d_prototype in PDSProblems. D will always be a vector with the same floating point type as P. Or are there other reasonable choices?
  2. The docu says "If P is given in in-place form, p_prototype is used to store evaluations of P". This is true for PDSFunctions, but these are only used internally and not documented. Users might think that p_prototype is used to store evaluations of P inside an algorithm like MPE() while solving a PDS. But this is not the case. All algorithms allocate new memory using something like P=zero(f.p_prototype).
  3. Would it be a good idea to actually use f.p_prototype to store evaluations of P inside the algorithms?

@SKopecz SKopecz requested a review from ranocha July 11, 2024 15:41
Copy link
Collaborator

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks a lot for initiating this!

docs/make.jl Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
@ranocha
Copy link
Collaborator

ranocha commented Jul 13, 2024

  1. I don't see why we need d_prototype in PDSProblems. D will always be a vector with the same floating point type as P. Or are there other reasonable choices?

Maybe someone wants to use a SparseVector (from SparseArrays) or some custom struct encoding sparsity? Or we may want to have the flexibility to run on GPUs in the future?

  1. The docu says "If P is given in in-place form, p_prototype is used to store evaluations of P". This is true for PDSFunctions, but these are only used internally and not documented. Users might think that p_prototype is used to store evaluations of P inside an algorithm like MPE() while solving a PDS. But this is not the case. All algorithms allocate new memory using something like P=zero(f.p_prototype).

Maybe we should write "p_prototype or copies thereof are used to store evaluations of P" to clarify this aspect?

  1. Would it be a good idea to actually use f.p_prototype to store evaluations of P inside the algorithms?

I don't think so. Right now, it is possible to solve the same problem concurrently using different time integration methods. If we overwrite some memory of the problem, this is not possible anymore.

@SKopecz
Copy link
Owner Author

SKopecz commented Jul 15, 2024

I created #97 for the implementation of d_prototype in PDSProblems.

@SKopecz
Copy link
Owner Author

SKopecz commented Jul 15, 2024

I created #98 to improve the efficiency of sparse matrices.

Copy link
Collaborator

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks!

I would be fine merging this PR even before implementing the more advanced sparse matrix optimizations. In the end, the goal is clear and we can built on top of what you have added here.

docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
docs/src/linear_advection.md Outdated Show resolved Hide resolved
@SKopecz SKopecz marked this pull request as ready for review July 15, 2024 16:40
@SKopecz SKopecz merged commit 4fdc654 into main Jul 15, 2024
11 checks passed
@SKopecz SKopecz deleted the sk/update_basic_examples_and_docstrings branch July 15, 2024 16:40
```

### Using sparse matrices

TODO: Some text
Copy link
Collaborator

Choose a reason for hiding this comment

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

This TODO note is still open?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I thought we take care of this once the sparse matrices work as expected.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough 👍

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.

Improve documentation
3 participants