NAG on the Cloud: Part 2
In case you missed Part 1 of NAG on the Cloud(link is external), I discussed calling the Library on Windows Azure using the C# library and Microsoft's Cloud Numerics. We now turn to a different cloud provider. Amazon's Elastic Cloud Computing(link is external) (EC2) allows the user to buy or rent instances of virtual computers and pay for only what you use. Below, I'll discuss how to put the NAG Library on EC2 and give some initial performance tests.
Creating an Instance
There are a plethora of videos on creating Amazon EC2 instances. If you are going to install and run the NAG Library, make sure you start a Virtual Private Cloud when creating the instance. Private Clouds can be created at no additional cost on EC2 and remain compatible with NAG's Kusari License management system. I decided to create a couple tests:
My EC2 Console Instances
The above instances vary in size, memory, and type of OS running. When the instance is created, you can gain access to it via ssh. To load the library onto EC2, just download the .tgz file of your choice from the NAG website and secure copy it up there:
$scp -i VPCkey.pem fll6a23dfl.tgz firstname.lastname@example.org:/home/ubuntu
Here VPCkey.pem is a key file that only allows my computer to access this Cloud instance. Once the Library is copied, we can unzip it and the installation instructions remain the same as if the computer were right in front of you!
Is the Cloud Faster?
First the system specs:
Amazon EC2 Cloud High-CPU Extra Large Instance:
- 20 EC2 Compute Units (8 virtual cores with 2.5 EC2 compute units each)
- 64-bit Ubuntu
- 7 GB of memory
- Intel Core i5
- 64-bit Ubuntu
- 3 GB RAM
Clearly the Cloud is more powerful, but is it faster? Since I had recently completed a project on sparse Linear and Quadratic Programming, I decided to use some of the data and compare the run-times between my laptop and the cloud (routine tested was e04nq, all times are in seconds):
|Cloud Time||My Laptop|
Thus, by running these programs on the cloud I was able to obtain a 10-20% speed improvement!
CPU Utilization on the Cloud
As I was browsing the information page of my High-CPU Instance, I examined the CPU utilization used in the above programming problems and found some interesting results (click to enlarge):
As you can see, I was using less than 20% of my CPU capacity on the Cloud when running these tests! This is a result of using the serial library and not taking advantage of all the cores on EC2. I would suspect you could obtain a substantial performance increase when using the NAG Library for SMP and Multicore.