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 ubuntu@50.112.131.89:/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
| Cloud Time | My Laptop | ||
| QP1 | 1114.42 | 1429.06 | |
| QP2 | 45.97 | 57.2 | |
| LP1 | 78.13 | 96.83 | |
| LP2 | 24.36 | 28.99 | |
| LP3 | 39.42 | 43.53 |
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.
For more information on running your applications on the Cloud, contact support@nag.co.uk or support@nag.com.


I should note that my examples (QP1, QP2, LP1, etc) are a collection of Sparse Linear and Quadratic problems I had available. The large difference in solving times are due to the size differences in the Hessian and Constraint matrices.
ReplyDelete