Skip to content

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.

2 participants