vault backup: 2023-10-18 12:09:55

This commit is contained in:
Alice 2023-10-18 12:09:55 +01:00
parent e188b087ba
commit bb2a7f80cf
5 changed files with 31 additions and 5 deletions

View file

@ -17,6 +17,8 @@ NOTE: These threads use a fork-join architecture, aka both threads work simultan
### c)
It is dependant on the CPU availability in each clock cycle. A thread, when executed uses
* * *
## Ex 2
### 2.1 - \#pragma omp for
![[Pasted image 20231018115329.png]]
@ -26,6 +28,30 @@ Thread 0 -> ids 0-49
Thread 1 -> ids 50-99
#### b)
Yes, since it is statically distributed.
#### c)
### 2.2 - \#pragma omp master
![[Pasted image 20231018120028.png]]
#### a)
There is a distribution of literally all the prints on the first thread created. There is a static distribution of instructions to the first thread created - the thread master.
Thread 0 -> ids 0-99
#### b)
Yes, since it is statically distributed.
### 2.3 - \#pragma omp single
![[Pasted image 20231018120219.png]]
#### a)
There is a distribution of literally all the prints on the first thread created. There is a static distribution of instructions to one of the threads randomly.
Thread 0/1 -> ids 0-99
#### b)
Yes, since it is statically distributed.
#### c) \#pragma omp critical
![[Pasted image 20231018120412.png]]
There is a restriction on the thread access to the printing - each thread is forced to complete the entirety of the task and it cannot end the printing until it is completed with its task.
****
### Ex 3