#include #include #include long factorial(long n) { long i; for (i=n; i>1; i--) n *= i-1; return(n); } void main(int argc, char **argv ) { int i,j,threads; long *x; long 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()); x = (long *) malloc(n * sizeof(long)); for (i=0;i