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

instant field ionization transitions #5218

Conversation

BrianMarre
Copy link
Member

@BrianMarre BrianMarre commented Nov 13, 2024

implementation of instant field ionization transitions.

Also fixes a bug in the FillRateCache atomicPhysics(FLYonPIC) sub-stage and removes the unused probability estimator implementations, FLYonPIC currently always uses linear probability estimation only.

Only commits after refactor Record Changes kernel are part of this PR, all other commits belong to a base PR.

Attention! This PR breaks setups using custom atomicPhysics.param files. To fix a setup add the following new member to the RateSolverParam struct.

/** maximum number of atomicPhysics sub-steps per PIC time step
 *
 * all rates above timeStepAlpha / maximumNumberSubStepsPerPICTimeStep will be solved in
 *  rate fix point(equilibirium) approximation only.
 *
 * @attention This limit is currently only enforced for field ionization transitions! If the number of
 * sub-steps required by collisional processes is higher than the limit set, AtomicPhysics will perform more
 * subs-steps than set here.
 */
static constexpr uint32_t maximumNumberSubStepsPerPICTimeStep = 200u;

Attention! This PR breaks setups using custom atomicPhysics_Debug.param files. To fix an setup add the following to the old file.

//! @attention performance relevant
namespace picongpu::atomicPhysics::debug::kernel::chooseTransition
{
    //! @attention performance relevant
    constexpr bool CHECK_FOR_INFINITE_FIELD_IONIZATION_RATES = false;
} // namespace picongpu::atomicPhysics::debug::kernel::chooseTransition
namespace picongpu::atomicPhysics::debug::kernel::chooseInstantTransition
{
    //! @attention performance relevant
    constexpr bool CHECK_FOR_INFINITE_FIELD_IONIZATION_RATES = false;
} // namespace picongpu::atomicPhysics::debug::kernel::chooseInstantTransition

@BrianMarre BrianMarre marked this pull request as draft November 13, 2024 20:59
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch from 039cf40 to 6261bd5 Compare November 15, 2024 16:15
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch 7 times, most recently from c1c99f6 to 76b746c Compare November 27, 2024 10:12
@BrianMarre BrianMarre marked this pull request as ready for review November 27, 2024 10:14
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch 7 times, most recently from 011bf68 to 1d575ce Compare November 27, 2024 19:21
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch 8 times, most recently from 4123851 to ca661a4 Compare December 4, 2024 11:45
@BrianMarre
Copy link
Member Author

@psychocoderHPC the failed CI-jobs got stuck somehow, please restart them

@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch from ca661a4 to 0b0a9a5 Compare December 4, 2024 15:45
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch from 0b0a9a5 to a703665 Compare December 4, 2024 15:54
return;

using FieldEnergyCache = typename T_FieldEnergyUseCacheBox::ValueType;
particles::atomicPhysics::localHelperFields::RejectionProbabilityCache_Cell<FieldEnergyCache::numberCells>&
Copy link
Member

Choose a reason for hiding this comment

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

I wrote it already in an other PR. It looks very dangerous to use a reference here.
If it is a pmacc box please take the return value always by copy. There is only one case where a reference is ok and this is if you use native alpaka to get shared memory.

Copy link
Member

Choose a reason for hiding this comment

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

Could be that this should be change in other code parts too.

Copy link
Member Author

Choose a reason for hiding this comment

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

The use of a reference is correct and necessary here, since the dataBox will return a reference to global device memory and we don't want to store a copy of the superCell's rejection probability cache for every worker due to its significant size, ~ 512 * 32-bit.

@psychocoderHPC
Copy link
Member

short rule: if you write code like type& x = function(); this is in 99% of all cases wrong and requires removing the reference.
This is a typical case to produce segfaults.

@BrianMarre
Copy link
Member Author

A general comment, most AtomicPhysics(FLYonPIC) sub stages still use the old auto& <name> = *dc.get<type>(<ID>) style. I updated all new and all changed sub-stages in this PR but we will have to update all other old stages separately.

ci: picongpu
@BrianMarre BrianMarre force-pushed the topic-instantFieldIonization branch from 6a8314b to 5b182ae Compare December 6, 2024 11:52
@psychocoderHPC psychocoderHPC merged commit 63999f7 into ComputationalRadiationPhysics:dev Dec 9, 2024
10 checks passed
@psychocoderHPC psychocoderHPC added this to the 0.8.0 / Next stable milestone Dec 9, 2024
@psychocoderHPC psychocoderHPC added the component: core in PIConGPU (core application) label Dec 9, 2024
@BrianMarre BrianMarre deleted the topic-instantFieldIonization branch December 13, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core in PIConGPU (core application)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants