Turi Create  4.0
turi::sgraph_compute::sgraph_synchronize Class Reference

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

Public Member Functions

void load_vertex_partition (size_t partition_id, std::vector< sgraph_vertex_data > &vertices)
 Given a vector of all vertices of partition, initialize the local vertex storage.
 
void update_vertex_partition (vertex_partition_exchange &vpartition_exchange)
 Given a vertex exchange object, update the local vertex storage.
 
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)
 Obtain a vertex exchange object containing a subset of vertices and fields.
 

Detailed Description

An implementation of sgraph_synchronize_interface to exchange information about 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 77 of file sgraph_synchronize.hpp.


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