PandA-2024.02
bfs.h
Go to the documentation of this file.
1 /*
2 Implementations based on:
3 Harish and Narayanan. "Accelerating large graph algorithms on the GPU using CUDA." HiPC, 2007.
4 Hong, Oguntebi, Olukotun. "Efficient Parallel Graph Exploration on Multi-Core CPU and GPU." PACT, 2011.
5 */
6 
7 #include <stdlib.h>
8 #include <inttypes.h>
9 #include <stdio.h>
10 #include <string.h>
11 #include "support.h"
12 
13 // Terminology (but not values) from graph500 spec
14 // graph density = 2^-(2*SCALE - EDGE_FACTOR)
15 #define SCALE 8
16 #define EDGE_FACTOR 16
17 
18 #define N_NODES (1LL<<SCALE)
19 #define N_EDGES (N_NODES*EDGE_FACTOR)
20 
21 // upper limit
22 #define N_LEVELS 10
23 
24 // Larger than necessary for small graphs, but appropriate for large ones
25 typedef uint64_t edge_index_t;
26 typedef uint64_t node_index_t;
27 
28 typedef struct edge_t_struct {
29  // These fields are common in practice, but we elect not to use them.
30  //weight_t weight;
31  //node_index_t src;
33 } edge_t;
34 
35 typedef struct node_t_struct {
38 } node_t;
39 
40 typedef int8_t level_t;
41 #define MAX_LEVEL INT8_MAX
42 
44 // Test harness interface code.
45 
46 struct bench_args_t {
51  edge_index_t level_counts[N_LEVELS];
52 };
53 
54 void bfs(node_t nodes[N_NODES], edge_t edges[N_EDGES], node_index_t starting_node, level_t level[N_NODES], edge_index_t level_counts[N_LEVELS]);
55 
struct Node nodes[7]
#define N_NODES
Definition: bfs.h:18
node_index_t starting_node
Definition: bfs.h:49
struct node_t_struct node_t
uint64_t node_index_t
Definition: bfs.h:26
node_index_t dst
Definition: bfs.h:32
int8_t level_t
Definition: bfs.h:40
unsigned edges[4545]
Definition: graph.h:25
#define N_LEVELS
Definition: bfs.h:22
edge_index_t edge_begin
Definition: bfs.h:36
uint64_t edge_index_t
Definition: bfs.h:25
struct edge_t_struct edge_t
int level
Definition: main.c:98
void bfs(node_t nodes[N_NODES], edge_t edges[N_EDGES], node_index_t starting_node, level_t level[N_NODES], edge_index_t level_counts[N_LEVELS])
Definition: bfs.c:9
#define N_EDGES
Definition: bfs.h:19
edge_index_t edge_end
Definition: bfs.h:37

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13