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

Silent atpass #421

Merged
merged 5 commits into from
Jun 30, 2022
Merged

Silent atpass #421

merged 5 commits into from
Jun 30, 2022

Conversation

swhite2401
Copy link
Contributor

@swhite2401 swhite2401 commented Jun 23, 2022

By default atpass returns a large array storing all particles at each turn and refpts.
To avoid memory issues it is possible to call atpass with refpts=[], this feature is added to the documentation in this PR

@swhite2401 swhite2401 requested a review from lfarv June 23, 2022 13:19
@lfarv
Copy link
Contributor

lfarv commented Jun 23, 2022

@swhite: there is no need for that: just set refpts = []. No allocation, the values at the end of tracking are in r_in, as usual!

@swhite2401
Copy link
Contributor Author

Are you sure about this?
If I tracking 1e6 particles for 1e6 turns with refpts=[] I thought at would allocates an array with shape (6,1e6,0,1e6) in C and return it.
Instead with this PR (6,1e6,refpts,1) is allocated whatever the input, there is the same in matlab actually.

In fact I crashed the cluster doing something similar...am I missing something?

@swhite2401
Copy link
Contributor Author

Ah no I take it back, atpass returns [] when refpts = []
This is quite unnatural for non experts, I still think it would be worth adding the silent option at least the set refpts=[] at the python level to mimic the matlab inputs...the advantage of this PR is that you can also provide refpts but I am not convinced it is so useful...

@lfarv
Copy link
Contributor

lfarv commented Jun 23, 2022

This is quite unnatural for non experts

Why? refpts=[] to get no output looks on the contrary very natural to me ! More than an additional keyword !

The problem with Matlab is that you cannot modify in-place the input argument. There in no problem in python, so all the tracking is done in-place, without needing to allocate anything.

@swhite2401
Copy link
Contributor Author

Ok fair enough, I'll roll back and update the documentation in this PR to make this clear

@swhite2401
Copy link
Contributor Author

Ok, this is now just a documentation update, anything to add while we are at it?


.. note::

* For multiparticle tracking with large number of turn the size of ``r_out``
Copy link
Contributor

Choose a reason for hiding this comment

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

"number of turns", may be ?

@lfarv
Copy link
Contributor

lfarv commented Jun 27, 2022

Ok for me !

@swhite2401
Copy link
Contributor Author

Do I have to build the sphinx documentation or is it done automatically on merge? (sorry I haven't followed very closely your latest developments)

@lfarv
Copy link
Contributor

lfarv commented Jun 28, 2022

Do I have to build the sphinx documentation or is it done automatically on merge? (sorry I haven't followed very closely your latest developments)

Nothing to do: the doc will be updated on merge. Magic !

@swhite2401 swhite2401 merged commit b05964e into master Jun 30, 2022
@swhite2401 swhite2401 deleted the silent_atpass branch June 30, 2022 12:00
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.

None yet

2 participants