Changes between Version 8 and Version 9 of Tour


Ignore:
Timestamp:
09/21/18 10:54:19 (8 years ago)
Author:
wuwenhao
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tour

    v8 v9  
    769769
    770770{{{
     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
    771779#include <omp.h>
    772 ...             
     780#include <stdio.h>
     781#include <stdlib.h>
     782
     783#ifdef _CIVL
     784#include <assert.h>
     785#endif
     786
    773787#define N 100
    774788
    775789int main (int argc, char *argv[]) {
     790 
    776791  double a[N], b[N];
    777792  double localsum, sum = 0.0;
     
    812827  assert(sum==328350);
    813828#endif
     829
    814830  exit(0);
    815831}