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

[openPMD] Communication of upstream beam particle number #269

Merged
merged 5 commits into from
Dec 18, 2020

Conversation

SeverinDiederichs
Copy link
Member

@SeverinDiederichs SeverinDiederichs commented Dec 16, 2020

In the parallel beam I/O, the total number of beam particles of the upstream ranks is required. This number is passed via blocking MPI communication down the pipeline.

It was tested that it gives the correct behavior on GPUs:

[1,4]<stdout>:num particles upstream before exchange 0
[1,4]<stdout>:num particles upstream after exchange 7
[1,3]<stdout>:num particles upstream before exchange 0
[1,3]<stdout>:num particles upstream after exchange 2901
[1,2]<stdout>:num particles upstream before exchange 0
[1,2]<stdout>:num particles upstream after exchange 49869
[1,1]<stdout>:num particles upstream before exchange 0
[1,1]<stdout>:num particles upstream after exchange 97008
[1,0]<stdout>:num particles upstream before exchange 0
[1,0]<stdout>:num particles upstream after exchange 99994
  • 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

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.

Looks great, thanks! Two cosmetic points:

  • Names RecvNumParticlesUpstreamRanks and PassNumParticlesUpstreamRanks are not fully consistent (the opposite or Recv would be Send, and the second function is better described with e.g. PassNumParticlesDownstreamRanks). In fact, we already have names for sending data along the pipeline, this is called Wait and Notify. Could you name these functions accordingly, e.g., WaitNumParticles and NotifyNumParticles?
  • Could you move the calls to these functions to Wait and Notify? I think it's cleaner and more consistent (let's have all the pipelined data handled there.)

Comment on lines 60 to 61
/**< Loop over beams and pass total number of beam particles on upstream ranks */
void PassNumParticlesUpstreamRanks (MPI_Comm a_comm_z);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**< Loop over beams and pass total number of beam particles on upstream ranks */
void PassNumParticlesUpstreamRanks (MPI_Comm a_comm_z);
/** Loop over beams and pass total number of beam particles on upstream ranks */
void PassNumParticlesUpstreamRanks (MPI_Comm a_comm_z);

Doxygen syntax is

int something /**< description */

or

/** description */
int something

@SeverinDiederichs SeverinDiederichs merged commit 3bfda95 into development Dec 18, 2020
@SeverinDiederichs SeverinDiederichs deleted the beam_info_commun branch December 18, 2020 14:57
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.

2 participants