Testing Intel’s Parallel Studio
Part 1 – OpenMP Intel claims to bring simplified “end-to-end parallelism to Microsoft Visual Studio C/C++ developers with Intel® Parallel Studio” [1]. I used a simple OpenMP parallel HelloWorld program to study this new tool which comes as an add-on to Visual Studio 2008.The program listing is enclosed in Figure 1. 1: #include <omp.h> 2: #include <stdio.h> 3: // a function to consume cpu time: 4: void consume() { 5: int i; 6: long n=100000000; 7: double s=0; 8: for (i=1;i<n;i++) 9: s+=( double )1/( double )i; 10: } 11: int main ( int argc, char *argv[]) { 12: int th_id, nthreads=5; 13: omp_set_num_threads(nthreads); 14: #pragma omp parallel private (th_id) 15: { 16: th_id = omp_get_thread_num(); 17: consume(); 18: printf( "Hello World from thread %d\n" , th_id); 19: #pragma omp barrier 20: if ( th_id == 0 ) { 21:...