vault backup: 2023-10-18 12:39:55
This commit is contained in:
parent
a51ee5af5a
commit
9511d16667
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
18 Outubro 2023 - #CP
|
18 Outubro 2023 - #CP
|
||||||
|
|
||||||
|
https://www.ibm.com/docs/en/xl-c-aix/13.1.0?topic=descriptions-pragma-directives-parallel-processing
|
||||||
## Ex 1
|
## Ex 1
|
||||||
### a)
|
### a)
|
||||||
Running the code (first time):
|
Running the code (first time):
|
||||||
|
@ -15,7 +16,7 @@ Yes, since the threads do the same task (orderly printing ids) following the ord
|
||||||
|
|
||||||
NOTE: These threads use a fork-join architecture, aka both threads work simultaneously and when one ends, it waits for the other to finish their job to then end both threads and continuing on with the code.
|
NOTE: These threads use a fork-join architecture, aka both threads work simultaneously and when one ends, it waits for the other to finish their job to then end both threads and continuing on with the code.
|
||||||
### c)
|
### c)
|
||||||
It is dependant on the CPU availability in each clock cycle. A thread, when executed uses
|
It is dependant on the CPU availability in each clock cycle.
|
||||||
|
|
||||||
|
|
||||||
* * *
|
* * *
|
||||||
|
@ -64,4 +65,8 @@ The output is always the same, since the instruction ''''\#pragma omp barrier'''
|
||||||
### 3.2
|
### 3.2
|
||||||
![[Pasted image 20231018122801.png]]
|
![[Pasted image 20231018122801.png]]
|
||||||
|
|
||||||
O resultado é semelhante ao \#pragma omp ordered
|
O resultado é semelhante ao ''\#pragma omp for'', sendo que colocar ''ordered'' obriga a ordenação das threads conforme a forma sequencial de código.
|
||||||
|
|
||||||
|
|
||||||
|
## Ex 4
|
||||||
|
### 4.1
|
||||||
|
|
Loading…
Reference in a new issue