Data Structures | Typedefs | Functions

sst/elements/genericProc/programs/MTGL/test/test_static_graph6.cpp File Reference

Compares visiting the adjacencies of a graph by accessing a CSR graph structure directly with using the MTGL interface with using the manually load-balanced version of visit_adj(). More...

#include <cstdlib>
#include <climits>
#include <mtgl/visit_adj.hpp>
#include <mtgl/static_graph_adapter.hpp>
#include <mtgl/generate_rmat_graph.hpp>
#include <mtgl/metrics.hpp>
#include <mtgl/read_matrix_market.hpp>
#include <mtgl/read_dimacs.hpp>
#include <mtgl/mtgl_io.hpp>

Data Structures

class  test_pred_func_obj
class  adjacencies_higher_id_computer< graph, predicate >
 A visitor to the load-balanced visit_adj function. More...

Typedefs

typedef static_graph_adapter
< directedS > 
Graph
typedef graph_traits< Graph >
::size_type 
size_type
typedef graph_traits< Graph >
::vertex_descriptor 
vertex_descriptor
typedef graph_traits< Graph >
::vertex_iterator 
vertex_iterator
typedef bool(* pred_t )(size_type, size_type)

Functions

void count_adjacencies_higher_id (static_graph< directedS > *g, size_type *indeg)
bool test_pred_func (size_type i, size_type j)
void count_adjacencies_higher_id_func_ptr (static_graph< directedS > *g, size_type *indeg, pred_t my_func)
template<class pred >
void count_adjacencies_higher_id_func_obj (static_graph< directedS > *g, size_type *indeg, pred my_func)
template<class Graph , class predicate >
void count_adjacencies_higher_id_mtgl (Graph &g, typename graph_traits< Graph >::size_type *indeg, predicate f)
template<class Graph , class visitor >
void visit_adj_partial (Graph &g, visitor f)
template<class Graph , class visitor >
void visit_adj_full (Graph &g, visitor f)
template<class Graph , class visitor >
void visit_adj_partial (Graph &g, typename graph_traits< Graph >::vertex_descriptor *to_visit, typename graph_traits< Graph >::size_type num_to_visit, visitor f)
template<class Graph , class visitor >
void visit_adj (Graph &g, typename graph_traits< Graph >::vertex_descriptor *to_visit, typename graph_traits< Graph >::size_type num_to_visit, visitor f)
void checkError (size_type *indeg, size_type *indeg2, size_type order)
int main (int argc, char *argv[])

Detailed Description

Compares visiting the adjacencies of a graph by accessing a CSR graph structure directly with using the MTGL interface with using the manually load-balanced version of visit_adj().

Author:
Jon Berry (jberry@sandia.gov)
Greg Mackey (gemacke@sandia.gov)

/date 8/15/2009

The inlined function test_pred_func() below represents a typical predicate that users may wish to introduce as an algorithmic filter. Unfortunately, the use of this predicate via a function pointer in the inner loop of the function count_adjacencies_higher_id_func_ptr() prevents the loop-merge necessary for good performance. The result is a serial inner loop, which has severe consequences when processing power-law data.

The predicate is easily introduced into the function object test_pred_func_obj. Using this function object instead of the function pointer restores the loop merge as demonstrated in the function count_adjacencies_higher_id_func_obj().