Skip to content

Benchmarking #189

Description

@fverdugo

Hi @raar1

we can start benchmarking the SpMV, which is a key kernel.

this is a sample code:

using PartitionedArrays
using LinearAlgebra
using MPI


function main(distribute)
    n = 100
    nranks = MPI.Comm_size(MPI.COMM_WORLD)
    p = Int((nranks)^(1/3))
    parts_per_dir = (p,p,p)
    p = prod(parts_per_dir)
    ranks = distribute(LinearIndices((p,)))
    nodes_per_dir = (n,n,n)
    args = laplacian_fdm(nodes_per_dir,parts_per_dir,ranks)
    A = psparse(args...) |> fetch
    x = pones(axes(A,2))
    b = similar(x,axes(A,1))
    mul!(b,A,x)
    t = @elapsed for _ in 1:1000
        mul!(b,A,x)
    end
    @show t
end

with_mpi(main)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions