pregol

package
v0.0.0-...-b3bd8b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUPERSTEP masterState = iota
	DEAD
	DONE
	SAVESTATE
)

Variables

This section is empty.

Functions

func RunGUI

func RunGUI(server string, originalFile string, ip string, graphName string)

initialiser that will be called from runGUI inside the gui folder

func RunUDF

func RunUDF(udf UDF, ports []string)

RunUDF creates a new worker with the given UDF and runs the worker

Types

type Master

type Master struct {
	// contains filtered or unexported fields
}

Master handles all computations for the Master Node

func NewMaster

func NewMaster(numPartitions, checkpoint int, ipFile, graphFile string, port string, primaryAddress string) *Master

NewMaster Constructor for Master struct

func (*Master) AssignPartitions

func (m *Master) AssignPartitions(graphFile string)

AssignPartitions Assign partToVert to active nodes

func (*Master) DisseminateGraph

func (m *Master) DisseminateGraph()

DisseminateGraph Helper function to disseminate graph to workers

func (*Master) InitConnections

func (m *Master) InitConnections()

InitConnections Initializes connections with all machines via ip addresses found in nodeAdrs []string. Generates a list of activeNodes which are the machines that Master will request to start Superstep.

func (*Master) Run

func (m *Master) Run()

Run is the main function to run for master

type ResultMsg

type ResultMsg struct {
	// contains filtered or unexported fields
}

type UDF

type UDF func(vertex *Vertex, superstep int) (bool, map[int]float64)

type Vertex

type Vertex struct {
	Id int

	Val   float64
	InMsg []float64

	OutEdges    []edgeReader
	NumVertices float64
	// contains filtered or unexported fields
}

func (*Vertex) Compute

func (v *Vertex) Compute(udf UDF, superstep int) ResultMsg

func (*Vertex) SetInEdge

func (v *Vertex) SetInEdge(newVal []float64)

func (*Vertex) VoteToHalt

func (v *Vertex) VoteToHalt() ResultMsg

type Worker

type Worker struct {
	ID int
	// contains filtered or unexported fields
}

Worker ...

func NewWorker

func NewWorker(udf UDF) *Worker

NewWorker creates and returns an initialized worker

func (*Worker) Init

func (w *Worker) Init()

Init initializes a worker

func (*Worker) Run

func (w *Worker) Run(port string)

Run ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL