Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 7 - a distributed computing service RWH March 9. 2018 The Homework This assignment puts together pickling and networks to build a simple distributed

image text in transcribed

Assignment 7 - a distributed computing service RWH March 9. 2018 The Homework This assignment puts together pickling and networks to build a simple distributed service. Use TCP to coordinate between a host and a server. The host will send a pickled object and the python source to the server. The server will run the python source with the pickle and return the results. Since the purpose of this excrcise is to write the communication code, we'll keep it simple. One server, and its program should add two numbers together and return them The object that gets pickled should have a resul entry The application the server runs should have a run method and send its pickled output (after invoking run) to stdout (sys.stdout) 1 use sys.argv to get the name of the pickled input 2 unpickle it 3 invoke the object's run nethod 4 pickle it to sys.stdout (There is a reason for this.) You'll nced to manually start both the host and server. (a full package like MPI has a method to start and synchronize servers.) Use localhost (127.0.0.1) for the IP address. It may be convenient to use two ports and make both host and server a tep client and a tcp server Host Create the link to the server. Create an instance of the data object, pickle it and send it to the server along with the python code needed to run the calculation. Wai for a eply Unpickle the reply and print the result Server Listen for the host's message. Receive both the pickled object and the python code write them as files Invoke the python code with the pickled file as a command line argument. Invoke the python code (HINT use the subprocess package and subprocess.check.output method to do this.) Return the pickled output to the host This sounds really complicated but you've done a the steps in previous homeworks (You have done them, haven't you?) Assignment 7 - a distributed computing service RWH March 9. 2018 The Homework This assignment puts together pickling and networks to build a simple distributed service. Use TCP to coordinate between a host and a server. The host will send a pickled object and the python source to the server. The server will run the python source with the pickle and return the results. Since the purpose of this excrcise is to write the communication code, we'll keep it simple. One server, and its program should add two numbers together and return them The object that gets pickled should have a resul entry The application the server runs should have a run method and send its pickled output (after invoking run) to stdout (sys.stdout) 1 use sys.argv to get the name of the pickled input 2 unpickle it 3 invoke the object's run nethod 4 pickle it to sys.stdout (There is a reason for this.) You'll nced to manually start both the host and server. (a full package like MPI has a method to start and synchronize servers.) Use localhost (127.0.0.1) for the IP address. It may be convenient to use two ports and make both host and server a tep client and a tcp server Host Create the link to the server. Create an instance of the data object, pickle it and send it to the server along with the python code needed to run the calculation. Wai for a eply Unpickle the reply and print the result Server Listen for the host's message. Receive both the pickled object and the python code write them as files Invoke the python code with the pickled file as a command line argument. Invoke the python code (HINT use the subprocess package and subprocess.check.output method to do this.) Return the pickled output to the host This sounds really complicated but you've done a the steps in previous homeworks (You have done them, haven't you?)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions