CSC 543 - Multiprocessing & Concurrent Programming, Spring 2024, Assignment 2 on parallelizing a pipeline.

Assignment 2 due by 11:59 PM on Thursday March 7 via make turnitin

See an example doc on using control-\ to see stack traces for a hung Java process on 2/6.
 

cd $HOME                  # places you into your login directory
mkdir multip              # all of your csc543 projects go into this directory
cd  ./multip                 # makes multip your current working directory
cp  ~parson/multip/CSC543s24ParallelDataflowAssn2.problem.zip  CSC543s24ParallelDataflowAssn2.problem.zip
unzip  CSC543s24ParallelDataflowAssn2.problem.zip    # unzips your working copy of the project directory
cd  ./CSC543s24ParallelDataflowAssn2                            # your project working directory

Perform all test execution on mcgonagall to avoid any platform-dependent output differences.
Here are the files of interest in this project directory. These are listed in order of STUDENT worklets.

These first three active classes require synchronization of two adjacent uses of a PrintStream file, see STUDENT 1-3 comments.

DistributionGenerator.java                          # 1st stage active class that invokes one of the Make* generators above.
StatisticalAnalysisGenerator.java               # 2nd stage active class that analyzes / reduces stage 1's output.
StatisticalAnalysisCSVSaver.java              # 3rd stage in pipeline writes entries to a CSV file for diffing.

There are two versions of the main pipeline constructor. You must update the second in STUDENT 4.
CSC543s24ParallelDataflowAssn2.java                # Pipeline builder and main per Figure 1 below.
                                                                               # make test0 tests this configuration of Figure 1.
CSC543s24VeryParallelDataflowAssn2.java        # Parallel pipelines builder and main per Figure 2 below. STUDENT 4.
                                                                               # make test1 tests this configuration of Figure 2.
                                                                               # make clean test tests them both
                                                                               # make testsingle tests the no-threads (main thread only) configuration of Figure 1.

runtest.sh                                                               # Test driver shell script, your STUDENT 5 is in here.
jcip-annotations.jar                                                 # Annotations for the textbook denote design intent.

You will make no changes to these updated files:

jcip-annotations.jar                                     # Annotations for the textbook denote design intent.
MakeUniform.java                                      # The three Make* classes makes a uniform, normal, & exponential                            
MakeNormal.java                                       # distribution respectively of pseudo-random numbers.  They require
MakeExponential.java                                # added field modifiers to make them thread-safe + some annotations.
TenTuple.java                                             # A simple, immutable data container.
FiveTuple.java                                            # Slightly more complicated immutable data container.

ELAPSED.ref                                              # Extracted run times after completion,
                                                                    #    _0 means
CSC543s24ParallelDataflowAssn2.java
                                                                    # _1 means
CSC543s24VeryParallelDataflowAssn2.java
# There is at least one BlockingQueue concrete class that does not work out of the box.
# You just have to document any that do not work per STUDENT 5. I did extra work to make them work.
ArrayBlockingQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 7.449 secs.
LinkedBlockingDeque_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 7.547 secs.
PriorityBlockingQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 7.653 secs.
DelayQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 7.897 secs.
LinkedTransferQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 7.962 secs.
SynchronousQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 8.135 secs.
LinkedBlockingQueue_1.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 10.026 secs.

SynchronousQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 26.886 secs.
LinkedBlockingQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 27.248 secs.
DelayQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 27.472 secs.
PriorityBlockingQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 27.679 secs.
LinkedTransferQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 27.789 secs.
ArrayBlockingQueue_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 28.624 secs.
LinkedBlockingDeque_0.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 29.986 secs.
ArrayBlockingQueue_single.txt.ref TOTAL ELAPSED TIME FOR PIPELINE = 42.765 secs.

We will discuss other .ref files in class.

Run make clean test for your final test and then make turnitin as before by the due date.
Late penalty is 10% per day after the deadline and no points after I go over the solution next class.


CSC523f23DataflowAssn2DF.png

Figure 1: Dataflow for
CSC543s24ParallelDataflowAssn2.java


CSC523f23DataflowSolution2DF.png


Figure 2: Dataflow for CSC543s24VeryParallelDataflowAssn2.java