1The Assignment 1 Specification and Marking CriteriaA Simplified Master/Worker FrameworkThis assignment is an individual work. Source code similarity is to be checked forplagiarism.The application backgroundVolunteer computing is to harness the donated computing cycles and temporary storage frommillions of internet volunteers for a computation task, which is too big to be processed by asingle computer in … Continue reading “Volunteer computing | My Assignment Tutor”
1The Assignment 1 Specification and Marking CriteriaA Simplified Master/Worker FrameworkThis assignment is an individual work. Source code similarity is to be checked forplagiarism.The application backgroundVolunteer computing is to harness the donated computing cycles and temporary storage frommillions of internet volunteers for a computation task, which is too big to be processed by asingle computer in a reasonable amount of time. The following web page outlines volunteercomputing.https://boinc.berkeley.edu/trac/wiki/VolunteerComputing, accessed on 26th Jan 2021The most successful volunteer computing framework is Berkeley Open Infrastructure forNetwork Computing (BOINC). BOINC is client/server architecture. The server (termed as master)creates a list of compute-tasks. Volunteer clients (termed as worker in BOINC) access the masterto download available compute-tasks. Workers perform the compute-tasks and upload theresults to the master. Optionally workers may be awarded credits by the master for theircontribution to computing cycles and temporary storage. Volunteer computing by using BOINCframework has been applied to many scientific projects such as SETI@home,Einstein@Home, and IBM World Community Grid. The following web pages introduce volunteercomputing and application projects.https://boinc.berkeley.edu/, accessed on 26th Jan 2021https://setiathome.berkeley.edu/, accessed on 26th Jan 2021https://einsteinathome.org/, accessed on 26th Jan 2021https://www.worldcommunitygrid.org/discover.action#introduction, accessed on 26th Jan 2021In this assignment, you are to develop a simplified master/worker framework. The Javanetworking models and components that you have practised from Week 1 to Week 4 of this unitare used to develop such a simplified framework. The models and components are theclient/server model, Java TCP streaming, multi-threading and object serialization. You will needto review the models and components and practise relevant lab projects of the weeks beforeyou start this assignment.Note: a separate document for demonstration of the system functions is available on the unitMoodle site. You will need to use the demonstration document as a part of the assignmentspecification. You will need to ensure that you fully understand the scenario and projectspecification before developing the project; you will also need to ensure the developed systemfulfilling the functional requirements as shown in the demonstration document.2The assignment specification is as follows.Part 1: Java TCP Streaming, Multi-threading and Object Serialization ProgrammingThe framework consists of a Master (i.e. server), a number of Workers (i.e. clients) and a ClassRepository in the Master. The framework is depicted in the following diagram. The framework isa generic computing architecture because the Master and Workers just need to know/follow theinteraction contract only so that they can interact with each other via the framework. Thespecification of the interaction contract is as follows.1. The interaction contractThe interaction contract between a Worker and the Master consists of:a. The Task interface defines two standard methods that every compute-task mustimplements.package Contract;public interface Task {public void executeTask();public Object getResult();}b. The TaskList class is a container that holds the titles and the class names of availablecompute-tasks.package Contract;import java.io.Serializable;public class TaskList implements Serializable{private String AvailableTasks[];private String TaskClassName[];public String[] getAvailableTasks() {return AvailableTasks;}public void setAvailableTasks(String[] AvailableTasks) {this.AvailableTasks = AvailableTasks;}public String[] getTaskClassName() {return TaskClassName;}public void setTaskClassName(String[] TaskClassName) {this.TaskClassName = TaskClassName;}} WorkerMasterClassrepositoryDownload compute-task classesTaskList or TaskObject (embeddedwith compute-tasks objects) 3c. The TaskObject class is a container that holds a particular compute-task object, its IDand credit.package Contract;import java.io.Serializable;public class TaskObject implements Serializable{private Integer TaskID=0;private Integer Credit=0;private Task TObject=null;public TaskObject() {}public Integer getTaskID() {return TaskID;}public void setTaskID(Integer TaskID) {this.TaskID = TaskID;}public Integer getCredit() {return Credit;}public void setCredit(Integer Credit) {this.Credit = Credit;}public Task getTObject() {return TObject;}public void setTObject(Task TObject) {this.TObject = TObject;}}The above interface and classes form a complete interaction contract between the Master andWorkers.2. The compute-taskThe Master has a class repository that holds the Java classes of available compute-tasks. Acompute-task must implement the Task interface. Executing the executeTask() methodwill perform the task and set the result. Calling the getResult() method will return theresult. A compute-task must implement java.io.Serializable interface so that thecompute-task can be transferred between the Master and a worker over the network. Thestructure of a compute-class is as follows.public class CalculatePi implements Task, Serializable{……@Overridepublic void executeTask() {//The implementation of method……}@Overridepublic Object getResult() {//The implementation of method……}//may have other methods……}43. The interaction workflow of the frameworkA Worker provides a user frontend to access the remote Master. A Worker just needs to followthe interaction contract only for volunteer computing. The interaction workflow betweenWorker and Mater includes:a. Workers connect to the Masterb. Workers download the available task list from the Masterc. Workers download some tasks from the Masterd. Workers perform the taskse. Workers upload computing results to the Master.The demonstration of interaction workflow between Workers and the Mater is in thedemonstration document on the unit Moodle site.4. The implementationTo complete this assignment, you need to implement such a framework and integrate theCalculate Pi, Calculate Primes and Calculate the Greatest Common Divisor tasks into thisframework. The algorithms of the tasks are given on the unit web site. The Master must bemulti-threaded and follow the ‘thread-per-connection’ architecture (reference Week-4contents). The communication between the Master and Workers must use TCP streaming byusing Java TCP API Socket and ServerSocket as described in Week-2 contents of this unit.Note: use of any other networking protocols will incur no marks to be awarded for this part.To implement the framework, you need to implement the following Java classes:a. A Java application to implement the Worker; a graphic user interface is required;b. A Java application to implement the Master; andc. A number of Java classes to implement the processing threads when necessary.d. Note: to demonstrate your competence in concurrency programming, you will need tomake an analysis on when concurrency is needed. Marks will be deducted if concurrencyis not identified or necessary multithreading is not used.e. A number of Java classes to implement Calculate Pi, Calculate Primes and Calculate theGreatest Common Divisor tasks.5Note: to simulate Master and Worker interaction, you don’t have to run them on two physicalmachines. Instead, they can be run on two JVMs (Java Virtual Machines) on a single physicalmachine. As a result, the name of the Master machine can be ‘localhost’.Part 2: Program use and test instructionAfter the implementation of the framework, prepare an end user’ instruction about how to useyour software. The instruction should cover all aspects of the framework as detailed in the Part2 of marking criteria below.SubmissionYou need to provide the following files in your submission.1. Files of Java source code of the Master, the Worker and the processing threads and thecompute-tasks. The in-line comments on the data structure and program structure in theprograms are required. The source code files must be able to be compiled by the standardJDK (Java Development Kit) or NetBeans IDE from Oracle.2. The compiled Java class files of the source code. The Java classes must be runnable on thestandard Java Runtime Environment (JRE) from Oracle.Note: an easy way to provide the source code and executables is to submit them in a NetBeansproject.3. A Microsoft Word document to address the issues as specified in Part 2 above.All the required files must be compressed into a zip file for submission. You must submit yourassignment via the unit web site. Any hardcopy or email submission will not be accepted. Afterthe marked assignments are returned, any late submissions will not be accepted.The Marking Criteria Marking CriteriaAvailable MarksPart 1: Java TCP streaming, Multi-threading and ObjectSerialization Programming211. The project can be compiled by JDK or NetBeans IDEand executed by JRE22. The given Task interface, TaskList andTaskObject classes are properly used as the uniquecommunication contract between Workers and theMaster3 6 3. The 3 compute-tasks can be successfully transferredbetween Workers and the Master34. The Master structure is sound as a TCP server25. Multithreading is used for the Master whenconcurrency exists26. The Worker’s user graphic interface is fullyimplemented27. The 3 compute-tasks can be successfully executed by aWorker and can return correct results to the Master38. TCP streaming is correctly used for file transfer29. TCP streaming is correctly used for object transfer2Part 2: Program use and test instruction91. The program compiling and installation is clearlydescribed22. The class repository in the Master is clearly described13. The test instruction covers all 3 compute-tasks34. Necessary screenshots have been provided and helpfulfor the test.25. Source code is readable and includes enough inlinecomments.1Sub Total for Assignment 130Late Penalty-1.5 (5%) each calendarday (either full orpartial)Plagiarism Related Penalty 7 Total for Assignment 1