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

Only allocate real-space arrays when output is requested. #655

Merged

Conversation

quantumsteve
Copy link
Collaborator

@quantumsteve quantumsteve commented Dec 13, 2023

Please review the developer documentation
on the wiki of this project that contains help and requirements.

Proposed changes

Describe what this PR changes and why. If it closes an issue, link to it here
with a supported keyword.

The size of real-space arrays may be larger than INT_MAX, causing an assertion error. Since these arrays are for an optional output, when it isn't needed we can just set their size to zero.

I also promoted the variable in dense_space_size to int64_t and check its size before returning.

This fixes #654

What type(s) of changes does this code introduce?

Put an x in the boxes that apply.

  • Bugfix
  • New feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Does this introduce a breaking change?

  • Yes
  • No

What systems has this change been tested on?

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.

  • this PR is up to date with current the current state of 'develop'
  • code added or changed in the PR has been clang-formatted
  • this PR adds tests to cover any new code, or to catch a bug that is being fixed
  • documentation has been added (if appropriate)

src/main.cpp Outdated Show resolved Hide resolved
Signed-off-by: Steven Hahn <[email protected]>
Copy link
Contributor

@stefan-schnake stefan-schnake left a comment

Choose a reason for hiding this comment

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

We should consider removing the real_space features. It's not reasonable that you would want full phase space data. Maybe when the PDE rewrite is finished we could turn this into functionally that plots certain moments.

@quantumsteve quantumsteve merged commit 5bc1646 into project-asgard:develop Dec 13, 2023
1 check passed
@quantumsteve quantumsteve deleted the skip_realspace_output branch December 13, 2023 18:30
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.

Overflow Error
3 participants