Skip to content

Conversation

@AlexanderSinn
Copy link
Member

PR #1157 added a something equivalent to this in InitLaserSlice():

if (Hipace::HeadRank()) {
    MPI_Bcast(&m_lambda0,
        1,
        amrex::ParallelDescriptor::Mpi_typemap<decltype(m_lambda0)>::type(),
        Hipace::HeadRankID(),
        amrex::ParallelDescriptor::Communicator());
}

This hangs because the head rank is waiting for the other ranks to receive m_lambda0, but they never call MPI_Bcast and won't receive it. Some MPI implementations may not hang here due to using an internal buffer.

Since lambda0 is required to be set in the input and its asserted that that is the same as the one from the file, the MPI_Bcast can be removed without replacement.

  • 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

@AlexanderSinn AlexanderSinn added bug Something isn't working Parallelization Longitudinal and transverse MPI decomposition labels Apr 24, 2025
Copy link
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Nice catch!! Thanks

@MaxThevenet MaxThevenet merged commit b45fde4 into Hi-PACE:development Apr 25, 2025
10 checks passed
EyaDammak added a commit to EyaDammak/hipace that referenced this pull request May 16, 2025
* Resize Beam Diagnostic buffer (Hi-PACE#1227)

* Fix shadow issue in AddGridExternalFields (Hi-PACE#1230)

* Update Ubuntu version of CI tests (Hi-PACE#1232)

* Remove CONDA from CUDA Local CI (Hi-PACE#1236)

* Beam read_from_file also reads spin (Hi-PACE#1172)

Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>

* Update physical constants (Hi-PACE#1223)

* Fix laser from file hanging with MPI (Hi-PACE#1235)

* Add Parser Debug Print Utility (Hi-PACE#1238)

* Fix CI with MPI (Hi-PACE#1241)

---------

Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Maxence Thévenet <maxence.thevenet@desy.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Parallelization Longitudinal and transverse MPI decomposition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants