Skip to content

Instantly share code, notes, and snippets.

@luraess
Last active July 19, 2023 08:24
Show Gist options
  • Select an option

  • Save luraess/0063e90cb08eb2208b7fe204bbd90ed2 to your computer and use it in GitHub Desktop.

Select an option

Save luraess/0063e90cb08eb2208b7fe204bbd90ed2 to your computer and use it in GitHub Desktop.

Revisions

  1. luraess revised this gist Jul 19, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion alltoall_test_cuda.jl
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ N = 4
    send_mesg = CuArray{Float64}(undef, N)
    recv_mesg = CuArray{Float64}(undef, N)
    fill!(send_mesg, Float64(rank))
    #rreq = MPI.Irecv!(recv_mesg, src, src+32, comm)
    CUDA.synchronize()
    MPI.Sendrecv!(send_mesg, dst, 0, recv_mesg, src, 0, comm)
    println("recv_mesg on proc $rank: $recv_mesg")
    rank==0 && println("done.")
  2. luraess created this gist Aug 24, 2022.
    16 changes: 16 additions & 0 deletions alltoall_test_cuda.jl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    using MPI
    using CUDA
    MPI.Init()
    comm = MPI.COMM_WORLD
    rank = MPI.Comm_rank(comm)
    size = MPI.Comm_size(comm)
    dst = mod(rank+1, size)
    src = mod(rank-1, size)
    println("rank=$rank, size=$size, dst=$dst, src=$src")
    N = 4
    send_mesg = CuArray{Float64}(undef, N)
    recv_mesg = CuArray{Float64}(undef, N)
    fill!(send_mesg, Float64(rank))
    #rreq = MPI.Irecv!(recv_mesg, src, src+32, comm)
    MPI.Sendrecv!(send_mesg, dst, 0, recv_mesg, src, 0, comm)
    println("recv_mesg on proc $rank: $recv_mesg")