Site icon Tutor Bin

UCI Implement Parallelization in Loops Paper

UCI Implement Parallelization in Loops Paper

Description

Use OMP to efficiently parallelize as many of the loops as you can. Some loops simply need the statement #pragma omp parallel for. Some loops also need a privacy clause. Some loops need a significant change to the internal logic in addition to a pragma directive.

For each loop that you do not parallelize, comment-out the loop.

There are 7 loops that can be parallelized efficiently, but you are only required to do 6 for full credit.

Feel free to run the code provided. If you make any modifications to the loops’ logic, it would be wise to print out the array and check that it still does what it should.

There are some little mistakes in the provided code that might be confusing you.

Loop C should start with n=0 (otherwise, the result won’t actually be the triangular numbers).

Loop I should not declare i since it was declared at the start of main.

The continuation condition for the inner loop in Loop I should be i<=n/2 rather than i<n/2 (otherwise, 4 gets labelled as prime).

The comment of Loop H should NOT use the term “fixed point.” It would be more correct to say “periodic point” or “accumulation point.”

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version