#include #include #include void main(int argc, char **argv ) { int i,j,threads; int x[10]; int *sum_of_powers; int n=10; threads = atoi(argv[1]); //Set the number of threads if (!omp_get_dynamic()) omp_set_num_threads(threads); else { printf("ERROR: set OMP_DYNAMIC=FALSE\n"); exit(0); } printf("%d threads\n",omp_get_max_threads()); sum_of_powers = (int *) malloc(n * sizeof(int)); #pragma omp parallel for private(j) lastprivate(x) for (i=0; i