Rad by som na svojom pc spustil tento kod
#include <stdio.h>
#include <time.h>
#include <omp.h>
int main() {
double start, end;
double runTime;
int num = 1,primes = 0;
int limit = 1000000;
start = omp_get_wtime();
#pragma omp parallel for schedule(dynamic) reduction(+ : primes)
for (num = 1; num <= limit; num++) {
int i = 2;
while(i <= num) {
if(num % i == 0)
break;
i++;
}
if(i == num)
primes++;
// printf("%d prime numbers calculated\n",primes);
}
end = omp_get_wtime();
runTime = end - start;
printf("This machine calculated all %d prime numbers under %d in %g seconds\n",primes,limit,runTime);
return 0;
}
a vyuzil pri nom vsetky moje jadra avsak visualko mi zatazi iba jedno a to konkretne 2.
Nasiel som si nejaky rady tupu pridat /MP(project/properties/C/command line) ale zatial nic nefunguje
Preto budem rad, ak sa najde niekto, kto nieco take ma na svojom pc nastavene a povie mi ako to nastavit