Skip to content

Commit 43e57ee

Browse files
committed
Unify sectioning for transition path of the tutorial
1 parent 1a12990 commit 43e57ee

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ALP_Transition_Path_Tutorial.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
\section{Introduction to ALP and Transition Paths}\label{sec:intro}
1+
\section{ALP Transition Paths}\label{sec:intro}
22

33
\textbf{Algebraic Programming (ALP)} is a C++ framework for high-performance linear algebra that can auto-parallelize and auto-optimize your code. A key feature of ALP is its transition path APIs, which let you use ALP through standard interfaces without changing your existing code. In practice, ALP generates drop-in replacements for established linear algebra APIs. You simply re-link your program against ALP's libraries to get optimized performance (no code modifications needed). ALP v0.8 provides transition-path libraries for several standards, including the NIST Sparse BLAS and a CRS-based iterative solver interface (ALP/Solver). This means you can take an existing C/C++ program that uses a supported API and benefit from ALP's optimizations (such as vectorization and parallelism) just by linking with ALP's libraries [1].
44

55
One of these transition paths, and the focus of this tutorial, is ALP's \textbf{sparse Conjugate Gradient (CG) solver}. This CG solver accepts matrices in Compressed Row Storage (CRS) format (also known as CSR) and solves $Ax=b$ using an iterative method. Under the hood it leverages ALP's non-blocking execution model, which overlaps computations and memory operations for efficiency. From the user's perspective, however, the solver is accessed via a simple C-style API that feels synchronous. In this workshop, we'll learn how to use this CG solver interface step by step: from setting up ALP, to coding a solution for a small linear system, to building and running the program.
66

7-
\section{Setup: Installing ALP and Preparing to Use the Solver}\label{sec:setup}
7+
\subsection{Setup: Installing ALP and Preparing to Use the Solver}\label{sec:setup}
88

99
This section explains how to install ALP on a Linux system and compile a simple example. ALP (Algebraic Programming) provides a C++17 library implementing the GraphBLAS interface for linear-algebra-based computations.
1010

11-
\subsection{Installation on Linux}
11+
\subsubsection*{Installation on Linux}
1212

1313
\begin{enumerate}
1414
\item Install prerequisites: Ensure you have a C++11 compatible compiler (e.g. \texttt{g++} 4.8.2 or later) with OpenMP support, CMake (>= 3.13) and GNU Make, plus development headers for libNUMA and POSIX threads.
@@ -67,7 +67,7 @@ \subsection{Installation on Linux}
6767
(ALP's documentation provides details on which libraries to link for each backend [3].) Using grbcxx is recommended for simplicity, but it's good to know what happens under the hood. Now that our environment is set up, let's look at the CG solver API.
6868

6969

70-
\section{Overview of ALP's Non-Blocking Sparse CG API}\label{sec:api}
70+
\subsection{Overview of ALP's Non-Blocking Sparse CG API}\label{sec:api}
7171

7272
The ALP/Solver transition path provides a C-style interface for initializing and running a Conjugate Gradient solver. All functions are exposed via a header (e.g. solver.h in ALP's include directory) and use simple types like pointers and handles. The main functions in this API are:
7373

@@ -84,7 +84,7 @@ \section{Overview of ALP's Non-Blocking Sparse CG API}\label{sec:api}
8484
This API is non-blocking in the sense that internally ALP may overlap operations (like sparse matrix-vector multiplications and vector updates) and use asynchronous execution for performance. However, the above functions themselves appear synchronous. For example, sparse\_cg\_solve will only return after the solve is complete (there’s no separate “wait” call exposed in this C interface). The benefit of ALP’s approach is that you, the developer, don’t need to manage threads or message passing at all. ALP’s GraphBLAS engine handles parallelism behind the scenes. You just call these routines as you would any standard library. Now, let’s put these functions into practice with a concrete example.
8585

8686

87-
\section{Example: Solving a Linear System with ALP’s CG Solver}
87+
\subsection{Example: Solving a Linear System with ALP’s CG Solver}
8888

8989
Suppose we want to solve a small system $Ax = b$ to familiarize ourselves with the CG interface. We will use the following $3 \times 3$ symmetric positive-definite matrix $A$: $$ A = \begin{pmatrix} 4 & 1 & 0\\
9090
1 & 3 & -1\\

ALP_Tutorial.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,13 +663,11 @@ \section{Solution to Exercise 8}\label{sec:simple_example}
663663
$
664664
\end{lstlisting}
665665

666-
667-
668-
\section{Makefile and CMake Instructions}\label{sec:build_instructions}
666+
\subsection{Makefile and CMake Instructions}\label{sec:build_instructions}
669667

670668
Finally, we provide guidance on compiling and running the above example in your own development environment. If you followed the installation steps and used \texttt{grbcxx}, compilation is straightforward. Here we outline two approaches: using the ALP wrapper scripts, and integrating ALP manually via a build system.
671669

672-
\subsection*{Using the ALP compiler wrapper}
670+
\subsubsection*{Using the ALP compiler wrapper}
673671

674672
The simplest way to compile your ALP-based program is to use the provided wrapper. After sourcing the ALP environment (setenv script), the commands \texttt{grbcxx} and \texttt{grbrun} are available in your PATH. You can compile the example above by saving it (e.g. as \texttt{example.cpp}) and running:
675673
\begin{lstlisting}[language=bash]
@@ -688,7 +686,7 @@ \subsection*{Using the ALP compiler wrapper}
688686

689687
(You can also run \texttt{./example} directly for a non-distributed run; \texttt{grbrun} is mainly needed for orchestrating distributed runs or setting up the execution environment.)
690688

691-
\subsection*{Using a custom build (Make/CMake)}
689+
\subsubsection*{Using a custom build (Make/CMake)}
692690

693691
If you prefer to compile without the wrapper (for integration into an existing project or custom build system), you need to instruct your compiler to include ALP's headers and link against the ALP library and dependencies. The ALP installation (at the chosen \texttt{--prefix}) provides an include directory and a library directory.
694692

@@ -723,3 +721,4 @@ \subsection*{Using a custom build (Make/CMake)}
723721
\bigskip
724722

725723
This tutorial has introduced the fundamentals of using ALP/GraphBLAS in C++ on Linux, from installation to running a basic example. With ALP set up, you can explore more complex graph algorithms and linear algebra operations, confident that the library will handle parallelization and optimization under the hood. Happy coding!
724+

main.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ \section*{Acknowledgements}
9191
\small This document was generated on \today.
9292
9393
\end{document}
94+

0 commit comments

Comments
 (0)