Skip to content

Speed up CellLinked search #51

@gatocor

Description

@gatocor

There is a slow down happening because of the eraise and cumsum in CellLinked process.

# inside neighborsCellLinked
                    community.abm.neighbors.cellNumAgents_ .= 0
                    $namef($(base...),)
                    # community.abm.neighbors.cellCumSum_ .= cumsum(community.abm.neighbors.cellNumAgents_) .- community.abm.neighbors.cellNumAgents_
                    begin 
                        cumsum!(community.abm.neighbors.cellCumSum_, community.abm.neighbors.cellNumAgents_) 
                        community.abm.neighbors.cellCumSum_ .-= community.abm.neighbors.cellNumAgents_
                    end
                    $namef2($(base...),)

By computing cumsum inplace, I have reduced the memory overhead, but some additional speed up could be performed.
Maybe declaring a vector storing the grid points with cells to just clean those positions? It will require more memory but may speed up the cleaning process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions