Adventures in parallel computing using pthreads (shared memory) and MPI (distributed memory) during University. These projects were very interesting and insightful. The programs both perform a large computation (relaxing a 2D matrix).
Using gcc:
- Build using
gcc -o shared-memory.out main.c matrix.c -lpthread -Wall -Wextra -Wconversion
. - Run using
./shared-memory.out -a ARRAYSIZE -p PRECISION -w NUMBEROFTHREADS
.
Using mpicc:
- Build using
mpicc -Wall -Wextra -o distributed-memory.out main.c matrix.c
. - Run using
mpirun ./distributed-memory.out -a ARRAYSIZE -p PRECISION
.