MPI.Reducev
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- julia
- Ambito
- distributed-systems, hpc
Direzione di ricerca
Inizia esaminando le API esistenti di riduzione e dei communicator di MPI.jl, quindi confronta il codice Julia proposto con l’implementazione Python collegata e con le convenzioni send/receive del progetto. Il lavoro è completo quando è stata concordata e implementata un’API MPI.Reducev che riduca oggetti Julia di dimensione variabile tra i rank, e quando il comportamento e le operazioni supportate sono documentati e verificati tramite test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It would be nice if we could have an MPI.Reducev for reducing variable-sized Julia objects. I saw a Python implementation, maybe a GitHub gist [1], with an implementation that I roughly ported to Julia, probably with some mistakes based on my limited understanding of the MPI.jl API:
function Reducev(value, op, comm::MPI.Comm)
# Reduces values on all processes to a single value on rank 0.
#
# This function does the same thing as the function MPI_Reduce using
# only MPI_Send and MPI_Recv. As shown, it operates with additions on
# integers, so you could trivially use MPI_Reduce, but for operations
# on variable size structs for which you cannot define an MPI_Datatype,
# you can still use this method, by modifying it to use your op
# and your datastructure.
# TODO: Actually determine buffer
tag = 0
size = get_nworkers(comm)
rank = get_worker_idx(comm)-1
lastpower = 1 << log2(size)
# each of the ranks greater than the last power of 2 less than size
# need to downshift their data, since the binary tree reduction below
# only works when N is a power of two.
for i in lastpower:(size-1)
if rank == i
MPI.send(value, i-lastpower, tag, comm)
end
for i in 0:(size-lastpower-1)
if rank == i
MPI.Recv!(recvbuffer, i+lastpower, tag, comm)
value = op(value, recvbuffer)
end
end
for d in 0:(fastlog2(lastpower)-1)
k = 0
while k < lastpower
k += 1 << (d + 1)
end
receiver = k
sender = k + (1 << d)
if rank == receiver
MPI.Recv!(recvbuffer, 1, sender, tag)
value = op(value, recvbuffer)
elseif rank == sender
MPI.Send(value, 1, receiver, tag)
end
end
value
end
function fastlog2(v::UInt32)
multiply_de_bruijn_bit_position::Vector{Int32} = [
0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
]
v |= v >> 1 # first round down to one less than a power of 2
v |= v >> 2
v |= v >> 4
v |= v >> 8
v |= v >> 16
# TODO: Fix this
multiply_de_bruijn_bit_position[(UInt32(v * 0x07C4ACDDU) >> 27) + 1]
end
- Lingua principale
- Julia
- Stelle
- 441
- Fork
- 129
- Merge medio
- 50m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaParallel/MPI.jl
-
Use `@ccall gc_safe=true` for blocking callsForse già presa @giordano l’ha presa 129 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
JuliaParallel/MPI.jl#954 · 6 commenti ·
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
JuliaParallel/MPI.jl#920 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
JuliaParallel/MPI.jl#745 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
JuliaParallel/MPI.jl#977 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
JuliaParallel/MPI.jl#951 ·
Tutte le issue di JuliaParallel/MPI.jl
Issue simili
-
docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
path: splitext treats directory references and leading dots as extensionsForse già presa @Hiten0305l l’ha presa oggi. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
JuliaRegistries/RegistryCI.jl#758 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno