A point-wise matrix distances calculator, implemented in C/MP+MPI using distributed memory and parallel processing paradigms.
Implementation used: OpenMPI
- On Ubuntu:
$ sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev
- On RedHat/Centos:
$ sudo yum install openmpi openmpi-devel
$ export PATH=$PATH:/usr/lib/openmpi/bin
- On Fedora/Arch:
$ sudo dnf install openmpi openmpi-devel
$ source /etc/profile.d/modules.sh
$ module load mpi/openmpi-x86_64
- On MacOS
$ brew install open-mpi
- On Windows:
Download the wizard and install from the official Microsoft-MPI page, and add to the PATH environment variable if needed.
To test if the installation was successful, run:
$ make test # If successful, the output should be similar to:
MPI version: 3.1
OpenMP version (from macro _OPENMP): 201511
To compile and link all source code, and header files use:
$ make all
To run the main source file, use (where are arguments accepted by mpirun):
$ make run <N> <S> <T> [P=10]
Example:
$ make run N=100 S=42 T=4
Distância Manhattan mínima: 0 (soma min: 57015) e máxima: 287 (soma max: 2130946)
Distância Euclidiana mínima: 0.00 (soma min: 39607.81) e máxima: 165.71 (soma max: 1250695.85)
The Makefile also has a timing utility, which can be used to measure the execution time of the program. To use it, run:
$ make time <N> <S> <T> [P=10]
Example:
$ make time P=2 N=150 S=42 T=10
Calculating average time over 5 runs...
Average time: 5.778 seconds