:repeat: Relaxation technique using POSIX threads (shared memory configuration) and MPI (distributed memory configuration).
The objective of this assignment is to use low-level primitive parallelism constructs, first on a shared memory architecture then on a distributed memory architecture, and analyse how parallel problems scale on such an architectures using C, pthreads and MPI on Balena, a mid-sized cluster with 2720 cpu cores.
The background is a method called relaxation technique, a solution to differential equations, which is achieved by having a square array of values and repeatedly replacing a value with the average of its four neighbours, excepting boundaries values which remain fixed. This process is repeated until all values settle down to within a given precision.
make
, or gcc main.c array_helpers.c print_helpers.c -o shared_relaxation -pthread -Wall -Wextra -Wconversion
./shared_relaxation <number_of_threads>
make
or: mpicc -Wall -Wextra -Wconversion main.c -o distributed_relaxation -lm
mpirun -np <num_processes> ./distributed_relaxation -d <dimension> -p <precision> -debug <debug mode>
where:
ssh [user_name]@balena.bath.ac.uk
cd
into the project directory and submit the SLURM job script job.slurm
to the queue: sbatch jobscript.slurm
squeue -u [user_name]
relaxation.<job_id>.out
file using the cat *.out
command../submit_multiple_batch 1
cat *.out
\=.(\d+)\..(\d+)
and pasting the output in regex101from BUCS to Balena: cp $BUCSHOME/dos/year\ 4/Relaxation-Technique-Parallel-Computing/src/<file> /home/o/aj645/scratch/cw2-distributed-architecture/
from Balena to BUCS: cp /home/o/aj645/scratch/cw2-distributed-architecture/<file> $BUCSHOME/dos/year\ 4/Relaxation-Technique-Parallel-Computing
See TODO.md