You are on page 1of 55

iCanCloud

A Cloud Computing Simulation Platform

University Carlos III of Madrid

Computer Science Department

Gabriel G. Castañé
Why ..
When we simulate ..

 To study the behaviour of components that we can 
not “see”: biology, chemistry, astrophysics.

 To study the behaviour of something without build 
it

 To test things that we can not reach or it does not 
exists
What is iCanCloud?

 iCanCloud  is  a  simulation  platform  aimed  to  model  and 


simulate  cloud  computing  environments  and  its  power 
consumed with a high level of scalability and flexibility.

Software available at: www.arcos.inf.uc3m.es/~icancloud/


Main features of iCanCloud

 Scalable to model large distributed system models

 Flexible to model different environments

 Easy to use with it’s own Graphical User Interface

 Portable to let users use their own platform

 Configurable to focus experiments in different scopes
Layers structure
 iCanCloud is written in C++
 iCanCloud has been built on the top of INET and OMNET++
­ It is an event­based simulation platform.
Simulation structure

Compound modules just group


Compound module
single modules

Single modules represent the


Single module
behavior of a specific component

Single Single
module module Parameters file (.ned)

Header file(.h)

Single module Implementation file(.cc)


Simulation structure

Computing node Each module can be composed by


other modules.

Network interface Main component could be:



the CPU or ..

Disk CPU

Memory
Simulation structure

Computing node Each module can be composed by


other modules.

Network interface Main component could be:



the CPU or ..

the cores of the CPU or ..

Disk c1 c2

Memory
Introduction

Computing node Each module can be composed by


other modules.

Network interface Main component could be:



the CPU or ..

the cores of the CPU or ..

the transistors of the cores ..
Disk
As much detail you want to reach:

Slow simulations

CPU and Memory requirements
Memory increases
Simulation structure
Module combinations -> different configurations

Computing node Computing node

Network interface
Network interface
Network interface

Disk CPU CPU CPU

Memory Memory
Basic Idea
Basic Idea
Basic Idea
Main components
Main components of a cloud system:
Architecture of iCanCloud

Users
Cloud Manager

Distributed system

Virtualization

Operative System

Energy Consumption

Hardware components
Architecture of iCanCloud
Control Processing Unit

Main Parameters (.ned):

double numCores;//Number of CPU cores

double speed; //CPU core speed (in MIPS)


double tick_s; //Tick time (in seconds)
Control Processing Unit
double speed; //CPU core speed (in MIPS)
double tick_s; //Tick time (in seconds)

Process Request for computing power:

Arrival of message → iCanCloud_cpu_request(double Mi);

instructionsPerSecond =((1/current_tick_s.dbl())*ipt)

coreTime = (requestedMI/instructionsPerSecond);

delay(coreTime);

(The core block the arrival..)

When the delay finishes → Send_Response_message();


Memory

Main Parameters
(.ned):

double readLatencyTime_s; // Latency time for read operations


double writeLatencyTime_s; // Latency time for write operations
double searchLatencyTime_s; // Latency time for search operations
double size_MB; // Memory size (in MB)
double blockSize_KB; // Block Size (in KB)

// Energy parameters
int numDRAMChips; // Chips per card
int numModules; // Number of connected slots
Storage

Main Parameters
(.ned):
double readBandwidth; // Bandwidth (in MB/s) for reads
double writeBandwidth; // Bandwidth (in MB/s) for writes

If a model is too simple .. we can make a new detailed one!


Architecture of iCanCloud

Users
Cloud Manager

Distributed system

Virtualization

Operative system

Energy Consumption

Hardware components
Power consumption
Power consumption
We have a component with 'n' states..

States S1 S2 S3 S4
.. Sn

Power
Values
W1
P1 W2
P2 W3
P3 W4
P4 .. Wn
Pt
Power consumption
We have a component with 'n' states..

States S1 S2 S3 S4 Sn

Power
P1 P2 P3 P4 Pt
Values

Time t1 t2 t3 t4 tn

◍ The energy consumed ¿by a component (with n states) is:


n
∑k=0 (P k∗t k )
Architecture of iCanCloud

Users
Cloud Manager

Distributed system

Virtualization

Operative system

Energy Consumption

Hardware components
Node Structure

GENERIC NODE
Node Structure

GENERIC NODE
Architecture of iCanCloud

Users
Cloud Manager

Distributed system

Virtualization

Operative System

Energy Consumption

Hardware components
Virtualization

Virtual Machines
◍ User applications are executed in VMs

◍ VMs requests are mapped to the corresponding HW system

◍ VMs have not real resources!

Hypervisor
◍ Each node has its own hypervisor

◍ The hypervisor has a scheduler per HW system

◍ There is an API to program scheduling policies
Virtualization
Main idea of virtualization in iCanCloud:
Architecture of iCanCloud

Users
Cloud Manager

Distributed System

Virtualization

Operative System

Energy Consumption

Hardware components
Build a distributed system
Architecture of iCanCloud

Users

Cloud Manager
Distributed System

Virtualization

Operative System

Energy Consumption

Hardware components
Cloud Manager
Architecture of iCanCloud

Users

Cloud Manager

Distributed System

Virtualization

Operative System

Energy Consumption
Hardware components
Tenant..
A simulated user (tenant) is:

● User behavior defines the 
scheduling policy of the user

● How users appear at cloud


system?
● User generator..
Modelling Applications

How applications are modelled?


Modelling applications

Users can write their own applications. iCanCloud 
provides:
 A set of POSIX­like functions

 A subset of MPI functions

We have to model the flow of our applications using APIs
System calls API
● // ----------------- CPU ----------------- //
void iCanCloud_request_cpu (MI);
void iCanCloud_request_cpuTime (cpuTime);

// ----------------- Memory ----------------- //


void iCanCloud_request_allocMemory (memorySize, region);
void iCanCloud_request_freeMemory (memorySize, region);

// ----------------- Network ----------------- //


void iCanCloud_request_createListenConnection (localPort);
void iCanCloud_request_createConnection (destAddress, destPort);
void iCanCloud_request_sendDataToNetwork (msg, id);
void iCanCloud_request_closeConnection (localPort, id);

// ----------------- Storage----------------- //
void iCanCloud_request_open (fileName);
void iCanCloud_request_close (fileName);
void iCanCloud_request_read (fileName, offset, size);
void iCanCloud_request_write (fileName, offset, size);
void iCanCloud_request_create (fileName);
void iCanCloud_request_delete (fileName);
MPI API
// ---------------- Misc --------------- //
void parseMachinesFile ();
bool isMaster (processRank);
int getMyMaster (processRank);
bool isThisWorkerInMyRange (master, processRank);

// ----------------- Barriers ----------------- //


virtual void mpi_barrier_up ();
virtual void mpi_barrier_down (*sm_mpi);
virtual void initBarriers ();
virtual void checkBarriers ();

// ----------------- Main ----------------- //


virtual void mpi_bcast (root, bufferSize);
virtual void mpi_send (rankReceiver, bufferSize);
virtual void mpi_recv (rankSender, bufferSize);
virtual void mpi_scatter (root, bufferSize);
virtual void mpi_gather (root, bufferSize);
virtual void mpi_gather_arrives (*sm);
...
Modelling applications
Developing a new application requires:
1.­ Write a new module with the application’s name.
o Parameters required for the application.
2.­ Write its parameters file (.ned)
3.­ Write its header (.h) using the CloudJob Interface.
4.­ Write its behavior (workflow) using iCanCloud APIs.
­ initialize();
­ processRequestMessage (iCanCloud Message* msg);
­ processResponseMessage (iCanCloud Message* msg);
­ finish();
5.­ Recompile the simulation environment
Example of HPC-app scenario
Example (Scenario) :

Hello! Cloud Manager


Example of HPC-app scenario
Example (Scenario) :

2 VMs
2 Cores per VM Cloud Manager
Example of HPC-app scenario
Example (Scenario) :

Cloud Manager

Create 2 VM
Example of HPC-app scenario
Example (Scenario) :

Waiting ... Cloud Manager

Success
Example of HPC-app scenario
Example (Scenario) :

Thank you! Cloud Manager

10.110.2.21

10.110.2.22
Example of HPC-app scenario
Example (Scenario) :

HPC Application
1 process per core 10.110.2.21

10.110.2.22
Example of HPC-app scenario
Example (Scenario) :

Hpc App 1 10.110.2.21

Hpc App 2

Hpc App 3

10.110.2.22
Hpc App 4
Example of HPC-app scenario
Example (Scenario) :

MPI config 10.110.2.21

MPI config

MPI config

10.110.2.22
MPI config
Example of HPC app parameters
HPC APP .ned looks like

simple ApplicationHPC {
parameters:
bool allToAllConnections; // Connect all processes between themselves
int myRank;        // MPI process rank        
int workersSet;        // Number of worker processes per set
int numIterations;        // Number of iterations
// Slice of data sent to each worker process (per iteration)
int sliceToWorkers_KB;
// Slice of data received for master process (per iteration)
int sliceToMaster_KB;
       // CPU processing (in MIPS) for each worker process (per iteration)
int sliceCPU;  
bool workersRead;       // Worker processes read
bool workersWrite;       // Worker processes write
}
Map Reduce using HPC-app schema
Output

What can we get from


executions?
Examples of outputs
iCanCloud is not able to …
 Execute compiled applications directly in the simulation 

environment

Each application must be re­written in iCanCloud
 Performs Full­system simulations


CPU are modeled using execution times, not emulating 
instructions.
 Automatically produce output results


Users must specify what results must be calculated 
during simulation.
 Simulate GPUs and calculate Temperatures of the room
Thanks…

Thanks for
your attention!
/* */ || ¿?

gabriel@arcos.inf.uc3m.es

You might also like