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

Example PR #207

Closed
wants to merge 3 commits into from
Closed

Example PR #207

wants to merge 3 commits into from

Conversation

TysonRayJones
Copy link
Member

Do not accept this PR

This is an example of how to contribute a new funciton to QuEST.

This new function calcAmpSum is relatively simple in several ways:

  • the statevec_calcAmpSum implementation and densmatr_calcAmpSum implementations are identical, so only the former is defined
  • the distributed CPU version merely invokes the local CPU version and performs additional reduction, so an explicit statevec_calcAmpSumDistributed definition is not needed.
  • besides validation, there is no common hardware-agnostic processing needed, so statevec_calcAmpSum is defined directly in the backends, and not in QuEST_common.c

The complications of this function were:

  • additional user-input validation (in QuEST_validation) needed to be defined
  • in multithreaded mode, this function needed an OMP reduction
  • in distributed mode, this function needed an MPI reduction
  • in GPU mode, this function needed a parallel & sequential reduction

@TysonRayJones
Copy link
Member Author

This example is make redundant by the architectural overhaul of v4

@TysonRayJones TysonRayJones deleted the example_contrib_1 branch June 6, 2024 05:31
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