#include #include #include #include #include "mpi.h" #define CHUNKSIZE 10 #define N 100 void openmp_code(){ int nthreads, tid, i, chunk; float a[N], b[N], c[N]; for (i=0; i < N; i++) a[i] = b[i] = i * 1.0; // initailize arrays chunk = CHUNKSIZE; #pragma omp parallel shared(a,b,c,nthreads,chunk) private(i,tid) { tid = omp_get_thread_num(); if (tid == 0){ nthreads = omp_get_num_threads(); printf("Number of threads = %d\n", nthreads); } // printf("Thread %d starting...\n",tid); #pragma omp for schedule(dynamic,chunk) for (i=0; i