Skip to content

Hunting allocation #1

@Moelf

Description

@Moelf

if I run through --track-allocation=user, the only allocation I see is:

julia> generateXRay(nav2, world2, 1000, 1);

julia> Profile.clear_malloc_data()

julia> generateXRay(nav2, world2, 1000, 1);

        - function getClosestDaughter(nav::NAV, volume::Volume{T}, point::Point3{T}, dir::Vector3{T}, step_limit::T ) where {T,NAV}
        -     step = step_limit
        -     candidate = 0
        -     #---Linear loop over the daughters-------------------------------------------------
        0     for pvol in intersectedDaughters(nav, volume, point, dir)
        -         #---Assuming that it is not yet inside the daughter (otherwise it returns -1.)
 59378816         dist = distanceToIn(pvol, point, dir)
        0         dist < 0. && return (zero(T), pvol.idx ) 
        0         if dist > 0. && dist != Inf && dist < step
        -             step = dist
        0             candidate = pvol.idx
        -         end
        0     end
        0     return step, candidate
        - end
        - 
        - #---Update the NavigatorState and get the step (distance)
        - function computeStep!(state::NavigatorState{T,NAV}, gpoint::Point3{T}, gdir::Vector3{T}, step_limit::T) where {T,NAV}
        0     lpoint, ldir = transform(state.tolocal, gpoint, gdir) 
        0     volume = currentVolume(state)
        0     step, idx = getClosestDaughter(state.navigator, volume, lpoint, ldir, step_limit)
        -     #---If didn't hit any daughter return distance to out
        0     if idx == 0
  3914320         step = distanceToOut(volume.shape, lpoint, ldir)
        0         if step > -kTolerance(T)
        0             popOut!(state)
        0         elseif step < 0
        0             shape = volume.shape
        0             volstack = state.volstack
        0             error(lazy"Negative distanceToOut. \nstep = $step \nshape = $shape \nvolstack = $volstack \npoint = $lpoint \ndir =   $ldir" )
        -         end
        -     else
        -     #---We hit a daughter, push it into the stack
        0         step += kPushTolerance(T)  # to ensure that do not stay in the surface of the daughter
        0         pvol = volume.daughters[idx]
        0         pushIn!(state, pvol)
        -     end
        0     return step
        - end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions