McCode icon indicating copy to clipboard operation
McCode copied to clipboard

Elliptic_guide_gravity still (often) segfaults on GPU when using mvalue-arrays

Open willend opened this issue 1 year ago • 0 comments

More elaborate example to be provided later, but e.g. this doesn't run:

COMPONENT focusing_section = Elliptic_guide_gravity(
l=20.7751,
majorAxisxw=42.710242/2, minorAxisxw=0.060/2, 
majorAxisyh=42.560317/2, minorAxisyh=0.1/2, 
majorAxisoffsetxw=0, majorAxisoffsetyh=0,
R0=R0, Qc=Qc, alpha=alpha, W=W, 
mvaluesleft=m_focus_lr, mvaluesright=m_focus_lr,
mvaluestop=m_focus_tb, mvaluesbottom=m_focus_tb, nSegments=m_focus_len)
WHEN (use_cold==0)
AT (156.501365-20.7751, 0, 0) RELATIVE ISCS
ROTATED (0,0,0) RELATIVE StartOfGuide

Causes issues like

INFO: ===
[HEIMDAL] Initialize
ESS_source: Setting up for sector W, beamline 8, global orientation angle is 108.7, internal angle 15
ESS_source: Focusing at rectagle sized 0.12 x 0.036 
  - positioned at location (x,y,z)=(0 m, 0 m, 1.9 m) 
 ( from dist parameter -> distance 1.9 )
ESS_source: Cold and Thermal brilliance performance multiplicators are c_performance=1 and t_performance=1
ESS_source: NOT using time focusing
feeder_bispectral: Translucent blades, Si, mu(2A) = 0.0213338 [1/cm].
feeder_bispectral: nslit=53
Failing in Thread:1
call to cuMemcpyDtoHAsync returned error 700: Illegal address during kernel execution

Whereas changing to a constant, scalar coating rectifies the instrument:

COMPONENT focusing_section = Elliptic_guide_gravity(
l=20.7751,
majorAxisxw=42.710242/2, minorAxisxw=0.060/2, 
majorAxisyh=42.560317/2, minorAxisyh=0.1/2, 
majorAxisoffsetxw=0, majorAxisoffsetyh=0,
R0=R0, Qc=Qc, alpha=alpha, W=W, m=4)
WHEN (use_cold==0)
AT (156.501365-20.7751, 0, 0) RELATIVE ISCS
ROTATED (0,0,0) RELATIVE StartOfGuide

willend avatar Nov 08 '23 15:11 willend