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

Speed up initialization of boundary conditions onto the grid #85

Open
2 of 4 tasks
lmh91 opened this issue Oct 30, 2020 · 0 comments
Open
2 of 4 tasks

Speed up initialization of boundary conditions onto the grid #85

lmh91 opened this issue Oct 30, 2020 · 0 comments
Assignees
Labels
performance Performance improvements
Milestone

Comments

@lmh91
Copy link
Collaborator

lmh91 commented Oct 30, 2020

Before the electric potential is calculated via SOR, the initial boundary conditions are applied onto the grid
and some constant weights (needed in the SOR) are precalculated. This also happens after each grid refinement.

If there are many objects in the world, e.g. highly pixelated detectors, and the grid becomes finer and finer,
these precalculations actually can take quite some time.

There are some ways to improve this:

  • Get rid of unnecessary point conversions
    The time critical part is the lookup to which object each individual point belongs: the in-method.
    Right now, we only parse the grid point in form of the coordinate system of the world, e.g. cylindrical coordinates, to this method. Depending on the geometry of the object, the parsed point might be converted into the other coordinate system, e.g. cartesian. And this several times. We should do this just once and parse the point in both forms to the in methods.

  • Parallize (Improve application of boundary conditions #206)
    Right now, no multithreading is used here.
    But the loop running over the grid points can be parallized.

  • Remove allocations in in method for larger CSG's
    See Allocations in pt in CSG for large CSG's #207

  • Clustering of objects
    Divide the grid in subgrids and add an external additinal loop running over those subgrids (in parallel).
    But before executing this loop, all objects should be assigned to all subgrids in which they might be located.
    Thus, in each subgrid there are less objects to be checked reducing the calls of in.
    This might also be used in order to speed up the charge drift.

@lmh91 lmh91 added the performance Performance improvements label Oct 30, 2020
@fhagemann fhagemann added this to the v0.8.0 milestone Oct 16, 2021
@lmh91 lmh91 modified the milestones: v0.8.0, v1.0.0 Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance improvements
Projects
None yet
Development

No branches or pull requests

2 participants