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

Improve patpass #515

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Improve patpass #515

merged 1 commit into from
Nov 16, 2022

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Nov 14, 2022

patpass provides parallel tracking using python multiprocessing. Up to now, patpass spawns one process per particle to be tracked. This is not optimal since it usually needs much more processes than available in the process pool. The processes are kept waiting until one slot in the process pool is available. So there is a large overhead in starting many processes and gathering the results.

Here we split the input of particle coordinates in as many slices as available processes in the pool, and then start one process per slice. The number of processes is equal to the number of possible parallel processes.

the output formatting is also simplified.

This will simplify the handling of random number generators.

@lfarv lfarv added enhancement Python For python AT code labels Nov 14, 2022
Copy link
Contributor

@swhite2401 swhite2401 left a comment

Choose a reason for hiding this comment

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

Looks ok to me, did you compute the speedup?

@lfarv
Copy link
Contributor Author

lfarv commented Nov 14, 2022

did you compute the speedup?

I probably depends on the number of particles, platform… One example:
MacOS, poolsize 4, 500 particles, 1000 turns of hmba: 5.5s instead of 6s, so ~10% improvement.

@swhite2401
Copy link
Contributor

I probably depends on the number of particles, platform… One example:
MacOS, poolsize 4, 500 particles, 1000 turns of hmba: 5.5s instead of 6s, so ~10% improvement.

Ah ok so not so huge, all good for for me!

@lfarv lfarv merged commit c20694c into master Nov 16, 2022
@lfarv lfarv deleted the improve_patpass branch November 16, 2022 13:40
@lfarv lfarv mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants