0% found this document useful (0 votes)
16 views14 pages

Lab Manual - LP V - LA 3

Uploaded by

Aayush Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views14 pages

Lab Manual - LP V - LA 3

Uploaded by

Aayush Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Progressive Education Society’s

MODERN COLLEGE OF ENGINEERING

Department of Information Technology

LAB MANUAL
Distributed System

Lab Practice - V

Class:-BE Course:-2019
P.E.S’s Modern College of Engineering, Pune-05.
Department of Information Technology

Lab Manual
Subject Code & Name: 414454 LP - V (2019 Pat)
Class: BE
Semester: II

Compiled by:
Mrs. Sampada A. Kulkarni
Ms. Shoma S. Mitkari
VISION AND MISSION OF THE INSTITUTE

Vision Statement:
To create a collaborative academic environment to foster professional excellence and ethical
values

Mission Statement:
1. To develop outstanding professionals with high ethical standards capable of creating and
managing global enterprises
2. To foster innovation and research by providing a stimulating learning environment
3. To ensure equitable development of students of all ability levels and backgrounds
4. To be responsive to changes in technology, socio-economic and environmental conditions
5. To foster and maintain mutually beneficial partnerships with alumni and industry

VISION AND MISSION OF THE DEPARTMENT

Vision Statement:
To develop proficient IT engineers for the benefit of Industry and Society.

Mission Statement:
1. To achieve academic excellence.

2. To develop students for being competent in dynamic IT environment.

3. To encourage research and innovation.

4. To inculcate moral and professional ethics.

PEO’s OF THE DEPARTMENT


1. Demonstrate sustained learning by building the profound foundation of math’s, science and
engineering principles and make the students erudite self reliant and adaptable to diverse culture
of multidisciplinary environment.
2. Prepare graduate with strong knowledge and skills in the field of Information Technology to
develop solutions of complex engineering problems.
3. To bring leadership skill with teamwork in continuous learning environment to bear with
professional challenges.
4. To inculcate ethics towards issues of professional and social relevance.

PSO’s OF THE DEPARTMENT

1. Graduate exhibits skills to analyze, design and develop software.


2. Graduate demonstrate technical competency and leadership qualities to work in multidisciplinary
environment.

Course Objectives
● The course aims to provide an understanding of the principles on which the distributed systems
are based, their architecture, algorithms and how they meet the demands of Distributed
applications.

● The course covers the building blocks for a study related to the design and the implementation
of distributed systems and applications.

Course Outcomes

1. Demonstrate knowledge of the core concepts and techniques in distributed systems.


2. Learn how to apply principles of state-of-the-Art Distributed systems in practical application.
3. Design, build and test application programs on distributed systems
INDEX

Sr. Page
Title
No. No.
Implement multi-threaded client/server Process communication
1.
using RMI.
Develop any distributed application using CORBA to
2. demonstrate object brokering.
(Calculator or String operations).
Develop a distributed system, to find sum of N elements in an
array by distributing N/n elements to n number of processors
3.
MPI or OpenMP. Demonstrate by displaying the intermediate
sums calculated at different processors.
4. Implement Berkeley algorithm for clock synchronization.
5. Implement token ring based mutual exclusion algorithm.
6. Implement Bully and Ring algorithm for leader election.
Create a simple web service and write any distributed
7.
application to consume the web service.
Mini Project (In group): A Distributed Application for
8.
Interactive Multiplayer Games
Assignment No: 3
Title / Objective: MPI

Problem Statement: Develop a distributed system, to find sum of N elements in an array by distributing
N/n elements to n number of processors MPI or OpenMP. Demonstrate by displaying the intermediate
sums calculated at different processors.

Course Outcome:

CO No. CO Statement BTL


C414454.1 Demonstrate knowledge of the core concepts and Apply
techniques in distributed systems.

Pre-requisites: Computer Network Technology

Study Material: (Blogs / Videos / Courses / Web Sites / Books / e-Books)

A. For Prerequisites –

B. For Assignment -

Requirements: openmpi-4.1.4.tar.bz2.

Theory:

OpenMP:

OpenMP is an Application Program Interface (API) that may be used to explicitly direct multi-threaded,
shared memory parallelism in C/C++ programs. It allows developers to easily write shared-memory
parallel applications. A shared memory model runs on a single system and utilizes its multiple
processing units or cores to achieve concurrent computation using the same memory space. OpenMP
provides high-level compiler directives.

It is not intrusive on the original serial code in that the OpenMP instructions are made in pragmas
interpreted by the compiler.

OpenMP uses the fork-join model of parallel execution. All OpenMP programs begin with a single
master thread which executes sequentially until a parallel region is encountered, when it creates a team
of parallel threads (FORK). When the team threads complete the parallel region, they synchronize and
terminate, leaving only the master thread that executes sequentially (JOIN).

This includes #prgma omp parallel, used to identify which parts of the code need to run
concurrently #pragma omp critical to identify critical sections. It then automatically deals with many of
the low-level complications like handling threads (each core's line of execution) and locks (constructs
used to avoid problems like race and deadlock). It even handles reductions and compiles the results of
each thread into a final answer.

Fig – Open MP Structure

Algorithm / Methods / Steps:

1. Download openmpi-4.1.4.tar.bz2 from http://www.open-mpi.org in a folder say LP5.


2. Goto the terminal (Command prompt)
3. Update using
sudo apt-get update
sudo apt install gcc {if not already installed}
4. Goto the directory which contains the downloaded file
5. Extract the files using
tar -jxf openmpi-4.1.4.tar.bz2
6. The directory openmpi-4.1.4 is created
7. Configure, compile and install by executing the following commands
./configure --prefix=$HOME/opt/openmpi
make all
make install
8. Now openmpi folder is created in ‘opt‘ folder of Home directory.
9. Now the folder LP5 can be deleted (optional)
10. Update the PATH and LD_LIBRARY_PATH environment variable using
echo "export PATH=\$PATH:\$HOME/opt/openmpi/bin" >> $HOME/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/opt/openmpi/lib">>$HOME/.bashrc
11. Compile the program using
mpicc name of the program
12. Execute the program using
mpirun -np N ./a.out

Implementation and Execution:


Proposed output:

Inference:

A distributed system is developed, to find sum of N elements in an array by distributing N/n elements
to n number of processors MPI or OpenMP.

Oral questions:

1. What is MPI?
2. What is OpenMP?
3. What is difference between OpenMP and OpenMPI?
4. How can OpenMP threads permanently allocate memory on GPUs?
5. Is OpenMP multiprocessing or multithreading?
6. Is OpenMP parallel or concurrent?
7. How many threads can OpenMP use?
8. What are the different types of synchronization in OpenMP?
9. Does OpenMP use multiple cores?
10. What is the advantage of OpenMP?
11. How many cores does OpenMP use?
12. What is default in OpenMP?
13. What is the limit of threads?
14. How many threads can be active?
15. Can OpenMP be used more than one node?
16. Is OpenMP a compiler?
17. Which compiler supports OpenMP?
18. Is OpenMP shared memory or distributed memory?
19. How many processors does OpenMP have?
20. What is thread in OpenMP?
21. What is master thread in OpenMP?
22. What are the disadvantages of OpenMP?
23. What is the difference between thread and process in OpenMP?
24. What are the primary components of OpenMP?

You might also like