Graybat  1.1
Graph Approach for Highly Generic Communication Schemes Based on Adaptive Topologies
Vertex Communication Interface

Next to the communication methods provided by the cage a vertex also provides methods to communicate with its adjacent vertices.

It is assume that a cage has allready been instantiated and initialised.

  1. Collect data from all incoming edges:
    // Just get a vertex from the cage
    Vertex vertex = cage.getVertex(0);
    // Prepare the receive container
    std::vector<T_Data> collectData(vertex.nInEdges());
    // Synchronous recv messages from all incoming edges
    vertex.collect(recvData);
    This functionality is also available in the cage:
    cage.collect(vertex, collectData);
  2. Spread data to all outgoing edges:
    // Again, take some random vertex
    Vertex vertex = cage.getVertex(0);
    // Prepare the container to spread
    std::vector<T_Data> spreadData(1, static_cast<T_Data>(1));
    // Synchron send same data over all outgoing edges
    v.spread(spreadData);
    // Asynchron send same data over all outgoing edges
    std::vector<Event> events;
    v.spread(sendData, events);

Further Links