#include #include #include int main(int argc, char **argv) { int i,j,threads; int x[10]; int *sum_of_powers; int n=10; /* Set number of threads equal to argv[1] if present */ if (argc > 1) { threads = atoi(argv[1]); if (omp_get_dynamic()) { omp_set_dynamic(0); printf("called omp_set_dynamic(0)\n"); } omp_set_num_threads(threads); } printf("%d threads max\n",omp_get_max_threads()); sum_of_powers = (int *) malloc(n * sizeof(int)); /* Is the output the same if the lastprivate clause is commented out? */ #pragma omp parallel for private(j) lastprivate(x) for (i=0; i