Skip to content

Conversation

@AlexanderSinn
Copy link
Member

@AlexanderSinn AlexanderSinn commented Jan 7, 2026

Needed after AMReX-Codes/amrex#4868

Unfortunately, this makes some functions 3-5% slower.

PR

TinyProfiler total time across processes [min...avg...max]: 74.7 ... 74.7 ... 74.7

-------------------------------------------------------------------------------------------------------
Name                                                    NCalls  Excl. Min  Excl. Avg  Excl. Max   Max %
-------------------------------------------------------------------------------------------------------
ExplicitDeposition()                                      1000       18.6       18.6       18.6  24.90%
AdvancePlasmaParticles()                                  1000      15.37      15.37      15.37  20.58%
hpmg::MultiGrid::solve1()                                 1000       14.7       14.7       14.7  19.68%
DepositCurrent_PlasmaParticleContainer()                  1001      14.19      14.19      14.19  19.00%
FFTPoissonSolverDirichletQuick::SolvePoissonEquation()    3000       5.58       5.58       5.58   7.47%
AdvanceBeamParticlesSlice()                               1000      1.711      1.711      1.711   2.29%
Fields::SolvePoissonPsiExmByEypBxEzBz()                   1000      1.157      1.157      1.157   1.55%
Fields::ShiftSlices()                                     1000      1.039      1.039      1.039   1.39%
Fields::InitializeSlices()                                1000     0.8715     0.8715     0.8715   1.17%
Hipace::InitializeSxSyWithBeam()                          1000     0.7412     0.7412     0.7412   0.99%
Fields::AddRhoIons()                                      1000     0.3009     0.3009     0.3009   0.40%
BeamParticleContainer::InitBeamFixedWeightPDFSlice()      1000     0.1495     0.1495     0.1495   0.20%
DepositCurrentSlice_BeamParticleContainer()               2000     0.1167     0.1167     0.1167   0.16%
Hipace::SolveOneSlice()                                   1000    0.03368    0.03368    0.03368   0.05%
PlasmaParticleContainer::InitParticles()                     1    0.02763    0.02763    0.02763   0.04%
MultiBuffer::get_data()                                   1000    0.02632    0.02632    0.02632   0.04%
shiftSlippedParticles()                                    749    0.02392    0.02392    0.02392   0.03%
FFTPoissonSolverDirichletQuick::define()                     1    0.01242    0.01242    0.01242   0.02%
Hipace::ExplicitMGSolveBxBy()                             1000    0.01007    0.01007    0.01007   0.01%
FabArray::setVal()                                           3   0.008716   0.008716   0.008716   0.01%
BeamParticleContainer::resize()                           3749   0.008206   0.008206   0.008206   0.01%
BeamParticleContainer::InitBeamFixedWeightPDF3D()            1   0.003649   0.003649   0.003649   0.00%
Hipace::Evolve()                                             1   0.002835   0.002835   0.002835   0.00%
main()                                                       1   0.002423   0.002423   0.002423   0.00%
MultiBuffer::put_data()                                   1000   0.001919   0.001919   0.001919   0.00%
Hipace::InitData()                                           1  0.0004946  0.0004946  0.0004946   0.00%
Fields::AllocData()                                          1  0.0001953  0.0001953  0.0001953   0.00%
ParticleContainer::clearParticles()                          1    5.8e-07    5.8e-07    5.8e-07   0.00%
-------------------------------------------------------------------------------------------------------

Dev

TinyProfiler total time across processes [min...avg...max]: 72.83 ... 72.83 ... 72.83

-------------------------------------------------------------------------------------------------------
Name                                                    NCalls  Excl. Min  Excl. Avg  Excl. Max   Max %
-------------------------------------------------------------------------------------------------------
ExplicitDeposition()                                      1000      18.59      18.59      18.59  25.53%
AdvancePlasmaParticles()                                  1000      14.59      14.59      14.59  20.03%
hpmg::MultiGrid::solve1()                                 1000      14.27      14.27      14.27  19.60%
DepositCurrent_PlasmaParticleContainer()                  1001      13.63      13.63      13.63  18.72%
FFTPoissonSolverDirichletQuick::SolvePoissonEquation()    3000      5.578      5.578      5.578   7.66%
AdvanceBeamParticlesSlice()                               1000      1.654      1.654      1.654   2.27%
Fields::SolvePoissonPsiExmByEypBxEzBz()                   1000      1.158      1.158      1.158   1.59%
Fields::ShiftSlices()                                     1000      1.039      1.039      1.039   1.43%
Fields::InitializeSlices()                                1000     0.8724     0.8724     0.8724   1.20%
Hipace::InitializeSxSyWithBeam()                          1000      0.737      0.737      0.737   1.01%
Fields::AddRhoIons()                                      1000     0.3009     0.3009     0.3009   0.41%
BeamParticleContainer::InitBeamFixedWeightPDFSlice()      1000     0.1429     0.1429     0.1429   0.20%
DepositCurrentSlice_BeamParticleContainer()               2000     0.1135     0.1135     0.1135   0.16%
Hipace::SolveOneSlice()                                   1000    0.03352    0.03352    0.03352   0.05%
MultiBuffer::get_data()                                   1000     0.0246     0.0246     0.0246   0.03%
PlasmaParticleContainer::InitParticles()                     1    0.02395    0.02395    0.02395   0.03%
shiftSlippedParticles()                                    749    0.02187    0.02187    0.02187   0.03%
Hipace::ExplicitMGSolveBxBy()                             1000   0.009958   0.009958   0.009958   0.01%
FabArray::setVal()                                           3   0.008549   0.008549   0.008549   0.01%
BeamParticleContainer::resize()                           3749   0.008266   0.008266   0.008266   0.01%
FFTPoissonSolverDirichletQuick::define()                     1   0.008008   0.008008   0.008008   0.01%
BeamParticleContainer::InitBeamFixedWeightPDF3D()            1   0.003618   0.003618   0.003618   0.00%
Hipace::Evolve()                                             1   0.002458   0.002458   0.002458   0.00%
MultiBuffer::put_data()                                   1000   0.001976   0.001976   0.001976   0.00%
main()                                                       1   0.001535   0.001535   0.001535   0.00%
Hipace::InitData()                                           1   0.000317   0.000317   0.000317   0.00%
Fields::AllocData()                                          1  7.731e-05  7.731e-05  7.731e-05   0.00%
ParticleContainer::clearParticles()                          1    3.9e-07    3.9e-07    3.9e-07   0.00%
-------------------------------------------------------------------------------------------------------
  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

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.

1 participant