ompexamples: OpenMP Examples

Description Usage Arguments Details

Description

There are 3 examples, each using OpenMP, across 4 implementations: C, C++, F77, and F2003.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

Arguments

x

A numeric vector for the sum example, and a numeric matrix for the sweep example.

vec

A numeric vector the same length as the number of rows as x.

n

The number from the "primes below" example, where the function returns the total number of primes below n.

Details

The _hello() functions are simple hello worlds. Note that the order of printing by the threads is not guaranteed.

The _sum() functions sum up a numeric vector.

The _sweep() functions sweep a numeric vector from a numeric matrix, provided the vector is exactly the length of the number of columns of the matrix. This is equivalent to a special case of sweep(x, STATS=vec, MARGIN=1, FUN="-").

The _primesbelow() functions compute the number of prime integers below a given (positive) integer.


wrathematics/Romp documentation built on May 4, 2019, 9:48 a.m.