Changes between Version 8 and Version 9 of Tour
- Timestamp:
- 09/21/18 10:54:19 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tour
v8 v9 769 769 770 770 {{{ 771 /* 772 OpenMP example program which computes the dot product of two arrays a and b 773 (that is sum(a[i]*b[i]) ) using explicit synchronization with a critical region. 774 Compile with gcc -O3 -fopenmp omp_critical.c -o omp_critical 775 */ 776 // Online source: http://users.abo.fi/mats/PP2012/examples/OpenMP/omp_critical.c 777 // permission obtained 778 771 779 #include <omp.h> 772 ... 780 #include <stdio.h> 781 #include <stdlib.h> 782 783 #ifdef _CIVL 784 #include <assert.h> 785 #endif 786 773 787 #define N 100 774 788 775 789 int main (int argc, char *argv[]) { 790 776 791 double a[N], b[N]; 777 792 double localsum, sum = 0.0; … … 812 827 assert(sum==328350); 813 828 #endif 829 814 830 exit(0); 815 831 }
