Turi Create  4.0
turi::sgraph_compute::sgraph_synchronize_interface Class Referenceabstract

#include <core/storage/sgraph_data/sgraph_synchronize_interface.hpp>

Public Member Functions

virtual void load_vertex_partition (size_t partition_id, std::vector< sgraph_vertex_data > &all_vertices)=0
 Given a vector of all vertices of partition, initialize the local vertex storage.
 
virtual void update_vertex_partition (vertex_partition_exchange &vpartition_exchange)=0
 Given a vertex exchange object, update the local vertex storage.
 
virtual vertex_partition_exchange get_vertex_partition_exchange (size_t partition_id, const std::unordered_set< size_t > &vertex_ids, const std::vector< size_t > &field_ids)=0
 Obtain a vertex exchange object containing a subset of vertices and fields.
 

Detailed Description

Defines the interface for serializing vertex data and edge data of an sgraph.

The main application of this is for communication of graph information.

vertex_partition_exchange is the struct that can hold a subset data of a subset of vertices from a sgraph partition.

The choice for sparse vertices packing is motivated by the "triple_apply" computation pattern: as we process each edge partition, the associated vertex partition are sparsely visited and updated.

sgraph_synchronize_interface is used for both ends of the communication to deal with initialization, sending and receiving the vertex and edge exchange data.

Example:

//// Worker side ////
sgraph_synchronize_interface* worker_graph_sync; // a client side implementation
// initialize vertex data in partition 0, using all_vertices sent from server.
worker_graph_sync.load_vertex_partition(0, all_vertices_from_server);
// recevie a vertex_exchange from server, let's update the local vertices
worker_graph_sync->update_vertex_partition(vexchange_from_server);
// do some work to update vertex data in partition 0, and obtain a set of changed vertex data..
vertex_exchange updated_vertices = worker_graph_sync->get_vertex_partition_exchange(0);
// now we can send updated_vertices to the server.
//// Server side ////
sgraph_synchronize_interface* server_graph_sync; // a server side implementation
// call to worker to initialize vertex partition.
// recevie a vertex_exchange server, let's update the local vertices
server_graph_sync->update_vertex_partition(vexchange_from_client);
// do some work to update vertex data in partition 0, and obtain a set of changed vertex data..
vertex_exchange updated_vertices = server_graph_sync->get_vertex_partition_exchange(0);
// now we can send updated_vertices to the worker.
Note
This really is implementation detail and is used to allow graph computation methods that are implemented in Python

Definition at line 114 of file sgraph_synchronize_interface.hpp.


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