Skip to content

Make multilevel-atom test independent of FP contraction (#1426) - #3319

Open
yorickreum wants to merge 1 commit into
NanoComp:masterfrom
yorickreum:fix-multilevel-atom-fma
Open

yorickreum wants to merge 1 commit into
NanoComp:masterfrom
yorickreum:fix-multilevel-atom-fma

Conversation

@yorickreum

Copy link
Copy Markdown
Contributor

At resolution 40 the optical period spans only ~13 time steps and the laser spikes chaotically instead of settling. Between spikes the field collapses to ~1e-18 and the laser regrows out of that remnant, so the sampled value depends on whether the compiler contracts a*b+c into an FMA: arm64 does by default, x86 does with -march=native.

Raise the resolution to 200, where the laser reaches a steady state, and assert the steady-state envelope at the cavity boundary instead of an instantaneous field value. Steady-state lasing fixes the amplitude but not the phase, so the envelope is reproducible: contracted and uncontracted builds agree on it to 6e-6, against 98% before. The envelope no longer constrains the lasing frequency, which the old sample caught through its phase in builds that contracted the same way. A frequency check can be added later if that coverage is wanted, the peak of a DFT of the boundary field is identical across both builds.

At resolution 40 the optical period spans only ~13 time steps and the
laser spikes chaotically instead of settling.  Between spikes the field
collapses to ~1e-18 and the laser regrows out of that remnant, so the
sampled value depends on whether the compiler contracts a*b+c into an
FMA: arm64 does by default, x86 does with -march=native.

Raise the resolution to 200, where the laser reaches a steady state, and
assert the steady-state envelope at the cavity boundary instead of an
instantaneous field value.  Steady-state lasing fixes the amplitude but
not the phase, so the envelope is reproducible: contracted and
uncontracted builds agree on it to 6e-6, against 98% before.  The
envelope no longer constrains the lasing frequency, which the old sample
caught through its phase in builds that contracted the same way.  A
frequency check can be added later if that coverage is wanted, the peak
of a DFT of the boundary field is identical across both builds.
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