Information

Author(s) Erik-Jan Lingen, Matthias Möller
Deadline No deadline
Submission limit No limitation

Sign in

[OpenMP] Exercise 7 : Circular Array Shift

This material is part of the course Practical Introduction to Parallel Programming and meant for educational purposes only.


Task

Implement a parallel, circular array shift.

Here is the serial implementation of the algorithm:

const int  N = 100;
double     a[N];
double     t;
int        i;

t = a[N - 1];

for ( i = N - 1; i >= 1; i-- )
  a[i] = a[i - 1];

a[0] = t;

Question 1: Circular Array Shift
Question 2: OpenMP environment variables

Specify the OpenMP environment variables that should be used for running your program (export OMP_NUM_THREADS=1 ...). Use semicolons to separate multiple variables

Question 3: Command Line Argument

Specify the command line arguments that should be passed to your program when it is run. Arguments must be given in quotes and separated by commas. Leave this filed empty if you do not want to specify command line arguments.

Example: "1","int","arg=2" is interpreted as three arguments 1, int, and arg=2.