Oliy va o’rta-maxsus ta’lim vazirligi


Download 110.83 Kb.
Sana15.06.2023
Hajmi110.83 Kb.
#1477065
Bog'liq
Hamrayeva Gulandom


O’ZBEKISTON RESPUBLIKASI
OLIY VA O’RTA-MAXSUS TA’LIM VAZIRLIGI
SAMARQAND DAVLAT UNIVERSITETI
Intelektual tizimlar va kompyuter texnalogiyalari
FAKULTETI
Dasturiy injiniring yo’nalishi

104 - guruh talabasi
Hamrayeva Gulandomning
Parallel Dasturlash fanidan

5- LABORATORIYA ISHI


  1. Parallel direktivasining reduction optsiyasi orqali ushbu misolni ishlang.

//Parallel direktivasining reduction optsiyasi orqali ushbu misolni ishlang. 〖(675+8〗^5)+(1212*117*11)+〖(98+7〗^13)

#include
#include
#include
using namespace std;

int main()
{
double a=1;
#pragma omp parallel reduction(*:a) num_threads(5)
{
a=8;

}
cout<<675+a<
double n=1;
#pragma omp parallel reduction(+:n)num_threads(11)
{
n=1212*117;

}
cout<
double b=1;
#pragma omp parallel reduction(*:b) num_threads(13)
{
b=7;

}
cout<<98+b<
cout<<"natija:"<<675+a+n+98+b<
return 0;
}



Download 110.83 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling