Template Pregel
Fonction Pregel
template Pregel(Fun...)
;
Contained Functions
Contained Functions
Name | Description |
---|
Pregel | Tout les process de MPI_COMM_WORLD doivent lancer cette fonction.
|
Contained Aliases
Contained Aliases
Parameters
Name | Description |
Fun | [une fonction de jointure, une fonction de map, une fonction de réduction]. |
Example
// DistGraph!(VertexD, EdgeD) grp = ...;
auto initGraph = grp.MapVertices!(
(VertexD vd) => vd.id == 0 ? new DstVertex (v.data, 0.0) :
new DstVertex (v.data, float.infinity)
);
// Calcul de la distance de 0 vers tout le monde
auto sssp = initGraph.Pregel! (
(DstVertex vd, float nDist) => new DstVertex (v.data, min (v.dst, nDist)),
(EdgeTriplet!(DstVertex, EdgeD) ed) {
if (ed.src.dst + 1 < ed.dst.dst)
return iterator (ed.dst.id, ed.src.dst + 1);
else return Iterator!(float).empty;
},
(float a, float b) => min (a, b)
) (float.infinity);