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 | List of all members
fg::vertex_program Class Referenceabstract

#include <vertex_program.h>

Inheritance diagram for fg::vertex_program:
fg::vertex_program_impl< vertex_type > fg::vertex_program_impl< matrix_vertex >

Public Member Functions

 vertex_program ()
 
virtual ~vertex_program ()
 Destructor.
 
virtual void run (compute_vertex &vertex)=0
 This is a pre-run before users get any information of adjacency list of vertices. This is commonly where a user would issue a request for the vertex data it needs on disk for the two other run methods. More...
 
virtual void run (compute_vertex &comp_v, const page_vertex &vertex)=0
 Run user's code ideally/generally when the adjacency list of the vertex is read from disks. More...
 
virtual void run_on_message (compute_vertex &c_vertex, const vertex_message &vertex_m)=0
 Run user's code when the vertex receives messages from another. More...
 
virtual void run_on_messages (const vertex_message *v_msgs[], int num)=0
 Run user's code when the vertex receives messages from others. More...
 
virtual void run_on_multicast_message (multicast_message &mmsg)=0
 Run user's code when a multicast message is received. More...
 
virtual void run_on_num_edges (compute_vertex &c_vertex, const vertex_header &header)=0
 Run user's code when the vertex header is read from disks. More...
 
virtual void notify_iteration_end (compute_vertex &cv)=0
 Perform some user defined action on a vertex when the current iteration comes to an end. More...
 
graph_engineget_graph ()
 Get a pointer to the graph_engine. More...
 
void multicast_msg (vertex_id_t ids[], int num, vertex_message &msg)
 Multicast the same message to several other vertices. If the number of vertices receiving the message is too small the graph engine will automatically alter the message type to point-to-point. More...
 
void multicast_msg (edge_seq_iterator &it, vertex_message &msg)
 Multicast the same message to several other vertices. If the number of vertices receiving the message is too small the graph engine will automatically alter the message type to point-to-point. More...
 
void send_msg (vertex_id_t dest, vertex_message &msg)
 Send a point-to-point message from one vertex to another. More...
 
void activate_vertices (vertex_id_t ids[], int num)
 Activate vertices to be processed in the next level (iteration). More...
 
void activate_vertices (edge_seq_iterator &it)
 Activate vertices to be processed in the next level (iteration). More...
 
void activate_vertex (vertex_id_t vertex)
 Activate a singel vertex to be processed in the next level (iteration). More...
 
void request_notify_iter_end (const compute_vertex &v)
 A vertex requests the end of an iteration. `notify_iteration_end' of the vertex will be invoked at the end of an iteration. More...
 

Detailed Description

This class allows users to customize the default vertex_program. For instance extending this class can allow a user to easily create & manage per-thread data structures as opposed to per-vertex which is possible by extending any flavor of compute_vertex.

Constructor & Destructor Documentation

fg::vertex_program::vertex_program ( )
inline

Smart pointer by which vertex_programs should be accessed.

Member Function Documentation

void fg::vertex_program::activate_vertex ( vertex_id_t  vertex)
inline

Activate a singel vertex to be processed in the next level (iteration).

Parameters
idsThe unique ID of the vertex to be activated.
void fg::vertex_program::activate_vertices ( vertex_id_t  ids[],
int  num 
)

Activate vertices to be processed in the next level (iteration).

Parameters
idsThe unique IDs of the vertices to be activated.
numThe number of all the vertices to be activated.
void fg::vertex_program::activate_vertices ( edge_seq_iterator it)

Activate vertices to be processed in the next level (iteration).

Parameters
itAn edge_seq_iterator defining which vertices to activate in the next iteration.
graph_engine& fg::vertex_program::get_graph ( )
inline

Get a pointer to the graph_engine.

Returns
A pointer to the graph_engine.
void fg::vertex_program::multicast_msg ( vertex_id_t  ids[],
int  num,
vertex_message msg 
)

Multicast the same message to several other vertices. If the number of vertices receiving the message is too small the graph engine will automatically alter the message type to point-to-point.

Parameters
idsThe vertex IDs a user wants to send the message to.
numThe number of vertices a user wants to send the message to.
msgThe message intended for recepients.
void fg::vertex_program::multicast_msg ( edge_seq_iterator it,
vertex_message msg 
)

Multicast the same message to several other vertices. If the number of vertices receiving the message is too small the graph engine will automatically alter the message type to point-to-point.

Parameters
itAn edge_seq_iterator defining which vertices to send the message to.
msgThe message intended for recepients.
virtual void fg::vertex_program::notify_iteration_end ( compute_vertex cv)
pure virtual

Perform some user defined action on a vertex when the current iteration comes to an end.

Parameters
cvA compute_vertex that is executed in the method.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

void fg::vertex_program::request_notify_iter_end ( const compute_vertex v)

A vertex requests the end of an iteration. `notify_iteration_end' of the vertex will be invoked at the end of an iteration.

Parameters
vThe vertex that is requesting the notification.
virtual void fg::vertex_program::run ( compute_vertex vertex)
pure virtual

This is a pre-run before users get any information of adjacency list of vertices. This is commonly where a user would issue a request for the vertex data it needs on disk for the two other run methods.

Parameters
vertexThe vertex that is executed in the method.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

virtual void fg::vertex_program::run ( compute_vertex comp_v,
const page_vertex vertex 
)
pure virtual

Run user's code ideally/generally when the adjacency list of the vertex is read from disks.

Parameters
comp_vA compute_vertex that is executed in the method.
vertexA page vertex that `comp_v' requested.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

virtual void fg::vertex_program::run_on_message ( compute_vertex c_vertex,
const vertex_message vertex_m 
)
pure virtual

Run user's code when the vertex receives messages from another.

Parameters
c_vertexA compute_vertex that is executed in the method.
vertex_mA single vertex_message received from a vertex in the current iteration.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

virtual void fg::vertex_program::run_on_messages ( const vertex_message v_msgs[],
int  num 
)
pure virtual

Run user's code when the vertex receives messages from others.

Parameters
v_msgsvertex_messages received from one or more vertices in the current iteration.
numThe number of messages received.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

virtual void fg::vertex_program::run_on_multicast_message ( multicast_message &  mmsg)
pure virtual

Run user's code when a multicast message is received.

Parameters
mmsgThe message(s) received by the vertex.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

virtual void fg::vertex_program::run_on_num_edges ( compute_vertex c_vertex,
const vertex_header &  header 
)
pure virtual

Run user's code when the vertex header is read from disks.

Parameters
c_vertexA compute_vertex that is executed in the method.
headerThe vertex header requested by `c_vertex'.

Implemented in fg::vertex_program_impl< vertex_type >, and fg::vertex_program_impl< matrix_vertex >.

void fg::vertex_program::send_msg ( vertex_id_t  dest,
vertex_message msg 
)

Send a point-to-point message from one vertex to another.

Parameters
destThe destination ID of the vertex a user is sending to.
msgThe message intended for the recepient.

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