lab 1: introduction to amazon ec2 and mpi

39
1: Introduction to Amazon EC2 and MPI Zubair Nabi [email protected] April 17, 2013 Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 1 / 13

Upload: zubair-nabi

Post on 18-Nov-2014

1.408 views

Category:

Technology


1 download

DESCRIPTION

Cloud Computing Workshop 2013, ITU

TRANSCRIPT

Page 1: Lab 1: Introduction to Amazon EC2 and MPI

1: Introduction to Amazon EC2 and MPI

Zubair Nabi

[email protected]

April 17, 2013

Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 1 / 13

Page 2: Lab 1: Introduction to Amazon EC2 and MPI

Outline

1 Amazon EC2

2 Message Passing Interface

Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 2 / 13

Page 3: Lab 1: Introduction to Amazon EC2 and MPI

Outline

1 Amazon EC2

2 Message Passing Interface

Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 3 / 13

Page 4: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 5: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 6: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 7: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 8: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 9: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 10: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 11: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 12: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 13: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 14: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 15: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 16: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 17: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 18: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 19: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 20: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 21: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 22: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 23: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 24: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 25: Lab 1: Introduction to Amazon EC2 and MPI

Outline

1 Amazon EC2

2 Message Passing Interface

Zubair Nabi 1: Introduction to Amazon EC2 and MPI April 17, 2013 9 / 13

Page 26: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 27: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 28: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 29: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 30: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 31: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 32: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 33: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 34: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 35: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 36: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 37: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 38: Lab 1: Introduction to Amazon EC2 and MPI

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

Page 39: Lab 1: Introduction to Amazon EC2 and MPI

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