1: Introduction to Amazon EC2 and MPI
Zubair Nabi
April 17, 2013
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 1 / 13
Outline
1 Amazon EC2
2 Message Passing Interface
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 2 / 13
Outline
1 Amazon EC2
2 Message Passing Interface
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 3 / 13
Introduction
Elastic Compute Cloud (EC2) allows you to rent out virtual machinesand run them atop Amazon’s physical datacenters
Possible to choose from a number of machine configurationsI Vary in terms of processing power, memory configuration, and disk
space
Amazon Machine Image (AMI), which is a silo of preconfiguredoperating system stack and application software, is run atop these VMs
I Public AMIs work out-of-the-box with different application stacks, suchas those designed for LAMP, Drupal, etc.
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 4 / 13
Introduction
Elastic Compute Cloud (EC2) allows you to rent out virtual machinesand run them atop Amazon’s physical datacentersPossible to choose from a number of machine configurations
I Vary in terms of processing power, memory configuration, and diskspace
Amazon Machine Image (AMI), which is a silo of preconfiguredoperating system stack and application software, is run atop these VMs
I Public AMIs work out-of-the-box with different application stacks, suchas those designed for LAMP, Drupal, etc.
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 4 / 13
Introduction
Elastic Compute Cloud (EC2) allows you to rent out virtual machinesand run them atop Amazon’s physical datacentersPossible to choose from a number of machine configurations
I Vary in terms of processing power, memory configuration, and diskspace
Amazon Machine Image (AMI), which is a silo of preconfiguredoperating system stack and application software, is run atop these VMs
I Public AMIs work out-of-the-box with different application stacks, suchas those designed for LAMP, Drupal, etc.
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 4 / 13
Introduction
Elastic Compute Cloud (EC2) allows you to rent out virtual machinesand run them atop Amazon’s physical datacentersPossible to choose from a number of machine configurations
I Vary in terms of processing power, memory configuration, and diskspace
Amazon Machine Image (AMI), which is a silo of preconfiguredoperating system stack and application software, is run atop these VMs
I Public AMIs work out-of-the-box with different application stacks, suchas those designed for LAMP, Drupal, etc.
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 4 / 13
Introduction
Elastic Compute Cloud (EC2) allows you to rent out virtual machinesand run them atop Amazon’s physical datacentersPossible to choose from a number of machine configurations
I Vary in terms of processing power, memory configuration, and diskspace
Amazon Machine Image (AMI), which is a silo of preconfiguredoperating system stack and application software, is run atop these VMs
I Public AMIs work out-of-the-box with different application stacks, suchas those designed for LAMP, Drupal, etc.
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 4 / 13
Instances
Instances vary from Small to High-Memory Quadruple Extra Large andfrom Cluster GPU to High I/O Quadruple Extra Large
I M1 Small Instance:F 1.7 GB memoryF 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)F 160 GB instance storageF 32-bit or 64-bit platform
I High-Memory Quadruple Extra Large Instance:F 68.4 GB memoryF 26 EC2 Compute Units (8 virtual core with 3.25 EC2 Compute Units each)F 1690 GB instance storageF 64-bit platform
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 5 / 13
Instances
Instances vary from Small to High-Memory Quadruple Extra Large andfrom Cluster GPU to High I/O Quadruple Extra Large
I M1 Small Instance:F 1.7 GB memoryF 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)F 160 GB instance storageF 32-bit or 64-bit platform
I High-Memory Quadruple Extra Large Instance:F 68.4 GB memoryF 26 EC2 Compute Units (8 virtual core with 3.25 EC2 Compute Units each)F 1690 GB instance storageF 64-bit platform
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 5 / 13
Instances
Instances vary from Small to High-Memory Quadruple Extra Large andfrom Cluster GPU to High I/O Quadruple Extra Large
I M1 Small Instance:F 1.7 GB memoryF 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)F 160 GB instance storageF 32-bit or 64-bit platform
I High-Memory Quadruple Extra Large Instance:F 68.4 GB memoryF 26 EC2 Compute Units (8 virtual core with 3.25 EC2 Compute Units each)F 1690 GB instance storageF 64-bit platform
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 5 / 13
Instances (2)
Cluster GPU Quadruple Extra Large Instance:I 22 GB memoryI 33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core)I 2 x NVIDIA Tesla “Fermi” M2050 GPUsI 1690 GB instance storageI 64-bit platform
High I/O Quadruple Extra Large Instance:I 60.5 GB memoryI 35 EC2 Compute Units (16 virtual cores)I 2 SSD-based volumes each with 1024 GB of instance storageI 64-bit platform
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 6 / 13
Instances (2)
Cluster GPU Quadruple Extra Large Instance:I 22 GB memoryI 33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core)I 2 x NVIDIA Tesla “Fermi” M2050 GPUsI 1690 GB instance storageI 64-bit platform
High I/O Quadruple Extra Large Instance:I 60.5 GB memoryI 35 EC2 Compute Units (16 virtual cores)I 2 SSD-based volumes each with 1024 GB of instance storageI 64-bit platform
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 6 / 13
Storage
Normal instances do not provide persistent storage
Changes made to a VM are lost upon termination
To remedy this, Elastic Block Store (EBS) can be used
Persistent virtual drives that give the illusion of network-attachedstorage
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 7 / 13
Storage
Normal instances do not provide persistent storage
Changes made to a VM are lost upon termination
To remedy this, Elastic Block Store (EBS) can be used
Persistent virtual drives that give the illusion of network-attachedstorage
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 7 / 13
Storage
Normal instances do not provide persistent storage
Changes made to a VM are lost upon termination
To remedy this, Elastic Block Store (EBS) can be used
Persistent virtual drives that give the illusion of network-attachedstorage
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 7 / 13
Storage
Normal instances do not provide persistent storage
Changes made to a VM are lost upon termination
To remedy this, Elastic Block Store (EBS) can be used
Persistent virtual drives that give the illusion of network-attachedstorage
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 7 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
S3
Storage with a simple web services interface
Web interface used to store and retrieve data, at any time, fromanywhere on the web
The unit of storage allocation is a bucket which is a container forobjects
Objects consist of object data and some metadata (key/value pairs)
Each object has a unique identifier, a key, within a bucket
Updates are atomic at the key level
Automatic replication across multiple servers
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 8 / 13
Outline
1 Amazon EC2
2 Message Passing Interface
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 9 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machines
Interface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operations
F Synchronous, asynchronous, and buffered variantsI Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologies
I Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairs
I Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computations
I Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
MPI
Language-independent communications protocol to build parallelapplications within and across machinesInterface to define virtual topology, synchronization, andcommunication between processes
I Point-to-point rendezvous-type send/receive operationsF Synchronous, asynchronous, and buffered variants
I Cartesian or graph-centric logical process topologiesI Exchanging data between process pairsI Aggregating partial results of computationsI Synchronizing nodes
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 10 / 13
Features
Used for distributed memory parallelism (shared-nothing systems)
Highly efficient: Can be used for many different models of computation,therefore can be used with many different applicationsUsed for SPMD-style coding
I Single Program, Multiple Data
Low-level therefore highly efficient
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 11 / 13
Features
Used for distributed memory parallelism (shared-nothing systems)
Highly efficient: Can be used for many different models of computation,therefore can be used with many different applications
Used for SPMD-style codingI Single Program, Multiple Data
Low-level therefore highly efficient
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 11 / 13
Features
Used for distributed memory parallelism (shared-nothing systems)
Highly efficient: Can be used for many different models of computation,therefore can be used with many different applicationsUsed for SPMD-style coding
I Single Program, Multiple Data
Low-level therefore highly efficient
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 11 / 13
Features
Used for distributed memory parallelism (shared-nothing systems)
Highly efficient: Can be used for many different models of computation,therefore can be used with many different applicationsUsed for SPMD-style coding
I Single Program, Multiple Data
Low-level therefore highly efficient
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 11 / 13
Example: Hello World!
1 #include<stdio.h>2 #include<mpi.h>34 int main (int argc, char ∗argv[])5 {
6 int rank, size;
78 MPI_Init(&argc, &argv);
9 MPI_Comm_rank(MPI_COMM_WORLD , &rank);
10 MPI_Comm_size(MPI_COMM_WORLD , &size);
11 printf("Hello world on process %d of total %d\n", rank, size);
12 MPI_Finalize();
13 return 0;
14 }
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 12 / 13
References
Running a website on Amazon EC2:http://www.diginmotion.com/faq/108-running-a-website-on-amazon-ec2.pdf
Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 13 / 13