Module 5
Module 5
1 Key
Concepts in Parallel Programming
Q.1 What are the various system issues for running a typical parallel program in either parallel or distributed
manner?
The various system issues for running a typical parallel program in either parallel or distributed manner
are:
1. Partitioning
• Computation Partitioning: Break the program into smaller tasks that can run at the same time.
• Data Partitioning: Split input data into chunks that different parts of the program can process in
parallel.
2. Mapping
• Assign the smaller tasks or data pieces to specific computing resources (like assigning jobs to
workers).
3. Synchronization
• Coordinates tasks to avoid:
o Race conditions: Two tasks trying to use the same resource.
o Data dependency: One task needing results from another.
4. Communication
• When tasks need to share data, they communicate over the network (especially in distributed
systems).
5. Scheduling
• Decides which task runs when, especially when there are more tasks than available workers.
Source: Pasted text(39).txt → Module 5 – Cloud Programming and Software Environments, Section [Link]
Running a Job in Hadoop and Figure 6.11 Hadoop Architecture
Q2. With a neat diagram explaining the data flow in running a MapReduce job at various task trackers using
Hadoop Library
Running a Job in Hadoop
When a MapReduce job is run in Hadoop, three main components are involved:
• User Node: Where the job is submitted from.
• JobTracker: Manages the job, tracks its progress, and assigns tasks.
• TaskTrackers: Run the actual map and reduce tasks on cluster nodes.
|
Step-by-Step Process
1. Job Submission
The user submits a job from their node to the JobTracker. Here's what happens:
• The user node:
o Requests a new job ID from the JobTracker.
o Splits the input files into chunks.
o Uploads necessary resources (JAR file, config, input splits) to the JobTracker’s file system.
o Calls the submitJob() function to officially submit the job.
2. Task Assignment
• The JobTracker:
o Creates one map task per input split.
o Assigns map tasks to TaskTrackers by considering data locality (to reduce data movement).
o Creates reduce tasks (number is set by the user).
o Assigns reduce tasks to TaskTrackers without locality considerations.
3. Task Execution
• Each TaskTracker:
o Copies the job's JAR file.
o Launches a Java Virtual Machine (JVM).
o Executes the assigned map or reduce task using instructions from the JAR.
4. Task Monitoring (Heartbeat Check)
• Each TaskTracker:
o Sends periodic heartbeat messages to the JobTracker.
o Heartbeats indicate that the TaskTracker is alive and whether it’s ready for new tasks.
Process Flow
1. The User submits a MapReduce job to the JobTracker.
2. JobTracker gets metadata from NameNode to know data locations.
3. JobTracker assigns tasks to TaskTrackers based on data locality.
4. TaskTrackers execute map and reduce tasks.
5. TaskTrackers send heartbeat messages to JobTracker.
6. Final output is stored in HDFS.
Source: Pasted text(39).txt → Module 5 – Cloud Programming and Software Environments, Section 6.3.1
Programming the Google App Engine
Q.3 Discuss Programming the Google App Engine
Programming the Google App Engine
Google App Engine (GAE) is a cloud platform that allows developers to build and host web applications on
Google's infrastructure. It supports languages like Java and Python, and provides built-in tools for scalable,
secure, and efficient cloud development.
1. Supported Languages & Tools
Java Support:
o Eclipse plug-in: Enables local debugging.
o GWT (Google Web Toolkit): Helps develop dynamic web apps in Java.
o Other JVM-based languages like JavaScript, Ruby are also usable via interpreters.
Python Support:
o Common frameworks include Django and CherryPy.
o Google provides a lightweight webapp framework for Python.
2. Data Management with Datastore
GAE Datastore:
o NoSQL, schema-less entity storage.
o Each entity:
▪ Max size: 1 MB.
Source: Pasted text(39).txt → Module 5 – Cloud Programming and Software Environments, Section 6.5.2
OpenStack and OpenStack Compute (Nova)
Q.4 With neat diagram explain OpenStack Nova system architecture
OpenStack Compute (Nova)
OpenStack is an open-source cloud platform started by Rackspace and NASA.
Focus:
• Compute (Nova)
• Storage (Swift)
OpenStack Compute (Nova) Architecture
• Message-based, shared-nothing architecture.
• Written in Python.
• Supports Amazon APIs (via boto).
Components
1. API Server
API Server provides the interface for accessing cloud services.
2. Cloud Controller
Cloud Controller manages the cloud infrastructure.
3. User Manager (LDAP)
User Manager uses LDAP for user management.
4. Networking Components
NetworkController (VLANs)
RoutingNode (NAT, firewalls)
TunnelingNode (VPN)
AddressingNode (DHCP)
Source: Pasted [Link] → Section [Link] Grids versus Clouds and BCS601 Module-1
Q.5 Write difference between cloud and grid computing
Clouds focus on automation and scalability. Grids are better for negotiated resource allocation.
Supports dynamic resource allocation based Relies heavily on LAN/WAN resources across enterprises,
on virtualization and autonomic computing. organizations, and governments.
i) Serverless computing
Not found in the provided content.
Source: Pasted text(41).txt → Chapter 4: Public Cloud Platforms: GAE, AWS, and Azure; Chapter 6:
Programming on Amazon AWS
Question: Explain AWS Services
Answer:
Amazon Web Services (AWS)
Amazon has been a leader in providing public cloud services. Amazon applies the IaaS model in providing
its services. EC2 provides the virtualized platforms to the host VMs where the cloud application can run. S3
(Simple Storage Service) provides the object-oriented storage service for users. EBS (Elastic Block Service)
provides the block storage interface which can be used to support traditional applications. SQS stands for
Simple Queue Service, and its job is to ensure a reliable message service between two processes.
Major AWS Services
1. Compute Services
Elastic Compute Cloud (EC2)
Amazon was the first company to introduce VMs in application hosting. Customers can rent VMs instead
of physical machines to run their own applications. By using VMs, customers can load any software of their
choice. The elastic feature of such a service is that a customer can create, launch, and terminate server
instances as needed, paying by the hour for active servers. Amazon provides several types of preinstalled VMs
called Amazon Machine Images (AMIs).
Elastic MapReduce
The Elastic MapReduce capability is equivalent to Hadoop running on the basic EC2 offering.
2. Storage Services
Simple Storage Service (S3)
Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of
data, at any time, from anywhere on the web. S3 provides the object-oriented storage service for users. The
fundamental operation unit of S3 is called an object. Each object is stored in a bucket and retrieved via a
unique developer-assigned key.
Key features of S3:
• Redundant through geographic dispersion
• Designed to provide 99.999999999% durability
• Provides 99.99% availability
• Authentication mechanisms ensure data security
• Supports per-object URLs and ACLs
Elastic Block Store (EBS)
The Elastic Block Store provides the volume block interface for saving and restoring virtual images of EC2
instances. Users can use EBS to save persistent data and mount to running instances of EC2. EBS allows
creation of storage volumes from 1 GB to 1 TB that can be mounted as EC2 instances.
3. Messaging Services
Simple Queue Service (SQS)
SQS ensures reliable message service between two processes. The message can be kept reliably even when
receiver processes are not running.
Simple Notification Service (SNS)
Amazon offers queuing and notification services (SQS and SNS) implemented in the AWS cloud.
5. Database Services
SimpleDB
SimpleDB provides a simplified data model based on the relational database model for storing, accessing,
and querying data.
Relational Database Service (RDS)
Amazon offers a Relational Database Service (RDS) with a messaging interface.
Source: Pasted [Link] – Module 5: Cloud Programming and Software Environments (6.1 Features of Cloud
and Grid Platform, Table 6.1, 6.1.2, Table 6.2, Table 6.3, Table 6.4)
Question: Explain the Features of Cloud and Grid Computing
Features of Cloud and Grid Computing
1. Physical or Virtual Computing Platform
The cloud environment consists of some physical or virtual platforms. Virtual platforms have unique
capabilities to provide isolated environments for different applications and users.
2. Massive Data Storage Service, Distributed File System
With large datasets, cloud data storage services provide large disk capacity and the service interfaces
that allow users to put and get data. The distributed file system offers massive data storage service. It can
provide similar interfaces as local file systems.
3. Massive Database Storage Service
Some distributed file systems are sufficient to provide the underlying storage service application
developers need to save data in a more semantic way. Just like DBMS in the traditional software stack, massive
database storage services are needed in the cloud.
4. Massive Data Processing Method and Programming Model
Cloud infrastructure provides thousands of computing nodes for even a very simple application.
Programmers need to be able to harness the power of these machines without considering tedious
infrastructure management issues such as handling network failure or scaling the running code to use all the
computing facilities provided by the platforms.
5. Workflow and Data Query Language Support
The programming model offers abstraction of the cloud infrastructure. Similar to the SQL language
used for database systems, in cloud computing, providers have built some workflow language as well as data
query language to support better application logic.
6. Programming Interface and Service Deployment
Web interfaces or special APIs are required for cloud applications: J2EE, PHP, ASP, or Rails. Cloud
applications can use Ajax technologies to improve the user experience while using web browsers to access the
functions provided. Each cloud provider opens its programming interface for accessing the data stored in
massive storage.
7. Runtime Support
Runtime support is transparent to users and their applications. Support includes distributed monitoring
services, a distributed task scheduler, as well as distributed locking and other services. They are critical in
running cloud applications.
8. Support Services
Important support services include data and computing services. For example, clouds offer rich data
services and interesting data parallel execution models like MapReduce.
Traditional Features Common to Grids and Clouds
1. Workflow
• Enables linking of cloud and non-cloud services for real-world applications.
• Popular tools: Pegasus, Kepler, Taverna, Trident (Microsoft).
• Workflows can run on both Windows and Linux environments.
2. Data Transport
• Data transfer in and out of commercial clouds can be slow and costly.
• Uses simple protocols like HTTP.
• High-speed links may be introduced for better performance in national infrastructure.
• Cloud data (e.g., Azure blobs) supports parallel processing.
3. Security, Privacy, and Availability
• Use of HTTPS/SSL for secure communication.
• Virtual clustering for dynamic resource provisioning.
• Persistent storage with fast query capabilities.
• Fine-grained access control to ensure data protection.
• Disaster recovery through live VM migration.
• Reputation systems to block unauthorized users or attackers.
Source: Distributed and Cloud Computing → Table 4.5 Five Major Cloud Platforms and Their Service
Offerings
Question: Distinguish between AWS, Azure, GCP, IBM Cloud
Answer:
Difference between AWS, Azure, GCP and IBM Cloud
Service EC2, S3, SQS, GFS, Chubby, SOA, B2, TSAM, RAD,
Live, SQL, Hotmail
Offerings SimpleDB BigTable, MapReduce Web 2.0
WebSphere2 and
Security PKI, VPN, EBS to Replicated data, rule- Chubby locks for
PowerVM tuned for
Features recover from failure based access control security enforcement
protection
Additional Points
AWS
Amazon pioneered the IaaS business in supporting e-commerce and cloud applications by millions of
customers simultaneously. EC2 provides an environment for running virtual servers on demand. S3 provides
unlimited online storage space.
Azure
Microsoft offers the Azure platform for cloud applications. It supports .NET service, Dynamic CRM,
Hotmail and SQL applications.
GCP
Google App Engine (GAE) offers a powerful web application development environment.
IBM Cloud
IBM cloud services include BlueCloud, RC2 and Ensembles.
Source: Module 5 – Cloud Programming and Software Environments → 6.2 Parallel and Distributed
Programming Paradigms
Question No: 2
Question: Discuss the challenges and system issues in running a typical parallel program in distributed
systems.
Answer:
Challenges and System Issues in Running a Typical Parallel Program in Distributed Systems
Running a parallel program on a distributed computing system has several advantages for both users and
distributed computing systems. From the users’ perspective, it decreases application response time; from the
distributed computing systems’ standpoint, it increases throughput and resource utilization. Running a parallel
program on a distributed computing system, however, could be a very complicated process.
The system issues for running a typical parallel program in either a parallel or distributed manner include:
1. Partitioning
Partitioning is applicable to both computation and data.
a) Computation Partitioning
• This splits a given job or a program into smaller tasks.
• Partitioning greatly depends on correctly identifying portions of the job or program that can be
performed concurrently.
• Upon identifying parallelism in the structure of the program, it can be divided into parts to be run on
different workers.
• Different parts may process different data or a copy of the same data.
b) Data Partitioning
• This splits the input or intermediate data into smaller pieces.
• Upon identification of parallelism in input data, it can be divided into pieces to be processed on
different workers.
• Data pieces may be processed by different parts of a program or a copy of the same program.
2. Mapping
• Mapping assigns either smaller parts of a program or smaller pieces of data to underlying resources.
• This process aims to appropriately assign such parts or pieces to be run simultaneously on different
workers.
• It is usually handled by resource allocators in the system.
3. Synchronization
• Because different workers may perform different tasks, synchronization and coordination among
workers is necessary.
• Synchronization prevents race conditions.
• It properly manages data dependency among different workers.
• Multiple accesses to a shared resource by different workers may raise race conditions.
• Data dependency happens when a worker needs processed data from other workers.
4. Communication
• Because data dependency is one of the main reasons for communication among workers,
communication is always triggered when intermediate data is sent to workers.
5. Scheduling
• When the number of computation parts (tasks) or data pieces is greater than the number of available
workers, a scheduler selects a sequence of tasks or data pieces to be assigned to workers.
• Resource allocators perform the actual mapping of computation or data pieces to workers.
• The scheduler only picks the next part from the queue of unassigned tasks based on scheduling policy.
• For multiple jobs or programs, a scheduler selects a sequence of jobs or programs to be run on the
distributed computing system.
• Scheduling is necessary when system resources are not sufficient to simultaneously run multiple jobs or
programs.
Source: Module 5 – Cloud Programming and Software Environments → [Link] Running a Job in Hadoop
Question No: 3
Question: With a neat diagram, explain the data flow during a MapReduce job using Hadoop.
Answer:
Data Flow during a MapReduce Job using Hadoop
Three components contribute in running a job in this system: a user node, a JobTracker, and several
TaskTrackers. The data flow starts by calling the runJob(conf) function inside a user program running on the
user node, in which conf is an object containing some tuning parameters for the MapReduce framework and
HDFS.
(Adapted from Figure 6.12: Data flow in running a MapReduce job at various task trackers using Hadoop
library)
Steps involved in Data Flow
1. Job Submission
Each job is submitted from a user node to the JobTracker node through the following procedure:
• A user node asks for a new job ID from the JobTracker and computes input file splits.
• The user node copies resources such as the job’s JAR file, configuration file, and computed input splits
to the JobTracker file system.
• The user node submits the job to the JobTracker by calling the submitJob() function.
2. Task Assignment
• The JobTracker creates one map task for each computed input split by the user node.
• It assigns the map tasks to execution slots of the TaskTrackers.
• The JobTracker considers localization of data while assigning map tasks.
• The JobTracker also creates reduce tasks and assigns them to TaskTrackers.
• The number of reduce tasks is predetermined by the user and no locality consideration exists for them.
3. Task Execution
• Task execution starts inside the TaskTracker by copying the job JAR file to its file system.
• Instructions inside the job JAR file are executed after launching a Java Virtual Machine (JVM) to run
map or reduce tasks.
Source: Pasted [Link] – Module 5: Cloud Programming and Software Environments, Section 6.3 Programming
Support of Google App Engine (GAE)
Question No: 4
Describe the programming model and environment provided by Google App Engine (GAE)
Google App Engine (GAE)
Google App Engine (GAE) is a cloud platform that allows developers to build and host web applications
on Google's infrastructure. It supports languages like Java and Python, and provides built-in tools for scalable,
secure, and efficient cloud development.
1. Supported Languages & Tools
Java Support
• Eclipse plug-in: Enables local debugging.
• GWT (Google Web Toolkit): Helps develop dynamic web apps in Java.
• Other JVM-based languages like JavaScript, Ruby are also usable via interpreters.
Python Support
• Common frameworks include Django and CherryPy.
• Google provides a lightweight webapp framework for Python.
2. Data Management with Datastore
GAE Datastore
• NoSQL, schema-less entity storage.
• Each entity:
○ Perform basic image operations like resize, crop, flip, rotate, and enhance.
5. Background Processing & Scheduling
• Cron Service:
○ GAE enforces quotas to prevent overuse and ensure fair resource allocation.
Source: Module 5 – Emerging Cloud Software Environments → [Link] OpenStack Compute (Nova)
Question No: 5
Question: Discuss the architecture and components of OpenStack Nova with a diagram.
Answer:
OpenStack Nova Architecture and Components
As part of its computing support efforts, OpenStack is developing a cloud computing fabric controller, a
component of an IaaS system known as Nova. The architecture for Nova is built on the concepts of shared-
nothing and messaging-based information exchange. Most communication in Nova is facilitated by message
queues. To prevent blocking components while waiting for responses from others, deferred objects are
introduced.
To achieve the shared-nothing paradigm, the overall system state is kept in a distributed data system. State
updates are made consistent through atomic transactions. Nova is implemented in Python and utilizes
externally supported libraries and components including boto and Tornado.
<HTTP>
Figure: OpenStack Nova System Architecture
3. User Manager
• Performs authorization using Lightweight Directory Access Protocol (LDAP).
4. Storage Nodes
• Use ATA over Ethernet for storage services.
5. Networking Components
a) NetworkController
• Manages address and VLAN allocations.
b) RoutingNode
• Governs NAT conversion of public IPs to private IPs.
• Enforces firewall rules.
c) AddressingNode
• Runs DHCP services for private networks.
d) TunnelingNode
• Provides VPN connectivity.
Source: Module 6 – Programming on Amazon AWS and Microsoft Azure; Public Cloud Platforms: GAE, AWS
and Azure
Question No: 6
Question: Explain the programming environments and tools provided by Amazon AWS and Microsoft Azure.
Answer:
Programming Environment and Tools provided by Amazon AWS
Amazon provides a flexible cloud computing platform for developers to build cloud applications. Small and
medium-size companies can put their business on the Amazon cloud platform. Using the AWS platform, they
can service large numbers of Internet users and make profits through those paid services.
Programming environment and tools include:
1. Amazon EC2
• Amazon was the first company to introduce VMs in application hosting.
• Customers can rent VMs instead of physical machines.
• Amazon provides several preinstalled VMs called Amazon Machine Images (AMIs).
• Customers can create, launch, and terminate server instances as needed.
2. Storage and Database Support
• Amazon offers Relational Database Service (RDS) with a messaging interface.
• Amazon has NoSQL support in SimpleDB.
• Amazon does not directly support BigTable.
3. Messaging Services
• Simple Queue Service (SQS)
• Simple Notification Service (SNS)
These are cloud implementations of messaging services.
4. Auto-scaling
• Automatically scales Amazon EC2 capacity up or down according to defined conditions.
• During demand spikes, instances scale up.
• During low demand, instances scale down to minimize cost.
5. Elastic Load Balancing
• Automatically distributes incoming application traffic across multiple Amazon EC2 instances.
• Avoids non-operating nodes and equalizes load on functioning images.
6. CloudWatch
• Web service that provides monitoring for AWS resources.
• Provides visibility into resource utilization and operational performance.
• Monitors CPU utilization, disk reads/writes and network traffic.
7. Elastic MapReduce
• Equivalent to Hadoop running on the basic EC2 offering.
Source: Pasted [Link] – Module 5: Cloud Programming and Software Environments, Section 6.5 Emerging
Cloud Software Environments
Question No: 7
Describe emerging cloud software environments and their significance in real-world applications
Emerging Cloud Software Environments
This section introduces open-source and research-oriented cloud platforms and tools designed to
support cloud programming, VM management, storage, and data processing across diverse infrastructures.
1. Eucalyptus
• Origin: UC Santa Barbara, commercialized by Eucalyptus Systems.
• Emulates Amazon EC2 and S3:
o Walrus = S3-like storage.
• Allows users to upload/manage VM images, bundle root filesystems, and register them for deployment.
Architecture & Features
• Supports VM lifecycle management and image repositories.
• Available in both open source and commercial versions.
2. Nimbus
• Open source IaaS cloud solution.
• Enables leasing remote resources via VM deployment.
• Nimbus Web: Django-based web interface for admin and user tasks.
Key Features
• Cumulus: S3-compatible storage system with quotas.
• Client Support: Works with EC2 clients, uses Java Jets3t, boto.
• Resource Pool Mode: Direct control of VM nodes.
• Pilot Mode: Works with local LRMS for VM provisioning.
3. OpenNebula
• Modular IaaS cloud platform.
• Manages full VM lifecycle and dynamic networking.
• Uses libvirt API, CLI, and cloud drivers for hybrid clouds (e.g., Amazon EC2, ElasticHosts).
Supports
• VM migration and snapshots.
• Capacity scheduler with rank/requirement model.
• Image repository for disk image management.
4. Sector/Sphere
• Designed for big data storage and parallel processing.
Sector (Storage)
• Wide-area DFS with replica placement based on network topology.
• Uses UDP for control, UDT for data.
• Integrated with FUSE and provides programming APIs.
Sphere (Processing)
• Works with Sector to process data using user-defined functions (UDFs).
• Emphasizes data locality and fault tolerance.
• Supports pipelining and chaining of Sphere segments.
5. OpenStack
• Open-source cloud platform started by Rackspace and NASA.
• Focus: Compute (Nova) and Storage (Swift).
OpenStack Compute (Nova)
• Message-based, shared-nothing architecture.
• Written in Python.
• Supports Amazon APIs (via boto).
6. Aneka Cloud
Aneka is a cloud platform for developing and running parallel and distributed applications, built on
.NET but supports Linux via Mono.
Key Capabilities
Build
• SDK with APIs for app development.
• Deploy on private, public, or hybrid clouds.
Accelerate
• Rapid deployment on multiple runtime environments.
• Dynamically lease public cloud resources to meet QoS/SLA deadlines.
Manage
• GUI + API-based infrastructure monitoring.
• Includes accounting, SLA tracking and dynamic provisioning.
Significance in Real-World Applications
Aneka Application of Maya Rendering – Case Study
GoFront Group, a leading Chinese manufacturer of railway equipment, needed to render high-quality
3D images for the design of high-speed trains and urban transport vehicles using Autodesk Maya software.
Rendering these complex designs on a single 4-core server used to take about three days. To solve this
problem and speed up the rendering process, GoFront used Aneka to build a private enterprise cloud by
connecting PCs within their company network. With just 20 PCs running Aneka, GoFront was able to reduce
the rendering time from three days to just three hours, dramatically improving productivity and design
turnaround time.
Deployment Flow
Local Development Environment
↓
Implementation of Application Logic
↓
Coding and Debugging
↓
Build and Test
↓
Upload using App Engine SDK
↓
Deploy to Google Infrastructure
↓
Automatic Scaling + Load Balancing