Operating Systems Assignment 3
- Compile with
gcc -pthread task1-1.c -o task1-1
' - Run with
./task1-1 <threadcount>
The results of tests using 1, 2, 5, 10, and 50 threads are found in the
test1-1\
directory.
- Compile with
gcc -pthread -D PTHREAD_SYNC task1-2.c -o task1-2
- Run with
./task1-2 <number_of_threads>
The results of tests using 1, 2, 5, 10, and 100 threads are found in the
test1-2\
directory.
- Compile with
gcc -pthread task1-3.c -o task1-3
- Run with
./task1-3 <number_of_students> <office_capacity>
For the following tasks, the number of threads can be changed using
export OMP_NUM_THREADS=<number>
.
Task 2.1 is found in the OpenMP/
directory.
- Compile with
gcc -fopenmp helloworld.c -o helloworld
- Run with
./helloworld
- Compile with
gcc -fopenmp task2-2.c -o task2-2
- Run with
./task2-2
The results using dynamic scheduling are located in 2-2results_dynamic.txt
.
The results using static scheduling are located in 2-2results_static.txt
.
- Compile with
gcc -fopenmp task2-3.c -o task2-3
- Run with
./task2-3
The output is recorded in 2-3results.txt
.
Change the values of N and M in the code (lines 19 and 20) to change the size
of the matrix.
Change the value of omp_set_num_threads() in the code (line 24) to change the
number of threads.
This program includes separate labelled blocks of code for each parallelization method. Comment out the unnecessary methods to test each method.
- Compile with
gcc -fopenmp task2-4.c -o task2-4
- Run with
./task2-4
- Compile with
gcc -fopenmp part3.c -o part3
- Run with
./part3 <number_of_students> <office_capacity>