The purpose of this assignment is introduction to programming in Partitioned Global Address Space (PGAS) languages.
You need to parallelize a solution of the 0-1 knapsack problem. You have N items with positive integer weights w, ..., w[N] and values v, ..., v[N]. The goal is to find a subset of the items such that its total weight does not exceed given bag capacity C and its total value is the largest possible.
We consider solving the problem using dynamic programming. Define T[i,j] to be the maximum value that can be attained with weight ≤ i using items 1, ..., j. Then it satisfies the following recurrence relation:
The value of the optimal solution is found at T[C,N]. Backtracking over the choices gives the items used in the solution.
The serial and parallel implementations that are set up to compile on the target platforms are given below. We will run this assignment on Franklin. Note that there is a Cray UPC compiler on Franklin and Hopper, but the naive code yields incorrect semantics when compiled with the Cray compiler.
You need is to get a reasonably good scaling versus the serial code on a sufficiently large problem. Consider using block row or block column layout, bulk communication and pipelined computation. Using UPC is a requirement.
You may work in groups of 2 or 3. Email the GSIs your write-up and source codes.