Time comparison between intial serial version and parallel versions, are rolling on the wiki.
In this lab work you are given a working version of the projet. It will compile and run and produce results, although the execution will be slow as all the given implementations for the patterns are sequential. You are asked to study the given code a create parallel versions of the patterns using Cilk+.
You are given a (almost working) version of the project at https://bitbucket.org/cp201819/project_parallel_patterns.git This repository contains two directories/folders: srcanddoc. The former contains the base source code, and the latter will contain your Project Report as a PDF file. Please name your report asreport_AAAAA_BBBBB_CCCCC.pdf, whereAAAAA,BBBBBandCCCCCare the numbers of the group members sorted in increasing order (lowest to highest).
Fork the above repository and name your groups repository as cp2018-19_project_AAAAA_BBBBB_CCCCC.pdf whereAAAAA,BBBBBandCCCCCare the numbers of the group members sorted in increasing order (lowest to highest).
In your Linux device (own laptop, lab workstation, or as a last resort, in the “node9” server used in the last lab class) clone your new repository and then try compile your code using the commandmakein thesrcdirectory. It must compile with no errors nor warnings.
debug.c
debug.h
main.c
patterns.c
patterns.h
unit.c
unit.h
The project include the following source files:
Files Description
- debug.c debug.h: Functions for printing the contents of the array(s), useful for debugging (activated with the option “-d”).
- patterns.c patterns.h: The patterns to be implemented. The “.c” file contains empty functions.
- unit.c unit.h: Functions for unit testing of each pattern.
- main.c: The main program.
Your job is to make an optimized parallel version (using Cilk+) of all the patterns listed in the files patterns.c/patterns.h!.
You may follow these steps:
- Clone/fork the given project.
- Compile the given version. Study the source code and understand how it works.
- Discuss with your colleagues how to split the work.
- Implement a sequential version of each pattern.
- Compile and run the tests and confirm the results.
- Implement a parallel version of each pattern.
- Compile and run the tests and confirm the results.
- For each pattern, measure its perfocrmance/scalability/scaled scalability. You may experiment with different numbers of processors (by setting the environment variableCILK_NWORKERS).
- Optimize the given code.
- Go back to item 7. until satisfied.
- Write the report. Revise the report. Please put your report in thedocdirectory and name it asreport_AAAAA_BBBBB_CCCCC.pdf, whereAAAAA,BBBBBandCCCCCare the numbers of the group members sorted in increasing order (lowest to highest).
- Optional: implement and optimize some more parallel patterns.
- Optional: implement and share some more tests (unit or integration tests).
- Optional: complete the report and revise again.
Please remember to commit regularly your changes, and please always write mean- ingful commit messages.
Please ask your questions using the Piazza system. Either public (if possible) or private (if really necessary).
Code submission - 30/11/18
Report - 02/12/18
Last commit ID to Google Drive sheet.