Running MPI Program
Familiarize yourself with how to execute an MPI program for your system. For this manual, we will use mpiexec for launching an MPI job, but your system my require srun, mpirun, or some other method. Contact your local system administrator if you are unfamiliar with using MPI on your system.
Generate or Ingest Input Graph
To generate an input RMAT graph, a few parameters must be set. As an example:
1 $ mpiexec -np 4 src/generate_rmat -s 17 -o outgraph
This configures the following settings:
- -np 4 – Number of MPI processes
- -s 17 – the Scale of the graph (Log2 the number of vertices)
- -o test_rmat – The base filename for graph storage. There will be one file per MPI rank, each with a unique name based on this string
To ingest an input graph from a simple edge list, run:
1 mpiexec -np 4 src/ingest_edge_list -o outgraph [Files...]
- -np 4 – Number of MPI processes
- -o test_rmat – The base filename for graph storage. There will be one file per MPI rank, each with a unique name based on this string
- [Files...] – Input edge list files. Can be split over multiple files. Each file is read independently to achieve parallel I/O
The edge list format is a simple ASCII edge list, for example:
0 1
1 2
2 3
3 0
Once the number of MPI processes has been chosen during graph construction or ingestion, it must be set to the same value for subsequent algorithms.
Run Breadth-First Search
To run BFS on a previously constructed graph, test_rmat, run:
1 $ mpiexec -np 4 src/run_bfs -i outgraph -s 0
This runs BFS with the following settings:
- -np 4 – Number of MPI processes
- -i outgraph – The base filename for graph storage
- -s 0 – Source vertex for BFS traversal
Run Triangle Counting Algorithm
To count triangles on a previously constructed graph, test_rmat, run:
1 $ mpiexec -np 4 src/run_triangle_count test_rmat