This project aims to implement a distributed Preconditioned Conjugate Gradient (PCG) solver using MPI.
-
Load CMake:
module load cmake
-
Create a build directory:
mkdir build cd build
-
Configure the project using CMake:
cmake -DCMAKE_BUILD_TYPE=Release ..
-
Compile the code:
make
This will create an executable named
pcg
in the build directory.
The goal is to solve distributed_pcg.cpp
file.
salloc -N 1 -A mp309 -t 10:00 --qos=interactive -C cpu srun -N 1 --ntasks-per-node <number of tasks> ./pcg -N <size of the matrix>
We will use only one node in this homework. Please change the number of tasks and the size of the matrix appropriately for your scaling experiments. For simplicity, we assume that the size of the matrix is a multiple of the number of tasks used. Note that the starter code only works for one task and it is not efficient.
Ensure that your write-up is located in your source directory, next to distributed_pcg.cpp. It should be named cs267XY_hw4.pdf with XY being your group ID.
cmake -DGROUP_NAME="YourGroupID XY" ..
make package
This second command will fail if the PDF is not present. Confirm that it worked using the following command. You should see output like:
demmel@perlmutter:~/HW4/build> tar tfz cs267XY_hw4.tar.gz
cs267XY_hw4/cs267XY_hw4.pdf
cs267XY_hw4/distributed_pcg.cpp
Then submit your cs267XY_hw4.tar.gz through bCourses.