You are on page 1of 3

Assignment no.

2
Due Date: 10th November 2023

Q1. Execute the following code on PVM and show the screenshots of output in your solution.

# Import the PVM module

import pvm3

# Initialize PVM

pvm3.pvm_init()

# Get the number of tasks and your task ID

numtasks, mytid = pvm3.pvm_mytid()

# Define the message to be sent

message = "Hello, World!"

# Create a buffer for the message

bufid = pvm3.pvm_initsend(pvm3.PvmDataDefault)

# Pack the message into the buffer

pvm3.pvm_pkstr(message)

# Broadcast the message to all tasks

pvm3.pvm_bcast(pvm3.PvmTaskGroup, bufid, pvm3.PvmDataTag)


# Finalize PVM

pvm3.pvm_exit()

if mytid == 0:

print(f"{mytid}: {message}")

# End of the program

Compile your program: pvmgmake hello_pvm.py

Start PVM and execute your program on multiple hosts

pvm> add hostname1 4

pvm> add hostname2 4

pvm> spawn hello_pvm.py

Q2. Write a PVM program to add two numbers.


Q3. Write a PVM program to multiply 3x3 matrices.
Q4. Compare and contrast a socket vs. a remote procedure call using diagrams?
Q5. Implement multiplication of two numbers using Remote Procedure Call in Python. Figure 1
is given below for your understanding.

FIGURE 5
Q6. Describe in detail the different forms of coordination involved in Publish Subscribe
architecture.
Q7. What are the various distributed computing architectural styles prevalent these days.
Elaborate using diagrams and examples.
Q8. Explain the concept of “proxy” in remote object. Support your answer with diagram.
Q9. What is “binding” at client side in distributed object. Elaborate using diagrams.
Q10. What are the responsibilities of server side stub. Describe using diagrams and examples.
*****

You might also like