PLEASE ANSWER ACCORDING TO THE INSTRUCTIONS POSIX Threads (Data Decomposition Problem) COMP 350 For this programming assignment the use of the pthread library will be required. The problem is to read in a matrix from a given text file, use n threads to sum each row of the matrix. Your program will then find the row or rows with the maximum value. The maximum value and row number will be written to a file called output.txt. The program will receive input from the command line. For example: INPUT: [student@euler pgm] ./a.out 4 input.txt From the command line the number threads to create and the file to be read will be determined by the user. The input file will have this format: 6 1 2 3 4 5 6 2 2 2 2 2 2 3 3 3 3 3 3 1 1 1 1 1 1 0 0 0 0 0 0 10 9 8 7 6 OUTPUT: Output will be written to a file named output.txt . The format for your output should be: Maximum Row(s) and value: Row 5 40 The program name will be matrix.cpp and placed in your pgm directory.
PLEASE ANSWER ACCORDING TO THE INSTRUCTIONS
POSIX Threads (Data Decomposition Problem)
COMP 350
For this
in a matrix from a given text file, use n threads to sum each row of the matrix. Your program will then
find the row or rows with the maximum value. The maximum value and row number will be written to a
file called output.txt.
The program will receive input from the command line.
For example:
INPUT:
[student@euler pgm] ./a.out 4 input.txt
From the command line the number threads to create and the file to be read will be determined by the
user.
The input file will have this format:
6
1 2 3 4 5 6
2 2 2 2 2 2
3 3 3 3 3 3
1 1 1 1 1 1
0 0 0 0 0 0
10 9 8 7 6
OUTPUT:
Output will be written to a file named output.txt . The format for your output should be:
Maximum Row(s) and value:
Row 5 40
The program name will be matrix.cpp and placed in your pgm directory.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images