NAGNews 109 October 4 2012

In this issue

Discover the new functionality in the NAG Library for C and C++ Programmers

During the course of 2012 NAG has updated its numerical libraries with new and enhanced functionality. The latest library to be updated (to Mark 23) is the NAG C Library. This latest release brings the number of routines in the C Library to 1452, all of which are expertly documented. Included in the release are two entirely new chapters plus extensions in the areas of statistics, nonlinear equations, wavelet transforms, ordinary differential equations, interpolation, surface fitting, optimization, matrix operations, linear algebra, large scale linear systems, and special functions.

We've written some mini-articles to give a bit of background to new functionality in the library - these can be viewed here, but in today's NAGnews we'll focus on the new multi-start optimization routines.

The new multi-start optimization routine, (e05ucc), uses a sequential QP algorithm for finding the local minimum of a general nonlinear function subject to linear, nonlinear and simple bound constraints. The user has the option to retain not just the best solution, but any specified number of solutions, ordered to reflect the value of the objective at the minimum. Such a facility might be useful when there are other criteria, not specified in the mathematical solution, that the user would like in an acceptable solution. An example might be a solution that is 'good', but stable in the sense that small changes in the variables do not cause a large change in the objective. So, for example, small errors in manufacturing a part might not unduly diminish performance of the assembled product. Read the background here.

How can I access the NAG C Library?

Your workplace or learning institution might have a licence for the NAG C Library which would give you access to it. Contact us to see if you are entitled via your licence. If not, there are various purchasing methods - speak to one of our global account managers for more information.

Try the NAG C Library

Technical Survey 2012 - Let us know your thoughts and enter Kindle Fire Tablet prize draw

Vital to the continued improvement and evolution of our products and services is listening to the most important people to us - our users.

The NAG Technical Survey 2012 gives you the opportunity to give us feedback on the software and services we provide and ultimately help shape future direction and functionality.

Fundamental to NAG's ethos is collaboration; please help us improve by collaborating with us on this survey. To begin the survey visit

To thank you for your time in completing the survey we'll enter you into a prize draw to win one of two Kindle Fire Tablets. We estimate it will take 15 minutes to complete the survey.


Please note that this survey invitation is for users of NAG software and/or services and is intended for completion once only. If you receive an email invitation to complete the survey, and have already completed it, please ignore the email. Winners will be chosen at random and notified by email.

Apple version of the NAG Toolbox for MATLAB now available

Making sure that our libraries are available to as many users as possible is a priority for NAG's implementation team and Apple Intel Mac is a platform that we try to cater for. These implementations are not always the most straightforward to deliver and so often there is a time delay in producing libraries for Apple Mac OSX. However, we are pleased to announce that the NAG Toolbox for MATLAB is now available for Apple Mac OSX. Not only does Mark 23 of the NAG Toolbox for MATLAB feature extensive new functionality, it also features many new user improvements like:

  • All of the functions now have two names, the traditional short name (e.g. c09ab) for backwards compatibility, and a more descriptive long name such as nag_wav_2d_init (2D Wavelet function) which gives user choice and may help with speedier function selection.
  • Integer Utility Functions have been introduced to help write programs that are interchangeable between 32 and 64-bit platforms.
  • Improved error handling. Previously the NAG Toolbox issued warnings when problems arise, however many MATLAB users like to use try ... catch ... end blocks to handle errors. The NAG Toolbox now only uses warnings in cases where the output values may be of use or where the function has found a solution.
  • The provision of function handles as an alternative to using M-Files gives added flexibility
  • New format examples - all functions in the NAG Toolbox feature helpful examples and are now provided as single functions, rather than using M-Files. In addition to this, many examples have been improved.

New Case Study: CRYSTAL Materials Modelling Code Enhanced

HPC experts from NAG, working under NAG's Computational Science and Engineering (CSE) support service for HECToR, the UK's national academic supercomputing facility, have implemented performance improvements for the CRYSTAL materials code. CRYSTAL is a program which computes a material's electronic structure from first principles, and then uses this to determine its properties. CRYSTAL is an important resource for UK material chemists, and it is necessary to continue its development to ensure it makes best use of HPC resources such as HECToR.

As a result of this code optimization project, larger systems can now be studied, which opens up new problem areas which can be tackled using CRYSTAL. Parallelisation techniques are also being applied to other parts of the code. "The first work to benefit has been in renewable energy where extensive surveys of bulk and surface structures are now underway: applications include the photovoltaic production of hydrogen, solid oxide fuel cells and lithium ion batteries" Dr Barbara Montanari of the Computational Science and Engineering Department at Rutherford Appleton Laboratory, STFC.

