int main (int argc, char ** argv) { stinger_t * S = stinger_new(); /* insert your data now */ load_benchmark_data_into_stinger (S, argv[1],0); /* get number of vertices */ uint64_t nv = stinger_max_active_vertex (S); nv++; print_fragmentation_stats (S, nv); /* auxiliary data structure */ double * pagerank_scores = xmalloc (nv * sizeof(int64_t)); double * pagerank_scores_tmp = xmalloc (nv * sizeof(int64_t)); /* the algorithm itself (timed) */ bench_start(); pagerank (S, nv, pagerank_scores, pagerank_scores_tmp, 1e-8, 0.85, 100); bench_end(); printf("Done.\n"); /* cleanup */ free (pagerank_scores); free (pagerank_scores_tmp); stinger_free_all (S); return 0; }
int main (const int argc, char *argv[]) { parse_args (argc, argv, &initial_graph_name, &action_stream_name, &batch_size, &nbatch); STATS_INIT (); load_graph_and_action_stream (initial_graph_name, &nv, &ne, (int64_t **) & off, (int64_t **) & ind, (int64_t **) & weight, (int64_t **) & graphmem, action_stream_name, &naction, (int64_t **) & action, (int64_t **) & actionmem); print_initial_graph_stats (nv, ne, batch_size, nbatch, naction); BATCH_SIZE_CHECK (); /* Convert to STINGER */ tic (); S = stinger_new (); stinger_set_initial_edges (S, nv, 0, off, ind, weight, NULL, NULL, 0); PRINT_STAT_DOUBLE ("time_stinger", toc ()); fflush (stdout); int64_t numSteps = 3; int64_t src_dest_pair[2] = { 124, 381 }; tic (); int64_t size_intersect = st_conn_stinger (S, nv, ne, src_dest_pair, 1, numSteps); PRINT_STAT_DOUBLE ("time_st_conn_stinger", toc ()); PRINT_STAT_INT64 ("size_intersect", size_intersect); stinger_free_all (S); free (graphmem); free (actionmem); STATS_END (); }
int main (const int argc, char *argv[]) { parse_args (argc, argv, &initial_graph_name, &action_stream_name, &batch_size, &nbatch); STATS_INIT (); load_graph_and_action_stream (initial_graph_name, &nv, &ne, (int64_t **) & off, (int64_t **) & ind, (int64_t **) & weight, (int64_t **) & graphmem, action_stream_name, &naction, (int64_t **) & action, (int64_t **) & actionmem); print_initial_graph_stats (nv, ne, batch_size, nbatch, naction); BATCH_SIZE_CHECK (); int64_t *component_map = xmalloc (nv * sizeof (int64_t)); /* Convert to STINGER */ tic (); S = stinger_new (); stinger_set_initial_edges (S, nv, 0, off, ind, weight, NULL, NULL, 0); PRINT_STAT_DOUBLE ("time_stinger", toc ()); fflush (stdout); tic (); int64_t num_comp_end = connected_components_stinger (S, nv, ne, component_map, NULL, NULL, NULL, NULL, NULL); PRINT_STAT_DOUBLE ("time_components_tree", toc ()); PRINT_STAT_INT64 ("number_of_components", num_comp_end); stinger_free_all (S); free (graphmem); free (actionmem); STATS_END (); }
int main (int argc, char ** argv) { stinger_t * S = stinger_new(); /* insert your data now */ load_benchmark_data_into_stinger (S, argv[1],1); int64_t source_vertex = 3; if (argc > 2) { source_vertex = atoll(argv[2]); } /* get number of vertices */ uint64_t nv = stinger_max_active_vertex (S); nv++; print_fragmentation_stats (S, nv); stinger_free_all (S); return 0; }
print_initial_graph_stats (nv, ne, batch_size, nbatch, naction); BATCH_SIZE_CHECK(); #if defined(_OPENMP) OMP(omp parallel) { OMP(omp master) PRINT_STAT_INT64 ("num_threads", (long int) omp_get_num_threads()); } #endif update_time_trace = xmalloc (nbatch * sizeof(*update_time_trace)); /* Convert to STINGER */ tic (); S = stinger_new (); stinger_set_initial_edges (S, nv, 0, off, ind, weight, NULL, NULL, -2); PRINT_STAT_DOUBLE ("time_stinger", toc ()); fflush(stdout); free(graphmem); tic (); uint32_t errorCode = stinger_consistency_check (S, nv); double time_check = toc (); PRINT_STAT_HEX64 ("error_code", (long unsigned) errorCode); PRINT_STAT_DOUBLE ("time_check", time_check); /* Updates */ int64_t ntrace = 0;