xtrack 0.65.4__tar.gz → 0.65.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xtrack-0.65.4/xtrack.egg-info → xtrack-0.65.5}/PKG-INFO +1 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_optics_and_ip_knob.py +1 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +1 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_random_gen.py +6 -4
- xtrack-0.65.5/tests/test_seeds.py +51 -0
- xtrack-0.65.5/xtrack/_version.py +1 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements.py +6 -6
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/dipole_fringe.h +6 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +6 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_mult_fringe.h +6 -2
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_thick_bend.h +3 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_thick_cfd.h +3 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_wedge.h +2 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/slice_elements.py +5 -5
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/slice_elements_thick.py +4 -4
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/headers/synrad_spectrum.h +1 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/line.py +14 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/match.py +5 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/particles/particles.py +4 -4
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/particles/rng_src/base_rng.h +13 -5
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/pipeline/core.py +2 -2
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/pipeline/manager.py +22 -22
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/pipeline/multitracker.py +5 -1
- xtrack-0.65.5/xtrack/random/__init__.py +5 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_generators.py +26 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_src/uniform.h +22 -0
- xtrack-0.65.5/xtrack/random/random_src/uniform_accurate.h +48 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/twiss.py +2 -2
- {xtrack-0.65.4 → xtrack-0.65.5/xtrack.egg-info}/PKG-INFO +1 -1
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack.egg-info/SOURCES.txt +2 -0
- xtrack-0.65.4/xtrack/_version.py +0 -1
- xtrack-0.65.4/xtrack/random/__init__.py +0 -3
- {xtrack-0.65.4 → xtrack-0.65.5}/LICENSE +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/MANIFEST.in +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/README.md +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/base_classes.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/BB6D.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/beambeam.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/boost.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/qgauss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/be_beamfields/spacecharge.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/line.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/mathlibs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/particles.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/ducktrack/temp_pyparticles.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/pyproject.toml +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/setup.cfg +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/setup.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_acceleration.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_amplitude_detuning.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_apertures.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_attr_replicas_and_slices.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_cavity_absolute_time.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_chromatic_functions_vs_madx.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_coasting.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_collective_tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_collimation.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_element_characterization_functions.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_element_internal_record.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_elements_classflags.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_elements_thick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_fcc_ee_solenoid_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_footprint.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_freeze_longitudinal.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_full_rings.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_hvkick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_ions.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_lhc_match_phase_15.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_line.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_lumi.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_mad_writer.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_madloader.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_and_track_from_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_coupling_knob.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_nested.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_orbit_bump.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_match_tune_chroma_cminus.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_multiline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_multisetter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_multispecies.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_particles_api.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_pipeline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_prebuild_kernels.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_ps_against_ptc.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_ps_multiturn_twiss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_psb_chicane.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_pyht_interface.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_radial_steering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_radiation.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_radiation_equilibrium_emittances.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_random_gen_exp.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_random_gen_gauss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_random_gen_ruth.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_rf_track.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_rotation_signs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_second_order_taylor_map.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_slice_and_insert_with_replicas.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_slice_elements.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_spacecharge_in_ring.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_sps_thick.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_survey.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_tapering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_thick_lhc.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_tilt_shifts.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_trajectory_correcton.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_twiss.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_twiss_vs_madx_psb.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_var_cache.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_vs_madx.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/tests/test_xmask_orbit_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/lhc_match/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/_temp/lhc_match/var_limits.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/base_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/beam_interaction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/cavity.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_elem.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/elens.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/exciter.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/multipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/srotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_drift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thick_slice_solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_bend.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_multipolar_components.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_multipole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_quadrupole.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_solenoid.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/wedge.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/wire.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/exciter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/beam_elements/rft_element.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/footprint.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/general.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/headers/atomicadd.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/headers/checks.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/headers/constants.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/headers/particle_states.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/internal_record.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/linear_normal_form.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/loss_location_refinement/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/lumi.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/mad_loader.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/mad_writer.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_position_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_position_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_profile_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_profile_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_size_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/beam_size_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/last_turns_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/last_turns_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/particles_monitor.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/monitors/particles_monitor.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/multiline/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/multiline/multiline.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/multiline/shared_knobs.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/multisetter/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/multisetter/multisetter.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/particles/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/particles/constants.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/particles/rng_src/particles_rng.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/pipeline/__init__.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/progress_indicator.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_src/exponential.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_src/normal.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/random/random_src/rutherford.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/slicing.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/survey.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/synctime.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/tapering.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/targets.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/tracker.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/tracker_data.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/tracker_src/tracker.h +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/trajectory_correction.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack/twissplot.py +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack.egg-info/dependency_links.txt +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack.egg-info/requires.txt +0 -0
- {xtrack-0.65.4 → xtrack-0.65.5}/xtrack.egg-info/top_level.txt +0 -0
@@ -499,7 +499,7 @@ def test_match_ir8_optics(test_context):
|
|
499
499
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
500
500
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
501
501
|
|
502
|
-
opt.step(
|
502
|
+
opt.step(12)
|
503
503
|
assert opt.log()['penalty', -1] < 0.1
|
504
504
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
505
505
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
@@ -499,7 +499,7 @@ def test_match_ir8_optics_new_optimize_api(test_context):
|
|
499
499
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
500
500
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
501
501
|
|
502
|
-
opt.step(
|
502
|
+
opt.step(12)
|
503
503
|
assert opt.log()['penalty', -1] < 0.1
|
504
504
|
assert opt.log()['target_active', -1] == 'yyyyyynnnnnnyy'
|
505
505
|
assert opt.log()['vary_active', -1] == 'yyyyyyyynnnnnnnnnnnn'
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# ######################################### #
|
5
5
|
|
6
6
|
import copy
|
7
|
+
import pytest
|
7
8
|
|
8
9
|
import numpy as np
|
9
10
|
|
@@ -14,7 +15,8 @@ from xobjects.test_helpers import for_all_test_contexts
|
|
14
15
|
|
15
16
|
|
16
17
|
@for_all_test_contexts
|
17
|
-
|
18
|
+
@pytest.mark.parametrize('generator', ['RandomUniform', 'RandomUniformAccurate'])
|
19
|
+
def test_random_generation(test_context, generator):
|
18
20
|
|
19
21
|
part = xp.Particles(_context=test_context, p0c=6.5e12, x=[1,2,3])
|
20
22
|
part._init_random_number_generator()
|
@@ -24,7 +26,7 @@ def test_random_generation(test_context):
|
|
24
26
|
'dummy': xo.Float64,
|
25
27
|
}
|
26
28
|
|
27
|
-
_depends_on = [xt
|
29
|
+
_depends_on = [getattr(xt, generator)]
|
28
30
|
|
29
31
|
_extra_c_sources = [
|
30
32
|
'''
|
@@ -32,11 +34,11 @@ def test_random_generation(test_context):
|
|
32
34
|
void TestElement_track_local_particle(
|
33
35
|
TestElementData el, LocalParticle* part0){
|
34
36
|
//start_per_particle_block (part0->part)
|
35
|
-
double rr =
|
37
|
+
double rr = !!GENERATOR!!_generate(part);
|
36
38
|
LocalParticle_set_x(part, rr);
|
37
39
|
//end_per_particle_block
|
38
40
|
}
|
39
|
-
'''
|
41
|
+
'''.replace('!!GENERATOR!!', generator)
|
40
42
|
]
|
41
43
|
|
42
44
|
telem = TestElement(_context=test_context)
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import numpy as np
|
2
|
+
import pytest
|
3
|
+
|
4
|
+
import xtrack as xt
|
5
|
+
import xpart as xp
|
6
|
+
|
7
|
+
|
8
|
+
def test_seeds():
|
9
|
+
# Define a reference particle
|
10
|
+
particle_ref = xt.Particles(mass0=xt.ELECTRON_MASS_EV, q0=1, p0c=4e9)
|
11
|
+
|
12
|
+
# Create a particle object containing some particles with capacity twice the number of particles
|
13
|
+
n_part = 10
|
14
|
+
particles = xp.build_particles(particle_ref=particle_ref, num_particles=n_part, _capacity=2*n_part)
|
15
|
+
|
16
|
+
# Explicitly initialize the random number generator for the particle object
|
17
|
+
seeds = np.random.randint(0, np.iinfo(np.uint32).max, particles._capacity)
|
18
|
+
particles._init_random_number_generator(seeds=seeds)
|
19
|
+
|
20
|
+
# Save the seeds for the random number generator
|
21
|
+
rng_s1_before = particles._rng_s1.copy()
|
22
|
+
rng_s2_before = particles._rng_s2.copy()
|
23
|
+
rng_s3_before = particles._rng_s3.copy()
|
24
|
+
rng_s4_before = particles._rng_s4.copy()
|
25
|
+
|
26
|
+
# Manually kill some particles
|
27
|
+
n_part_to_kill = np.random.randint(1, n_part+1)
|
28
|
+
idx_part_to_kill = np.random.choice(n_part, n_part_to_kill, replace=False)
|
29
|
+
|
30
|
+
particles.state[idx_part_to_kill] = -1
|
31
|
+
particles._num_active_particles = sum(particles.state == 1)
|
32
|
+
particles._num_lost_particles = n_part - particles._num_lost_particles
|
33
|
+
|
34
|
+
# Create some new particles
|
35
|
+
n_part_new = np.random.randint(1, particles._capacity - n_part)
|
36
|
+
new_particles = xp.build_particles(particle_ref=particle_ref, num_particles=n_part_new)
|
37
|
+
|
38
|
+
# Add the new particles to the main particle object
|
39
|
+
particles.add_particles(new_particles)
|
40
|
+
|
41
|
+
# Save the seeds for the random number generator after the new particles addition
|
42
|
+
rng_s1_after = particles._rng_s1
|
43
|
+
rng_s2_after = particles._rng_s2
|
44
|
+
rng_s3_after = particles._rng_s3
|
45
|
+
rng_s4_after = particles._rng_s4
|
46
|
+
|
47
|
+
# Verify that the seeds for the random number generator stay the same
|
48
|
+
assert np.array_equal(rng_s1_after, rng_s1_before)
|
49
|
+
assert np.array_equal(rng_s2_after, rng_s2_before)
|
50
|
+
assert np.array_equal(rng_s3_after, rng_s3_before)
|
51
|
+
assert np.array_equal(rng_s4_after, rng_s4_before)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.65.5'
|
@@ -12,7 +12,7 @@ import xobjects as xo
|
|
12
12
|
import xtrack as xt
|
13
13
|
|
14
14
|
from ..base_element import BeamElement
|
15
|
-
from ..random import
|
15
|
+
from ..random import RandomUniformAccurate, RandomExponential, RandomNormal
|
16
16
|
from ..general import _pkg_root, _print
|
17
17
|
from ..internal_record import RecordIndex, RecordIdentifier
|
18
18
|
|
@@ -588,7 +588,7 @@ class Multipole(BeamElement):
|
|
588
588
|
|
589
589
|
_skip_in_to_dict = ['_order', 'inv_factorial_order'] # defined by knl, etc.
|
590
590
|
|
591
|
-
_depends_on = [
|
591
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
592
592
|
|
593
593
|
_extra_c_sources = [
|
594
594
|
_pkg_root.joinpath('headers/constants.h'),
|
@@ -1000,7 +1000,7 @@ class Sextupole(BeamElement):
|
|
1000
1000
|
'order': '_order',
|
1001
1001
|
}
|
1002
1002
|
|
1003
|
-
_depends_on = [
|
1003
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1004
1004
|
_internal_record_class = SynchrotronRadiationRecord
|
1005
1005
|
|
1006
1006
|
_extra_c_sources = [
|
@@ -1101,7 +1101,7 @@ class Octupole(BeamElement):
|
|
1101
1101
|
'order': '_order',
|
1102
1102
|
}
|
1103
1103
|
|
1104
|
-
_depends_on = [
|
1104
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1105
1105
|
_internal_record_class = SynchrotronRadiationRecord
|
1106
1106
|
|
1107
1107
|
_extra_c_sources = [
|
@@ -1312,7 +1312,7 @@ class Solenoid(BeamElement):
|
|
1312
1312
|
_pkg_root.joinpath('beam_elements/elements_src/solenoid.h'),
|
1313
1313
|
]
|
1314
1314
|
|
1315
|
-
_depends_on = [
|
1315
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
1316
1316
|
|
1317
1317
|
_internal_record_class = SynchrotronRadiationRecord
|
1318
1318
|
|
@@ -2289,7 +2289,7 @@ class FirstOrderTaylorMap(BeamElement):
|
|
2289
2289
|
'm1': xo.Field(xo.Float64[6, 6], default=np.eye(6, dtype=np.float64)),
|
2290
2290
|
}
|
2291
2291
|
|
2292
|
-
_depends_on = [
|
2292
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
2293
2293
|
|
2294
2294
|
_extra_c_sources = [
|
2295
2295
|
_pkg_root.joinpath('headers/constants.h'),
|
@@ -6,9 +6,15 @@
|
|
6
6
|
#ifndef XTRACK_FRINGE_H
|
7
7
|
#define XTRACK_FRINGE_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
10
13
|
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
15
|
+
#ifndef POW4
|
11
16
|
#define POW4(X) ((X)*(X)*(X)*(X))
|
17
|
+
#endif
|
12
18
|
|
13
19
|
/*gpufun*/
|
14
20
|
void Fringe_track_local_particle(
|
@@ -6,9 +6,15 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_DIPOLE_FRINGE_H
|
7
7
|
#define XTRACK_TRACK_DIPOLE_FRINGE_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
10
13
|
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
15
|
+
#ifndef POW4
|
11
16
|
#define POW4(X) ((X)*(X)*(X)*(X))
|
17
|
+
#endif
|
12
18
|
|
13
19
|
|
14
20
|
#ifndef XTRACK_FRINGE_FROM_PTC
|
@@ -6,8 +6,12 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_MULT_FRINGE_H
|
7
7
|
#define XTRACK_TRACK_MULT_FRINGE_H
|
8
8
|
|
9
|
-
#
|
10
|
-
#define
|
9
|
+
#ifndef POW2
|
10
|
+
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
#ifndef POW3
|
13
|
+
#define POW3(X) ((X)*(X)*(X))
|
14
|
+
#endif
|
11
15
|
|
12
16
|
/*gpufun*/
|
13
17
|
void MultFringe_track_single_particle(
|
@@ -6,7 +6,10 @@
|
|
6
6
|
#ifndef XTRACK_TRACK_THICK_CFD_H
|
7
7
|
#define XTRACK_TRACK_THICK_CFD_H
|
8
8
|
|
9
|
+
#ifndef POW2
|
9
10
|
#define POW2(X) ((X)*(X))
|
11
|
+
#endif
|
12
|
+
|
10
13
|
#define NONZERO(X) ((X) != 0.0)
|
11
14
|
|
12
15
|
// From madx: https://github.com/MethodicalAcceleratorDesign/MAD-X/blob/8695bd422dc403a01aa185e9fea16603bbd5b3e1/src/trrun.f90#L4320
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import xobjects as xo
|
2
2
|
|
3
3
|
from ..general import _pkg_root
|
4
|
-
from ..random import
|
4
|
+
from ..random import RandomUniformAccurate, RandomExponential
|
5
5
|
from .elements import (SynchrotronRadiationRecord, Quadrupole, Sextupole,
|
6
6
|
Octupole, Bend, Multipole, DipoleEdge)
|
7
7
|
from ..base_element import BeamElement
|
@@ -30,7 +30,7 @@ class ThinSliceQuadrupole(BeamElement):
|
|
30
30
|
allow_rot_and_shift = False
|
31
31
|
rot_and_shift_from_parent = True
|
32
32
|
_skip_in_to_dict = ['_parent']
|
33
|
-
_depends_on = [
|
33
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
34
34
|
_internal_record_class = SynchrotronRadiationRecord
|
35
35
|
has_backtrack = True
|
36
36
|
_force_moveable = True
|
@@ -78,7 +78,7 @@ class ThinSliceSextupole(BeamElement):
|
|
78
78
|
allow_rot_and_shift = False
|
79
79
|
rot_and_shift_from_parent = True
|
80
80
|
_skip_in_to_dict = ['_parent']
|
81
|
-
_depends_on = [
|
81
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
82
82
|
_internal_record_class = SynchrotronRadiationRecord
|
83
83
|
has_backtrack = True
|
84
84
|
_force_moveable = True
|
@@ -126,7 +126,7 @@ class ThinSliceOctupole(BeamElement):
|
|
126
126
|
allow_rot_and_shift = False
|
127
127
|
rot_and_shift_from_parent = True
|
128
128
|
_skip_in_to_dict = ['_parent']
|
129
|
-
_depends_on = [
|
129
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
130
130
|
_internal_record_class = SynchrotronRadiationRecord
|
131
131
|
has_backtrack = True
|
132
132
|
_force_moveable = True
|
@@ -174,7 +174,7 @@ class ThinSliceBend(BeamElement):
|
|
174
174
|
allow_rot_and_shift = False
|
175
175
|
rot_and_shift_from_parent = True
|
176
176
|
_skip_in_to_dict = ['_parent']
|
177
|
-
_depends_on = [
|
177
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
178
178
|
_internal_record_class = SynchrotronRadiationRecord
|
179
179
|
has_backtrack = True
|
180
180
|
_force_moveable = True
|
@@ -4,7 +4,7 @@ from ..general import _pkg_root
|
|
4
4
|
from ..base_element import BeamElement
|
5
5
|
from .elements import (SynchrotronRadiationRecord, Bend, Quadrupole, Sextupole,
|
6
6
|
Octupole, Solenoid, Drift)
|
7
|
-
from ..random import
|
7
|
+
from ..random import RandomUniformAccurate, RandomExponential
|
8
8
|
|
9
9
|
from .slice_elements import _slice_copy
|
10
10
|
|
@@ -89,7 +89,7 @@ class ThickSliceSextupole(BeamElement):
|
|
89
89
|
|
90
90
|
_xofields = {'_parent': xo.Ref(Sextupole), **_common_xofields}
|
91
91
|
|
92
|
-
_depends_on = [
|
92
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
93
93
|
_internal_record_class = SynchrotronRadiationRecord
|
94
94
|
|
95
95
|
_extra_c_sources = [
|
@@ -124,7 +124,7 @@ class ThickSliceOctupole(BeamElement):
|
|
124
124
|
|
125
125
|
_xofields = {'_parent': xo.Ref(Octupole), **_common_xofields}
|
126
126
|
|
127
|
-
_depends_on = [
|
127
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
128
128
|
_internal_record_class = SynchrotronRadiationRecord
|
129
129
|
|
130
130
|
_extra_c_sources = [
|
@@ -159,7 +159,7 @@ class ThickSliceSolenoid(BeamElement):
|
|
159
159
|
|
160
160
|
_xofields = {'_parent': xo.Ref(Solenoid), **_common_xofields}
|
161
161
|
|
162
|
-
_depends_on = [
|
162
|
+
_depends_on = [RandomUniformAccurate, RandomExponential]
|
163
163
|
_internal_record_class = SynchrotronRadiationRecord
|
164
164
|
|
165
165
|
_extra_c_sources = [
|
@@ -189,7 +189,7 @@ double synrad_gen_photon_energy_normalized(LocalParticle *part)
|
|
189
189
|
exact=SynRad(result);
|
190
190
|
appr=a1/tmp;
|
191
191
|
} else { // use high energy approximation
|
192
|
-
double const u =
|
192
|
+
double const u = RandomUniformAccurate_generate(part);
|
193
193
|
if (u < 1.e-50) continue; // avoid log(0), retrigger generation
|
194
194
|
result=xlow-log(u);
|
195
195
|
exact=SynRad(result);
|
@@ -934,6 +934,20 @@ class Line:
|
|
934
934
|
equals to False and no progress bar is displayed.
|
935
935
|
"""
|
936
936
|
|
937
|
+
if hasattr(particles, '_needs_pipeline') and particles._needs_pipeline:
|
938
|
+
if '_called_by_pipeline' not in kwargs or not kwargs['_called_by_pipeline']:
|
939
|
+
all_kwargs = locals()
|
940
|
+
multitracker = xt.PipelineMultiTracker(
|
941
|
+
branches=[xt.PipelineBranch(line=self, particles=particles)])
|
942
|
+
all_kwargs.pop('self')
|
943
|
+
all_kwargs.pop('particles')
|
944
|
+
all_kwargs.pop('kwargs')
|
945
|
+
all_kwargs.pop('_called_by_pipeline', None)
|
946
|
+
return multitracker.track(**all_kwargs, **kwargs)
|
947
|
+
|
948
|
+
if '_called_by_pipeline' in kwargs: # Used only above
|
949
|
+
kwargs.pop('_called_by_pipeline')
|
950
|
+
|
937
951
|
self._check_valid_tracker()
|
938
952
|
return self.tracker._track(
|
939
953
|
particles,
|
@@ -28,6 +28,10 @@ XTRACK_DEFAULT_WEIGHTS = {
|
|
28
28
|
'muy': 10.,
|
29
29
|
'qx': 10.,
|
30
30
|
'qy': 10.,
|
31
|
+
'dx' : 10.,
|
32
|
+
'dpx': 100.,
|
33
|
+
'dy' : 10.,
|
34
|
+
'dpy': 100.,
|
31
35
|
}
|
32
36
|
|
33
37
|
ALLOWED_TARGET_KWARGS= ['x', 'px', 'y', 'py', 'zeta', 'delta', 'pzata', 'ptau',
|
@@ -1069,4 +1073,4 @@ class ActionCall(Action):
|
|
1069
1073
|
for ii in range(len(ftar)):
|
1070
1074
|
tars.append(xt.Target(ii, ftar[ii], action=self))
|
1071
1075
|
|
1072
|
-
return tars
|
1076
|
+
return tars
|
@@ -876,16 +876,15 @@ class Particles(xo.HybridClass):
|
|
876
876
|
# Reorganize particles
|
877
877
|
with self._bypass_linked_vars():
|
878
878
|
for tt, nn in self.per_particle_vars:
|
879
|
+
if nn.startswith('_rng'):
|
880
|
+
continue
|
879
881
|
vv = getattr(self, nn)
|
880
882
|
vv_active = vv[mask_active]
|
881
883
|
vv_lost = vv[mask_lost]
|
882
884
|
|
883
885
|
vv[:n_active] = vv_active
|
884
886
|
vv[n_active:n_active + n_lost] = vv_lost
|
885
|
-
|
886
|
-
vv[n_active + n_lost:] = 0
|
887
|
-
else:
|
888
|
-
vv[n_active + n_lost:] = tt._dtype.type(LAST_INVALID_STATE)
|
887
|
+
vv[n_active + n_lost:] = tt._dtype.type(LAST_INVALID_STATE)
|
889
888
|
|
890
889
|
if isinstance(self._buffer.context, xo.ContextCpu):
|
891
890
|
self._num_active_particles = n_active
|
@@ -988,6 +987,7 @@ class Particles(xo.HybridClass):
|
|
988
987
|
def init_pipeline(self, name):
|
989
988
|
|
990
989
|
self.name = name
|
990
|
+
self._needs_pipeline = True
|
991
991
|
|
992
992
|
def show(self):
|
993
993
|
|
@@ -14,16 +14,26 @@
|
|
14
14
|
#define TAUSWORTHE(s,a,b,c,d) ((((s) &c) <<d) &MASK) ^ (((((s) <<a) &MASK)^(s)) >>b)
|
15
15
|
#define LCG(s,A,C) ((((A*(s)) &MASK) + C) &MASK)
|
16
16
|
|
17
|
-
|
18
17
|
/*gpufun*/
|
19
|
-
|
18
|
+
uint32_t rng_get_int32 (uint32_t *s1, uint32_t *s2, uint32_t *s3, uint32_t *s4 ){
|
20
19
|
*s1 = TAUSWORTHE (*s1, 13, 19, 4294967294UL, 12); // p1=2^31-1
|
21
20
|
*s2 = TAUSWORTHE (*s2, 2, 25, 4294967288UL, 4); // p2=2^30-1
|
22
21
|
*s3 = TAUSWORTHE (*s3, 3, 11, 4294967280UL, 17); // p3=2^28-1
|
23
22
|
*s4 = LCG(*s4, 1664525, 1013904223UL); // p4=2^32
|
24
23
|
|
25
24
|
// Combined period is lcm(p1,p2,p3,p4) ~ 2^121
|
26
|
-
return ((*s1) ^ (*s2) ^ (*s3) ^ (*s4))
|
25
|
+
return ((*s1) ^ (*s2) ^ (*s3) ^ (*s4));
|
26
|
+
}
|
27
|
+
|
28
|
+
#ifndef TWO_TO_32
|
29
|
+
#define TWO_TO_32 4294967296.0
|
30
|
+
#endif
|
31
|
+
|
32
|
+
/*gpufun*/
|
33
|
+
double rng_get (uint32_t *s1, uint32_t *s2, uint32_t *s3, uint32_t *s4 ){
|
34
|
+
|
35
|
+
return rng_get_int32(s1, s2, s3, s4) / TWO_TO_32; // uniform in [0, 1) 1e10 resolution
|
36
|
+
|
27
37
|
}
|
28
38
|
|
29
39
|
/*gpufun*/
|
@@ -47,5 +57,3 @@ void rng_set (uint32_t *s1, uint32_t *s2, uint32_t *s3, uint32_t *s4, uint32_t s
|
|
47
57
|
}
|
48
58
|
|
49
59
|
#endif /* XTRACK_BASE_RNG_H */
|
50
|
-
|
51
|
-
|
@@ -23,12 +23,12 @@ class PipelineCommunicator:
|
|
23
23
|
self.messages[dest][tag].append(send_buffer)
|
24
24
|
return self
|
25
25
|
|
26
|
-
def Recv(self,
|
26
|
+
def Recv(self,receive_buffer,source,tag):
|
27
27
|
assert source in self.messages.keys()
|
28
28
|
assert tag in self.messages[source].keys()
|
29
29
|
assert bool(self.messages[source][tag])
|
30
30
|
message = self.messages[source][tag].pop(0)
|
31
|
-
|
31
|
+
receive_buffer[:] = message[:]
|
32
32
|
|
33
33
|
def Iprobe(self,source, tag):
|
34
34
|
if source in self.messages.keys():
|
@@ -36,10 +36,10 @@ class PipelineManager:
|
|
36
36
|
self._elements[element_name] = len(self._elements)
|
37
37
|
|
38
38
|
#
|
39
|
-
# The tag is a int that identifies messages given the rank of the sender and of the
|
39
|
+
# The tag is a int that identifies messages given the rank of the sender and of the receiver
|
40
40
|
#
|
41
|
-
def get_message_tag(self,element_name,sender_name,
|
42
|
-
tag = self._elements[element_name] + len(self._elements)*self._IDs[sender_name].number + len(self._elements)*len(self._IDs)*self._IDs[
|
41
|
+
def get_message_tag(self,element_name,sender_name,receiver_name,internal_tag=0):
|
42
|
+
tag = self._elements[element_name] + len(self._elements)*self._IDs[sender_name].number + len(self._elements)*len(self._IDs)*self._IDs[receiver_name].number + len(self._elements)*len(self._IDs)*len(self._IDs)*internal_tag
|
43
43
|
#if tag > self._max_tag:
|
44
44
|
# _print(f'PyPLINEDElement WARNING {self.name}: MPI message tag {tag} is larger than max ({self._max_tag})')
|
45
45
|
return tag
|
@@ -47,41 +47,41 @@ class PipelineManager:
|
|
47
47
|
#
|
48
48
|
# The key is string that uniquely identifies a message
|
49
49
|
#
|
50
|
-
def get_message_key(self,element_name,sender_name,
|
51
|
-
return f'{element_name}_{sender_name}_{
|
50
|
+
def get_message_key(self,element_name,sender_name,receiver_name,tag=0):
|
51
|
+
return f'{element_name}_{sender_name}_{receiver_name}_{tag}'
|
52
52
|
|
53
|
-
def is_ready_to_send(self,element_name,sender_name,
|
54
|
-
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,
|
55
|
-
key = self.get_message_key(element_name=element_name,sender_name=sender_name,
|
53
|
+
def is_ready_to_send(self,element_name,sender_name,receiver_name,turn,internal_tag=0):
|
54
|
+
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,internal_tag=internal_tag)
|
55
|
+
key = self.get_message_key(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,tag=tag)
|
56
56
|
if key not in self._last_request_turn.keys():
|
57
57
|
return True
|
58
58
|
if turn <= self._last_request_turn[key]:
|
59
59
|
if self.verbose:
|
60
|
-
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} has already sent a message to {
|
60
|
+
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} has already sent a message to {receiver_name} at rank {self.get_particles_rank(receiver_name)} at turn {turn} with tag {tag}')
|
61
61
|
return False
|
62
62
|
if not self._pending_requests[key].Test():
|
63
63
|
if self.verbose:
|
64
|
-
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} previous message to {
|
64
|
+
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} previous message to {receiver_name} at rank {self.get_particles_rank(receiver_name)} with tag {tag} was not receviced yet')
|
65
65
|
return False
|
66
66
|
return True
|
67
67
|
|
68
|
-
def send_message(self,send_buffer,element_name,sender_name,
|
69
|
-
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,
|
70
|
-
key = self.get_message_key(element_name=element_name,sender_name=sender_name,
|
68
|
+
def send_message(self,send_buffer,element_name,sender_name,receiver_name,turn,internal_tag=0):
|
69
|
+
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,internal_tag=internal_tag)
|
70
|
+
key = self.get_message_key(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,tag=tag)
|
71
71
|
self._last_request_turn[key] = turn
|
72
72
|
if self.verbose:
|
73
|
-
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} sending message to {
|
74
|
-
self._pending_requests[key] = self._communicator.Issend(send_buffer,dest=self.get_particles_rank(
|
73
|
+
_print(f'Pipeline manager {element_name}: {sender_name} at rank {self.get_particles_rank(sender_name)} sending message to {receiver_name} at rank {self.get_particles_rank(receiver_name)} at turn {turn} with tag {tag}')
|
74
|
+
self._pending_requests[key] = self._communicator.Issend(send_buffer,dest=self.get_particles_rank(receiver_name),tag=tag)
|
75
75
|
|
76
|
-
def
|
77
|
-
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,
|
76
|
+
def is_ready_to_receive(self,element_name,sender_name,receiver_name,internal_tag=0):
|
77
|
+
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,internal_tag=internal_tag)
|
78
78
|
is_ready = self._communicator.Iprobe(source=self.get_particles_rank(sender_name), tag=tag)
|
79
79
|
if self.verbose and not is_ready:
|
80
|
-
_print(f'Pipeline manager {element_name}: {
|
80
|
+
_print(f'Pipeline manager {element_name}: {receiver_name} at rank {self.get_particles_rank(receiver_name)} is not ready to receive from {sender_name} at rank {self.get_particles_rank(sender_name)} with tag {tag}')
|
81
81
|
return is_ready
|
82
82
|
|
83
|
-
def
|
84
|
-
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,
|
83
|
+
def receive_message(self,receive_buffer,element_name,sender_name,receiver_name,internal_tag=0):
|
84
|
+
tag = self.get_message_tag(element_name=element_name,sender_name=sender_name,receiver_name=receiver_name,internal_tag=internal_tag)
|
85
85
|
if self.verbose:
|
86
|
-
_print(f'Pipeline manager {element_name}: {
|
87
|
-
self._communicator.Recv(
|
86
|
+
_print(f'Pipeline manager {element_name}: {receiver_name} at rank {self.get_particles_rank(receiver_name)} recieving from {sender_name} at rank {self.get_particles_rank(sender_name)} with tag {tag}')
|
87
|
+
self._communicator.Recv(receive_buffer,source=self.get_particles_rank(sender_name),tag=tag)
|
@@ -20,6 +20,9 @@ class PipelineBranch:
|
|
20
20
|
self.particles = particles
|
21
21
|
self.pipeline_status = None
|
22
22
|
|
23
|
+
if self.line.tracker is None:
|
24
|
+
raise ValueError('Tracker not built for line')
|
25
|
+
|
23
26
|
self.line.tracker.enable_pipeline_hold = True
|
24
27
|
|
25
28
|
class PipelineMultiTracker:
|
@@ -36,7 +39,8 @@ class PipelineMultiTracker:
|
|
36
39
|
|
37
40
|
for branch in self.branches:
|
38
41
|
branch.pipeline_status = branch.line.track(
|
39
|
-
branch.particles, **kwargs
|
42
|
+
branch.particles, **kwargs,
|
43
|
+
_called_by_pipeline=True)
|
40
44
|
|
41
45
|
need_resume = True
|
42
46
|
while need_resume:
|
@@ -68,6 +68,32 @@ class RandomUniform(BeamElement):
|
|
68
68
|
(-1, n_samples_per_seed)
|
69
69
|
)
|
70
70
|
|
71
|
+
class RandomUniformAccurate(RandomUniform):
|
72
|
+
_xofields = {
|
73
|
+
'_dummy': xo.UInt8, # TODO: a hack for allocating an empty struct on OCL
|
74
|
+
}
|
75
|
+
|
76
|
+
allow_track = False
|
77
|
+
|
78
|
+
_depends_on = [RandomUniform]
|
79
|
+
|
80
|
+
_extra_c_sources = [
|
81
|
+
_pkg_root.joinpath('random','random_src','uniform_accurate.h')
|
82
|
+
]
|
83
|
+
|
84
|
+
_per_particle_kernels = {
|
85
|
+
'sample_unif_accuurate': xo.Kernel(
|
86
|
+
c_name='RandomUniformAccurate_sample',
|
87
|
+
args=[
|
88
|
+
xo.Arg(xo.Float64, pointer=True, name='samples'),
|
89
|
+
xo.Arg(xo.Int64, name='n_samples_per_seed')
|
90
|
+
]
|
91
|
+
)
|
92
|
+
}
|
93
|
+
|
94
|
+
def _sample(self, *args, **kwargs):
|
95
|
+
self.sample_unif_accuurate(*args, **kwargs)
|
96
|
+
|
71
97
|
|
72
98
|
class RandomExponential(RandomUniform):
|
73
99
|
_xofields = {
|
@@ -46,6 +46,28 @@ double RandomUniform_generate(LocalParticle* part){
|
|
46
46
|
return r;
|
47
47
|
}
|
48
48
|
|
49
|
+
/*gpufun*/
|
50
|
+
uint32_t RandomUniformUInt32_generate(LocalParticle* part){
|
51
|
+
uint32_t s1 = LocalParticle_get__rng_s1(part);
|
52
|
+
uint32_t s2 = LocalParticle_get__rng_s2(part);
|
53
|
+
uint32_t s3 = LocalParticle_get__rng_s3(part);
|
54
|
+
uint32_t s4 = LocalParticle_get__rng_s4(part);
|
55
|
+
|
56
|
+
if (s1==0 && s2==0 && s3==0 && s4==0) {
|
57
|
+
LocalParticle_kill_particle(part, RNG_ERR_SEEDS_NOT_SET);
|
58
|
+
return 0;
|
59
|
+
}
|
60
|
+
|
61
|
+
uint32_t r = rng_get_int32(&s1, &s2, &s3, &s4);
|
62
|
+
|
63
|
+
LocalParticle_set__rng_s1(part, s1);
|
64
|
+
LocalParticle_set__rng_s2(part, s2);
|
65
|
+
LocalParticle_set__rng_s3(part, s3);
|
66
|
+
LocalParticle_set__rng_s4(part, s4);
|
67
|
+
|
68
|
+
return r;
|
69
|
+
}
|
70
|
+
|
49
71
|
|
50
72
|
/*gpufun*/
|
51
73
|
void RandomUniform_sample(RandomUniformData rng, LocalParticle* part0,
|