COMBINATORIAL_BLAS  1.6
common.h File Reference
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  csr_graph
 

Macros

#define INT64_T_MPI_TYPE   MPI_LONG_LONG
 
#define SIZE_MUST_BE_A_POWER_OF_TWO
 
#define MOD_SIZE(v)   ((v) & size_minus_one)
 
#define DIV_SIZE(v)   ((v) >> lgsize)
 
#define VERTEX_OWNER(v)   ((int)(MOD_SIZE(v)))
 
#define VERTEX_LOCAL(v)   ((size_t)(DIV_SIZE(v)))
 
#define VERTEX_TO_GLOBAL(i)   ((int64_t)((i) * size + rank))
 

Typedefs

typedef struct csr_graph csr_graph
 

Functions

void setup_globals (void)
 
void free_csr_graph (csr_graph *const g)
 
void * xMPI_Alloc_mem (size_t nbytes)
 
void * xmalloc (size_t nbytes)
 
void * xcalloc (size_t n, size_t unit)
 
void * xrealloc (void *p, size_t nbytes)
 
void convert_graph_to_csr (const int64_t nedges, const int64_t *const edges, csr_graph *const g)
 
void find_bfs_roots (int *num_bfs_roots, const csr_graph *const g, const uint64_t seed1, const uint64_t seed2, int64_t *const bfs_roots)
 
int validate_bfs_result (const csr_graph *const g, const int64_t root, const int64_t *const pred, const int64_t nvisited)
 
void run_mpi_bfs (const csr_graph *const g, int64_t root, int64_t *pred, int64_t *nvisited)
 

Variables

int rank
 
int size
 
int lgsize
 
int size_minus_one
 

Macro Definition Documentation

◆ DIV_SIZE

#define DIV_SIZE (   v)    ((v) >> lgsize)

Definition at line 29 of file common.h.

◆ INT64_T_MPI_TYPE

#define INT64_T_MPI_TYPE   MPI_LONG_LONG

Definition at line 16 of file common.h.

◆ MOD_SIZE

#define MOD_SIZE (   v)    ((v) & size_minus_one)

Definition at line 28 of file common.h.

◆ SIZE_MUST_BE_A_POWER_OF_TWO

#define SIZE_MUST_BE_A_POWER_OF_TWO

Definition at line 18 of file common.h.

◆ VERTEX_LOCAL

#define VERTEX_LOCAL (   v)    ((size_t)(DIV_SIZE(v)))

Definition at line 35 of file common.h.

◆ VERTEX_OWNER

#define VERTEX_OWNER (   v)    ((int)(MOD_SIZE(v)))

Definition at line 34 of file common.h.

◆ VERTEX_TO_GLOBAL

#define VERTEX_TO_GLOBAL (   i)    ((int64_t)((i) * size + rank))

Definition at line 36 of file common.h.

Typedef Documentation

◆ csr_graph

typedef struct csr_graph csr_graph

Function Documentation

◆ convert_graph_to_csr()

void convert_graph_to_csr ( const int64_t  nedges,
const int64_t *const  edges,
csr_graph *const  g 
)

◆ find_bfs_roots()

void find_bfs_roots ( int *  num_bfs_roots,
const csr_graph *const  g,
const uint64_t  seed1,
const uint64_t  seed2,
int64_t *const  bfs_roots 
)

◆ free_csr_graph()

void free_csr_graph ( csr_graph *const  g)

◆ run_mpi_bfs()

void run_mpi_bfs ( const csr_graph *const  g,
int64_t  root,
int64_t pred,
int64_t nvisited 
)

◆ setup_globals()

void setup_globals ( void  )

◆ validate_bfs_result()

int validate_bfs_result ( const csr_graph *const  g,
const int64_t  root,
const int64_t *const  pred,
const int64_t  nvisited 
)

◆ xcalloc()

void* xcalloc ( size_t  n,
size_t  unit 
)

◆ xmalloc()

void* xmalloc ( size_t  nbytes)

◆ xMPI_Alloc_mem()

void* xMPI_Alloc_mem ( size_t  nbytes)

◆ xrealloc()

void* xrealloc ( void *  p,
size_t  nbytes 
)

Variable Documentation

◆ lgsize

int lgsize

◆ rank

int rank

◆ size

int size

◆ size_minus_one

int size_minus_one