Contributors: Kyriafinis Vasilis
Winter Semester 2021 - 2022
The objective of this project is to distribute n-dimensional points to multiple processes depending on the distance of each point from a randomly selected pivot point. The closest points to the pivot must end up to the first process and the furthest points from the pivot must end up to the last process. There is no need for the points of a single process to be sorted.
The framework used for the implementation is openMPI. OpenMPI is a messaging system allowing processes running on different processors to communicate and exchange information.
To setup this repository on your local machine run the following commands on the terminal:
git clone https://github.com/Billkyriaf/pds_assignment_2.git
Or alternatively download and extract the zip file of the repository
This project uses make utilities to build and run the executables.
The version of openMPI used in this project is (Open MPI) 4.1.2
. You can download it and find more information here.
To run individual data files a Makefile is provided. To build and run the application cd
to the root directory of the project and follow these steps:
-
make clean
: Clean thebuild
directory. -
make build_mpi
: Build the binary executable. -
make run_mpi args
: Run the executable with provided arguments.Mandatory arguments: argv[1]: The path to the data file argv[2]: One of the following: v: Verbose output for the executable nv: Non verbose output for the executable (Minimum information are printed to the console) help: Displays help message and exits
To adjust the number of hosts edit the slots in the hostfile.
Examples:
make run_mpi datasets/data.bin v # This will run the program with verbose output
make run_mpi help # This will display help message and exit
To run multiple files at once use the benchmarks.sh
. Give execute
rights to the script file with chmod +x benchmarks.sh
and run the script with ./benchmarks.sh
.
The script accepts certain arguments described bellow:
Usage ./benchmarks.sh [OPTION]...
Runs a series of tests with the MPI executable and the data files found in the directory specified"
OPTIONS:
-d {directory} The directory containing the datasets. This is mandatory and the
data files must have .bin extension.
-v true || false || one Verbose output for the executable. Values:
true: All runs are verbose
false: All runs are non verbose
one: Only the first run is verbose (Default if not provided)
-n {processes} The number of processes. Must be a power of 2!! Default is 8.
-h Help message for the executable
-u Usage for this script
Example usage:
./benchmarks.sh -v -d ./datasets
To to create random data files a Makefile is provided. To build and run the application cd
to the root directory of the project and follow these steps:
make create_datafile
: Creates a random binary data file withdimension
20
and8388608
points. The file is saved in thedatasets
directory with namedata.bin
. This file is quite big (1.3GB) so you may want to adjust this in theMakefile
. Simply change the numbers in theMakefile
. The first argument is the dimension of the space and the second is the number of points.