Read the full story here.

Technical Tip: Using NAG with Microsoft Excel (32-bit or 64-bit)?

Dear NAG,

I have just bought a new laptop, running 64-bit Windows. For many years I have been using your Library in Excel and I want to continue using it in the same way, however I don't know which version I should use. My old machine had 32-bit Windows Vista.

Our response,

The short answer is that it is very likely that on your new 64-bit operating system you will still use the same 32-bit NAG Library. Which version of the NAG Library (32/64-bit) to use actually depends on bitness (being 32-bit or 64-bit) of your Microsoft Office, not the bitness of Microsoft Windows. If Microsoft Excel is a 32-bit application then you need to use a 32-bit NAG Library. 64-bit Excel will require 64-bit NAG Library. OK, but how do you know which Excel you have?

All pre-2010 Excel versions are 32-bit, so here the answer is simple - only the 32-bit NAG Library will work. If you have Excel 2010 then it is highly likely that it is a 32-bit version, because these days the default installation of Office 2010 on a 64-bit Windows is 32-bit. This helps maintain backward compatibility with solutions built using previous versions on Microsoft Office. In 64-bit VBA7 the user needs to update his Declare statements and update address pointers, i.e. the VBA code needs to be modified. Using 64-bit Excel is recommended only to those users who work with 2GB or more of data.

Here's an easy way to check which version you have.

  1. Open an empty Excel 2010 spreadsheet.
  2. Click on the File menu tab and select Help.
  3. On the right hand side you'll see information about your version of Excel, including the version number and its bitness.

Which version of Office

Having checked which version of Excel you have, you can now proceed to NAG's downloads page and pick the right implementation of the NAG Library. Once you have downloaded and installed it please contact NAG Support and ask for a licence key. Do visit the NAG and Excel page as well. Here you will find many downloadable example spreadsheets that demonstrate how to use the NAG Library in Excel, from both 32-bit or 64-bit Excel.


Events & Training Courses

Data Management & Information Quality and Data Warehouse & Business Intelligence Conference Europe 2012
5-7 November 2012, Radisson Blu Portman Hotel, London.
These two co-located meetings are Europe's leading conferences on Data Management & Information Quality and Data Warehouse & Business Intelligence. Once of the tracks is organised by DAMA, the Data Management Association International, in which Jeremy Walton of NAG will be speaking. His seminar is entitled A Cure for the Common Code: Making The Most of Your Data, and will discuss ways in which to embed analytic functionality into business intelligence applications.

12th-15th November 2012. Salt Lake City.
For 24 years, SC has been the principal event for bringing together leading experts in the world of supercomputing, and we are proud to have been part of it from the very beginning. We are delighted to be present again this year. You can find us at booth number 2431, please come along to say hello, and to discover more about the new developments in our world-famous numerical libraries.

Training Courses Provided by NAG's HECToR Team*

Open MP
9-11 October 2012
University of Liverpool

Parallel Programming with MPI
23-25 October 2012
University of Liverpool

An Introduction to CUDA Programming
22-23 October 2012
NAG's Manchester Office

An Introduction to OpenCL Programming
24-25 October 2012
NAG's Manchester Office

Fortran 95
5-7 November 2012
University College London

These HPC training courses are provided free of charge to HECToR users and UK academics whose work is covered by the remit of one of the participating research councils (EPSRC, NERC and BBSRC). The courses are also open to non-eligible people but will require payment of a course fee. Please see the eligibility page for more details.

Recent blog posts

Keep up to date with NAG's recent blog posts here:

NAG on the Cloud: Part 2
In case you missed Part 1 of NAG on the Cloud, NAG's Brian Spector discussed calling the NAG 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 (EC2) allows the user to buy or rent instances of virtual computers and pay for only what you see. In his latest blog post, Brian discusses how to put the NAG Library on EC2 and gives some initial performance tests.

The NAG SMP and Multicore Library on the Cloud - Part 3
In his last post Brian Spector looked at the NAG serial library on Amazon's EC2. He noticed that the CPU utilization was not anywhere close to the capacity he had on the Cloud. In this post he loads the NAG SMP and Multicore Library on Amazon's EC2 in the hope of utilizing all the virtual cores.


NAGNews - Past Issues

We provide an online archive of past issues of NAGNews. For editions prior to these, please contact us.