Question: Programming in JAVA. Design objects using interface, inheritance, . . . etc. Note: a matrix.txt file is for the reference only. You need to open
This concurrent processing assignment has three objectives: To study and implement concurrent processing, multi-threading (mult-processing 2 To spis large problem into smaller ones of equivalent (almost equivalent if not possible to be equivalent) sizes, assign one thread to each and compute the result 3. To integrate (gather) the results from all threads as a single piece 4. To generate UML class diagram with object oriented design for concurrent processing 5. To construct a simple GUI to interact with user Given two integer matrices A and B, you need to perform matrix addition (A+ B Both matrices have N rows and M columns, IN>1 and M>1. You need to divide both matrices (A and 8) to four equal (or close to equal) size of submatrices (Ass, A,AAs and Ba Basa) and each submatrix has dimension of (N/2) x(M/2) or close to. You need to create four threads (processes) each thread (process) perform a subset of addition on one pair of the submatrices. Example, thread (process) 0 perform addition on Ace and Bs thread (process) 2 perform addition on Ass and B etc. Their result should store in matrix C of size N x M You also need to construct another thread (process) to interact with user via a simple GUIL The interaction include: 1) get user input, the name of the matrix fle. 2) Output the computation result with adequate formatting 3) Print the error messages 4) End the program upon uver request, such as push the END button. Note: you need to manage the case of odd nmber ofrows ad or odd r of column, matrices. Try to divide them into "almost" equivalence size of submatrices After start your program, java ThreadOperationTest, a Gul (similar to the Fig 26.10 of Chapter 26, page 26 19, the pdf file under Web Chapters of the Blackboard) pops up for ingut, output, and end action. The user enters the file name lany name, such as Mymatrices.tat) which stores the matrices and the format of the matrix file as follow. Your program opens the ile and acquires the contents of the two matrices A and B. Divide them into four submatrices, generates four threads (as described above) and assign each thread to compute one pair of the submatrices. Upon all threads complete their computations (additions). gather the results and output to the Guil using a text readable format Matrix File Format 1) the first line has two numbers, N and M (N rows, M columnsl the size of both matrices A and B 2) the next N lines each has M elements for one of the rows of A 3) the next N lines each has M elements for one of the rows ofB Example: 2 3 1 251 3 1 2 2 2 1 2 3 272 3 61 513 65414 3 3 221 7 54325 21 8484 For the above example, the result of the computation on the console should be 885394 6 44435 87759 7999 Instructions You need to name your main source file ThreadOperationTest java, other source file names should be meaningful to represent their function. Submit all your source files fincluding the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
