NAG on the Cloud

I have been at NAG for 3 months now and one of my first tasks here was the topic of cloud computing. Customers have been inquiring as to whether they can utilize the NAG library on the hundreds of cores available on Cloud services like Microsoft's Azure and Amazons EC2. Below you will find a preliminary report of calling the NAG Library for .NET on Windows Azure.

I began with Microsoft's Cloud Numerics; a .NET analytical library that can easily be scaled out to Windows Azure for large computations. Cloud Numerics provides a library of about 400 Mathematical and Statistical functions that the user can call (in this case, from C#). Since NAG supplies the library in a .NET framework, I decided this was a good way to start.

Getting an account and all the correct software downloaded can be a challenge. I actually found this example quite useful for installation, setup, and deployment of Cloud Numerics on Azure.

To start calling NAG functions from the MSCloudNumerics example program, just add the NAG .NET dll under references and include the namespace NagLibrary. When you are ready to deploy the application to the cloud, right-click the 'AppConfigure' tab in the Solution Explorer and select 'Set as StartUp Project'. Then put in your Azure account information, create a cluster, and deploy!

The program will be compiled on your local machine to a folder, and then the entire folder will be uploaded to the cloud for processing (you may also need to include the NAG file DTW3206DA.dll in the same place where the program is compiled so that it is uploaded to the cloud). To then access your program, you can go to


Just put in your username and password (created when deploying your app) to see a list of jobs you've run on Azure.

For my example program, the data is an array ranging in values from [-.5, .75]. Following this is a call to my favorite NAG function, s15ab (the cumalitive normal distribution function).

I have taken a screenshot below of the two outputs from the example pro
gram. On the left is the output from Windows Azure and on the right is the same program run on my local machine.

Left: Example run on cloud. Right: Example run on local machine.

Ideally, I'd leave this up on the cloud for everyone to log in and see it yourself, but Azure charges compute time, storage, and transfer fees every hour. Happy cloud computing!


Popular posts from this blog

Implied Volatility using Python's Pandas Library

C++ wrappers for the NAG C Library

ParaView, VTK files and endianness