FlashGraph-ng
A new frontier in large-scale graph analysis and data mining
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
fg::graph_engine Class Reference

This is the class that coordinates how & where algorithms are run. It can be seen as the central organ of FlashGraph. More...

#include <graph_engine.h>

Public Member Functions

 ~graph_engine ()
 Class destructor.
 
compute_vertexget_vertex (vertex_id_t id)
 Permits any vertex to pull any other vertex's state.
NOTE: This can only be used in a shared machine. More...
 
size_t get_vertices (const vertex_id_t ids[], int num, compute_vertex *v_buf[])
 Permits any vertex to pull any set of the vertex state of other vertices.
NOTE: This can only be used in a shared machine.
 
vertex_id_t get_max_vertex_id () const
 Get the maximum vertex ID in the graph. More...
 
vertex_id_t get_min_vertex_id () const
 Get the minimum vertex ID in the graph. More...
 
size_t get_num_vertices () const
 Get the number of vertices in the graph. More...
 
bool is_directed () const
 Tell a user if the graph is directed or not. More...
 
const graph_headerget_graph_header () const
 Get the graph header info. More...
 
void set_vertex_scheduler (vertex_scheduler::ptr scheduler)
 Set the graph computation to use a custom vertex scheduler. More...
 
void start (std::shared_ptr< vertex_filter > filter, vertex_program_creater::ptr creater=vertex_program_creater::ptr())
 Start the graph engine and begin computation on a subset of vertices. More...
 
void start (const vertex_id_t ids[], int num, vertex_initializer::ptr init=vertex_initializer::ptr(), vertex_program_creater::ptr creater=vertex_program_creater::ptr())
 Start the graph engine and begin computation on a subset of vertices. More...
 
void start_all (vertex_initializer::ptr init=vertex_initializer::ptr(), vertex_program_creater::ptr creater=vertex_program_creater::ptr())
 Start the graph engine and begin computation on all vertices. More...
 
void wait4complete ()
 Synchronization barrier that waits for the graph algorithm to complete.
 
void init_vertices (vertex_id_t ids[], int num, vertex_initializer::ptr init)
 Allows users to initialize vertices to certain state. More...
 
void init_all_vertices (vertex_initializer::ptr init)
 Allows users to initialize all vertices to certain state. More...
 
void query_on_all (vertex_query::ptr query)
 Allows users to query the information on the state of all vertices. More...
 
void get_vertex_programs (std::vector< vertex_program::ptr > &programs)
 Return The per-thread vertex programs used by the graph engine. More...
 
int get_curr_level () const
 This returns the current iteration number in the graph engine. More...
 
bool progress_next_level ()
 

Static Public Member Functions

static void init_flash_graph (config_map::ptr configs)
 
static graph_engine::ptr create (FG_graph &graph, graph_index::ptr index)
 Constructor usable by inheriting classes. More...
 

Detailed Description

This is the class that coordinates how & where algorithms are run. It can be seen as the central organ of FlashGraph.

Member Function Documentation

static graph_engine::ptr fg::graph_engine::create ( FG_graph graph,
graph_index::ptr  index 
)
inlinestatic

Constructor usable by inheriting classes.

Parameters
graph
indexThe path to the graph index file on disk.
int fg::graph_engine::get_curr_level ( ) const
inline

This returns the current iteration number in the graph engine.

Returns
The current iteration number.
const graph_header& fg::graph_engine::get_graph_header ( ) const
inline

Get the graph header info.

Returns
The graph header with all its associated metadata.
vertex_id_t fg::graph_engine::get_max_vertex_id ( ) const
inline

Get the maximum vertex ID in the graph.

Returns
The maximum vertex ID in the graph.
vertex_id_t fg::graph_engine::get_min_vertex_id ( ) const
inline

Get the minimum vertex ID in the graph.

Returns
The the minimum vertex ID in the graph.
size_t fg::graph_engine::get_num_vertices ( ) const
inline

Get the number of vertices in the graph.

Returns
The number of vertices in the graph.
compute_vertex& fg::graph_engine::get_vertex ( vertex_id_t  id)
inline

Permits any vertex to pull any other vertex's state.
NOTE: This can only be used in a shared machine.

Parameters
idthe unique vertex ID.
Returns
The compute_vertex requested by id.
void fg::graph_engine::get_vertex_programs ( std::vector< vertex_program::ptr > &  programs)
inline

Return The per-thread vertex programs used by the graph engine.

Parameters
programsAn empty vector that will eventully contain all the vertex progrmas.
void fg::graph_engine::init_all_vertices ( vertex_initializer::ptr  init)

Allows users to initialize all vertices to certain state.

Parameters
initAn initializer used to alter the state of a vertex.
static void fg::graph_engine::init_flash_graph ( config_map::ptr  configs)
static

Smart pointer for object access.

void fg::graph_engine::init_vertices ( vertex_id_t  ids[],
int  num,
vertex_initializer::ptr  init 
)

Allows users to initialize vertices to certain state.

Parameters
idsThe vertex ID for which you want initialize.
numThe number of vertices you intend to initialize.
initAn initializer used to alter the state of a vertex.
bool fg::graph_engine::is_directed ( ) const
inline

Tell a user if the graph is directed or not.

Returns
true if the graph is directed, else false.
bool fg::graph_engine::progress_next_level ( )

The methods below should be used internally.

void fg::graph_engine::query_on_all ( vertex_query::ptr  query)

Allows users to query the information on the state of all vertices.

Parameters
queryThe vertex_query you wish to apply to the graph.
void fg::graph_engine::set_vertex_scheduler ( vertex_scheduler::ptr  scheduler)

Set the graph computation to use a custom vertex scheduler.

Parameters
schedulerThe user-defined vertex scheduler.
void fg::graph_engine::start ( std::shared_ptr< vertex_filter filter,
vertex_program_creater::ptr  creater = vertex_program_creater::ptr() 
)

Start the graph engine and begin computation on a subset of vertices.

Parameters
filterA user defined vertex_filter which specifies which vertices are activated the next iteratoin.
createrA creator that creates user-defined vertex program. By default, a graph engine creates its own default vertex program.
void fg::graph_engine::start ( const vertex_id_t  ids[],
int  num,
vertex_initializer::ptr  init = vertex_initializer::ptr(),
vertex_program_creater::ptr  creater = vertex_program_creater::ptr() 
)

Start the graph engine and begin computation on a subset of vertices.

Parameters
idsThe vertices that should be activated for the first iteration.
initAn initializer used to alter the state of vertices activated in the first iteration.
createrA creator that creates user-defined vertex program. By default, a graph engine creates its own default vertex program.
void fg::graph_engine::start_all ( vertex_initializer::ptr  init = vertex_initializer::ptr(),
vertex_program_creater::ptr  creater = vertex_program_creater::ptr() 
)

Start the graph engine and begin computation on all vertices.

Parameters
initAn initializer used to alter the state of vertices activated in the first iteration.
createrA creator that creates user-defined vertex program. By default, a graph engine creates its own default vertex program.

The documentation for this class was generated from the following file: