Skip to content
/ CP-431 Public

All my code for my Parallel Programming class.

License

Notifications You must be signed in to change notification settings

SherRao/CP-431

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parallel Programming 🔨

A compilation of all assignments from CP431 - Parallel Programming course, written in C / Python / Cython using MPI on the Teach Cluster.

Breakdown 📌

Assignment 1

  • Determines the largest gap between a pair of consecutive prime numbers, up to 1, 000, 000, 000, 000 (one trillion).

Usage

To post a job to the scheduler, use mpicc to compile your code to a file called "main".

mpicc main_no_gmp.c -o main -lgmp -lmpi

Then, simply run the shell script (TIME -> HH:MM:SS)

sbatch start_job.sh <TIME>

Assignment 2

  • Implements a parallel merging algorithm to merge two sorted arrays of numbers.

Useful Commands 📝

Compilation

mpicc -o <FILE> <file.c>

Run MPI

mpirun <FILE>

Run NUM copies of the program on set nodes

mpicc test.c -o test
mpirun -np <NUM> ./test

Use hardware threads as independent CPUs

mpirun -np <NUM> --use-hwthread-cpus ./test