# CS代考 SOFT3410 Assignment 2 – cscodehelp代写

SOFT3410 Assignment 2
Due: 11:59pm Wednesday, 25 November 2020
This assignment is worth 20% of your final assessment
The objective is to write a program that will model the static heat distribution of a room with a fireplace using a stencil pattern. Although a room is 3 dimensional, we will be simulating the room with 2 dimensions. The room is 10 feet wide and 10 feet long with a fireplace along one wall as depicted in Figure 1. The fireplace is 4 feet wide and is centered along one wall (it takes up 40% of the wall, with 30% of the walls on either side). The fireplace emits 100◦C of heat (although in reality a fire is much hotter). The walls are considered to be 20◦C. The boundary values (the fireplace and the walls) are considered to be fixed temperatures. The room temperature is initialized to 20◦C.
We can find the temperature distribution by dividing the area into a fine mesh of points hi,j . The tem- perature at an inside point can be taken to be the average of the temperatures of the four neighboring points, as illustrated in Figure 2.

The first line specifies the number of cores that are available on the machine. You will need to take this into account when you are optimising the performance of your program when using parallelism.
This is followed by the the dampening factor to be used in the algorithm and the total number of web pages. The names of the web pages follow, one per line, where each name may be a maximum of 20 characters long. After declaring the names of the web pages, the number of edges in the graph is given, followed by each edge in the graph specified by its source and destination page.
The read_input function outputs error and will terminate if there is invalid input, or there are any memory allocation errors, or a page name exceeds the maximum length, or the dampening factor is not in the range 0 ≤ d ≤ 1, a page is declared twice, or an edge is defined to a nonexistent page.
2 0.85 4
A
B
C
D
5 DA DB DC BA BC
This example has four web pages with names A, B, C, and D
There are five edges: D → A, D → B, D → C, B → A, and B → C
The output is the list of scores per web page
A 0.0686
B 0.0481
C 0.0686
D 0.0375
The scores are ordered in the same order they were defined in the input.
Forprintingthescore,usetheformatstring”%s %.4lf

For all test cases set ε = 0.005, use the constant defined as EPSILON
SOFT3410
Page 9 of 10

Marking
Before you attempt to write optimised code, you should first complete a working unoptimised version. Once you have the basic algorithm correct you can then begin to implement various optimisations.
7 marks are assigned based on your code submission and the correctness of your program.
This component will use our own test cases that cover every aspect of the specification. To pass test cases your solution must produce the correct output within a reasonable time limit. With the given scaffold, do not modify sections that have been outlined.
8 marks are assigned based on the report of your solution and comparison to your single threaded implementation. Observe, document and explain the performance behaviours through your own benchmark suite.
For your submission, your code submission must be uploaded onto USYD Github under the repo name soft3410a2p2. We will only consider the last submission before 11:59pm, 25th November, 2020.
You must also submit your report to canvas portal by 11:59pm, 25th November, 2020.
Note: Part 2 contains 5 bonus points.