This repository contains C++ snippets that use Message Passing Interface (MPI) libraries and OpenMP to implement parallel programs.
Developed for CPSC 479 - High Performance Computing
Docker is used to maintain compatibility across differernt systems
Alpine-MPICH is the custom Docker image of Alpine Linux that contains a portable implementation of MPI standard.
MPICH also works if you have a Linux machine.
- Clone this repository
git clone https://github.com/EvilErick16/HPC.git
- Navigate to project directory
cd HPC/
- Run the Docker container
./run
- Now that image is running you should see the following as your terminal prompt
/project $
Navigate to a sub-directory for the project you want to run
Compile C++ source code with the following command
mpic++ [source.cpp] -o [executable]
then run the executable file with the following command
mpirun -n 2 ./[executable]
the above command will run on 2 processors, replace the 2 for the number of processors you want the program to run on