DTS205TC Lab2

DTS205TC High Performance Computing School of AI and Advanced Computing Lab 2
I certify that I have read and understood the University’s Policy for dealing with Plagiarism, Collusion and the Fabrication of Data (available on Learning Mall Online). With reference to this policy I certify that:
• My work does not contain any instances of plagiarism and/or collusion. My work does not contain any fabricated data.
By uploading my assignment onto Learning Mall Online, I formally declare that all of the above information is true to the best of my knowledge and belief.
Module code and Title
School Title
Assignment Title
Submission Deadline
Final Word Count
If you agree to let the university use your work anonymously for teaching and learning purposes, please type “yes” here.
Scoring – For Tutor Use
Student ID
Stage of Marking
Marker Code
Learning Outcomes Achieved (F/P/M/D) (please modify as appropriate)
Final Score
1st Marker – red pen
IM Initials
The original mark has been accepted by the moderator (please circle as appropriate):
Data entry and score calculation have been checked by another tutor (please circle):
Moderation – green pen
2nd Marker if needed – green pen
For Academic Office Use
Possible Academic Infringement (please tick as appropriate)
Date Received
Late Penalty
☐ Category A
☐ Category B ☐ Category C ☐ Category D ☐ Category E
Total Academic Infringement Penalty (A,B, C, D, E, Please modify where necessary) _____________________

Github
DTS205TC High Performance Computing Lab 2
Deadline: April 10th, 2023 @ 23:59 (UTC+8 Beijing) Percentage in final mark: 10%
Maximum score: 20 marks
Learning outcomes assessed: A, C
Late policy: 10% of the total marks available for the assessment shall be deducted from the assessment mark for each working day after the submission date, up to a maximum of five working days.
• Please read the coursework instructions and requirements carefully. Not following these instructions and requirements may result in loss of marks.
• Plagiarism results in award of ZERO mark.
• The formal procedure for submitting coursework at XJTLU is strictly followed. Submission link on
Learning Mall will be provided in due course. The submission timestamp on Learning Mall will be used to check late submission.
Chatting is a usual web application. We simulate two chatters, A and B, with program(s). Among them, A reads the user input and sends it to B; B reverses the message and converts it to uppercase, and prints it to the screen. The basic process is as follows:
message = ”
global message
message = input()
global message
message = message[::-1].upper()
if __name__ == ‘__main__’: A()
B() print(message)

CS Help, Email: tutorcs@163.com
Among them, we use a global variable to achieve message passing between A and B. You need to modify the program to ensure that the program still exhibits the same visible behavior to the user, but its internal implementation can be different:
1) Place A in the main process and B in a sub-process (or place A and B in two sub-processes), and use the Array (or other shared memory classes) of Python’s multiprocessing module to transmit the message from A to B; (5 marks)
TIPS: To work with Array for string (list of char), you can use ord() to transform char to int, and use chr() to transform int to char.
2) Place A in the main process and B in a sub-process (or place A and B in two sub-processes), and use the Pipe of Python’s multiprocessing module to transmit the message; (5 marks)
3) Place A in the main process and B in a sub-process (or place A and B in one process, or place A and B in two sub-processes) on client side, and implement an UDP server in another program to transmit the message; (5 marks)
4) Place A in the main process and B in a sub-process (or place A and B in one process, or place A and B in two sub-processes) on client side, and implement an TCP server in another program to transmit the message. The TCP server also has two sub-processes, each of which listens to a unique port and interact with A or B. The TCP server uses Pipe to forward the message between its two sub- processes. (5 marks)
1) The practice is designed to deepen your understanding on networks. Do not call off-the-shelf
libraries.
2) If you have problem in deal with input() with multiprocessing, you can hard-code it in your
Programming Help, Add QQ: 749389476
Specific Marking Scheme
The tasks in this assessment can be divided into two categories:
✓ Programs: all.
Criteria(%) Exemplary Good Satisfactory Limited (100) (75) (50) (25)
Very Limited (0)
Demonstrated correctly implemented code that produces correct output. Excellent coding quality follows best practices.
The program runs correctly and gives the expected results. However, special cases are not fully considered, or the program performs redundant calculations.
Program basically works correctly for major functionality, however, with some conceptional problems.
The program implements some minor functionality, or incorrectly implements major functionality. There is a certain degree of misunderstanding about the requirements of the questions.
Program works incorrectly with limited attempt or irrelevant to the task.
Charts Presentation & Analysis
Excellent quality of report with clear structure, clear logic, concise writing, pleasing visual aids.
Most of the results in the chart are correct, but there is a certain degree of sloppy or wordy in the overview and analysis.
Moderate quality of report with basic structure, where writing and visual aids can be improved.
Only some of the results in the chart are correct, or some of them are not filled in. The analysis of the results was obviously biased.
Limited or no attempt of report.