# Issue 69, 14 February 2008

In this issue:

Top Story - NAG celebrates the launch of the UK's largest supercomputer

On 14th January 2008 NAG was represented at the official launch of the UK's next generation supercomputer in Edinburgh. Opened by the Chancellor of the Exchequer, Alistair Darling, the event marked the official launch of the UK's High-End Terascale Computing Resource, or HECToR as it is more commonly known as.

We have been reporting on HECToR since NAG was appointed as the supplier of Computational Science and Engineering Support to the UK's national supercomputing service. HECToR's objectives are:

• to provide a world-class capability-level service for UK-based academic research;
• to support the development of innovative computational technologies;
• to encourage industry and commerce to make effective use of high-end computing;
• to work with colleagues in Europe and worldwide.

NAG looks forward to continuing to support HECToR and provide training for its users. For more information on the training that NAG offers and to learn more about the project visit HECToR's website here http://www.hector.ac.uk/.

Product News - Latest Implementations

The next Marks of the NAG numerical libraries will include a new routine for fast extraction of quantile values from unordered sets of real numbers.

Put simply, a quantile can be viewed as a pointer into a data set such that a certain proportion of values lie below the quantile and the remainder lie above. Some quantiles have more familiar names; the well-known term median is the name given to the middle value of a data set when the data are arranged into ascending order. If there happen to be an even number of points, of course there is no middle value, and by definition the average of the two middle values is taken. In the terminology of the new NAG routine, the median is the 0.5 quantile.

Percentile values are given by the quantiles 0.01, 0.02, 0.03 etc. The first percentile value is the data point one hundredth of the way up the series when the values are ordered.

The requirement for the software came from a major financial institution, who needed a faster way of extracting this information. The obvious way to compute quantile values is to rearrange the data into ascending order, and then pick out the value of interest. However, for large data sets this is not efficient - the time needed to sort the data is significant.

In response to this requirement, NAG collaborator Prof. Mike Giles, of Oxford University, developed a partial Quicksort algorithm, using the Quicksort method already in the NAG Libraries as a starting point. As hoped, it turned out that the new routine performed much more efficiently because it is possible to extract the quantile value without sorting the entire data set.

The graph shown on this page http://www.nag.co.uk/nagnews/NAG_routine_quantile_values.png shows just how fast the new routine is; it compares how much time it takes to get the median of a data set using the new routine G01AMF as opposed to sorting using routine M01CAF.

If you have any questions about the NAG Library please email us at mailto:nagnews@nag.co.uk.

People News - NAG pays tribute to a pioneering computer scientist

Gene H Golub died on the 16th November last year, aged 75. He had been a personal friend and good friend of NAG over many years. I was therefore greatly saddened to hear of his loss.

Gene was a close friend of Jim Wilkinson. In the early 1970s they came to NAG in Oxford and offered us an early version of Gene's SVD algorithm for inclusion in the NAG Library, which we were delighted to accept. Gene also offered us advice and counsel on the numerical linear algebra chapters of the Library and our statistical coverage. Such advice was always given in a gentle, almost quiet style but with considered, state-of-the-art reference.

Gene had been a founding member of the Computing Science Department at Stanford University in 1965. After the death of George Forsythe, he was the Father of Numerical Analysis there, and was always so welcoming of visitors to Stanford. His hospitality was legendary. I remember him taking our family to a delightful Chinese restaurant in Berkeley in 1976, and thence to an exquisite ice cream parlour.

He, like Jim, was a great supporter of the young and his friendly support and interest helped many NAG colleagues over the years, particularly Sven, Jeremy and me. His friendly, welcoming presence helped create and continue the open and amiable relations which have characterised the numerical linear algebra community to the present day. His welcome of Walter Murray and Philip Gill to Stanford further enriched our contact with the University. Because of Gene and shared technical interests, we had regular meetings and exchanges with him over many years including last year, in Stanford, Oxford and Zurich.

He will be greatly missed, and always greatly valued. There is a world thanksgiving for him and his life on the 29th February 2008 (which would have been only his 19th birthday!). In Oxford there will be a gathering in the Computing Laboratory he knew so well.

We remember Gene.

Brian Ford
Founding Director, NAG Ltd

Product Spotlight - The NAG SMP Library for high performance computing

The NAG SMP Library, used by some of the world's most prestigious supercomputing centres, was produced to enable developers and programmers to make optimal use of the processing power and shared memory parallelism of the Symmetric Multi-Processor (SMP) systems.

A proportion of the routines within the NAG SMP Library have been specially developed and tuned to provide the utmost performance on SMP platforms. These tuned routines deliver levels of performance and scalability superior to many other products currently available. In fact, NAG has developed and pioneered many parallelized computational algorithms, often unique to NAG.

Did you know...?

... the NAG SMP Library is available as part of a benchmark suite. To learn about how staff and students at the University of Liverpool, UK used the benchmark suite follow this link http://www.nag.co.uk/IndustryArticles/NAGHPCLibrariesforHE.pdf. If you're interested in conducting your own benchmarks email us on mailto:nagnews@nag.co.uk.

NAG Event Calendar

NAG Quant Day London 2008, 21 February 2008

NAG is delighted to team up once again with the finance specialist publication Wilmott to host the NAG Quant Day London 2008 - the next in a series of highly informative presentations for those working in the finance industry. Speakers on the day will include:

Ely Klepfish - UBS AG “Risk Modelling, portfolio optimisation and performance backtest”
Ser-Huang Poon - Professor of Finance - Manchester Business School “Interest rate models for asset liability management”
Mike Giles - Professor of Scientific Computing - Oxford University

NAG and Inforsense Webinar, 22 February 2008

Interactive Decision Support Tools for Fund Managers

This webinar will show how software from Inforsense and NAG can be combined to deliver a decision support meeting for Fund Managers to provide this information.

To attend the webinar visit https://inforsense.webex.com/mw0304l/mywebex/default.do?siteurl=inforsense&service=6

DevWeek - London, 10 - 14 March 2008

In March NAG is going to be present at the biggest developer exhibition in the UK, DevWeek. The event promises to be a great place to learn all the new and cutting edge advances in the application development environment and also features many talks by industry and development experts.

NAG will be on hand to demonstrate recent product development highlights including the NAG Toolbox for MATLAB and the NAG .NET Library. For more information on the event visit http://www.devweek.com/

Tips & Hints - Using the NAG Toolbox for MATLAB

Some of the most useful and powerful routines in the NAG Toolbox for MATLAB require the user to provide an M-file specifying a function. For example optimization routines require the user to provide the function to be minimised. Ordinary differential equation routines and quadrature routines also require the user to provide functions in order to specify the problem.

If we take a specific example, that of e04fy, a routine to minimise the sum of squares of m nonlinear functions in n variables, we see can see that it is sometimes necessary to provide additional information to the user-provided function:

```m = int32(15);
x = [0.5;
1;
1.5];
y = [0.14,0.18,0.22,0.25,0.29,0.32,0.35,0.39,0.37,0.58,0.73,0.96,1.34,2.10,4.39];
t = [[1.0, 15.0, 1.0],
[2.0, 14.0, 2.0],
[3.0, 13.0, 3.0],
[4.0, 12.0, 4.0],
[5.0, 11.0, 5.0],
[6.0, 10.0, 6.0],
[7.0, 9.0, 7.0],
[8.0, 8.0, 8.0],
[9.0, 7.0, 7.0],
[10.0, 6.0, 6.0],
[11.0, 5.0, 5.0],
[12.0, 4.0, 4.0],
[13.0, 3.0, 3.0],
[14.0, 2.0, 2.0],
[15.0, 1.0, 1.0]];

user = {y, t, 3};

[xOut, fsumsq, user, ifail] = e04fy(m, 'e04fy_lsfun1', x, 'user', user);

In this code the 'e04f_lsfun1' argument means that a user provided function
is provided in the M-file e04fy_lsfun1.m:

function [fvecc, user] = lsfun1(m, n, xc, user)
fvecc=zeros(m,1);

% y is in user{1} and t is in user{2}
for i = 1:m
fvecc(i) = xc(1) + user{2}(i,1)/(xc(2)*user{2}(i,2)+xc(3)*user{2}(i,3))-...
user{1}(i);
end
```

This is the code we give as our example. You will see that information, the arrays y and t, are bundled up into the parameter ‘user’ in the calling code and the function lsfun1 receives this as a parameter.

This means of passing information is the most ‘stylish’ form of programming, but it is not the most efficient. If you have a large amount of information to pass and efficiency is of primary concern, then you might wish to consider using global variables:

```global y t;
m = int32(15);
x = [0.5;
1;
1.5];
y = [0.14,0.18,0.22,0.25,0.29,0.32,0.35,0.39,0.37,0.58,0.73,0.96,1.34,2.10,4.39];
t = [[1.0, 15.0, 1.0],
[2.0, 14.0, 2.0],
[3.0, 13.0, 3.0],
[4.0, 12.0, 4.0],
[5.0, 11.0, 5.0],
[6.0, 10.0, 6.0],
[7.0, 9.0, 7.0],
[8.0, 8.0, 8.0],
[9.0, 7.0, 7.0],
[10.0, 6.0, 6.0],
[11.0, 5.0, 5.0],
[12.0, 4.0, 4.0],
[13.0, 3.0, 3.0],
[14.0, 2.0, 2.0],
[15.0, 1.0, 1.0]];

%user = {y, t, 3};

[xOut, fsumsq, user, ifail] = e04fy(m, 'mod_e04fy_lsfun1', x);

The modified M-file, mod_e04fy_lsfun1.m would then contain:

function [fvecc, user] = lsfun1(m, n, xc, user)
global y t;
fvecc=zeros(m,1);

% y is in user{1} and t is in user{2}
for i = 1:m
fvecc(i) = xc(1) + t(i,1)/(xc(2)*t(i,2)+xc(3)*t(i,3))-...
y(i);
end
```

In general global variables are often frowned upon and might be dangerous in multi-threaded or parallel environment but in the context of a single-threaded MATLAB system the performance gains of this mechanism might outweigh any aesthetic objections. Much will depend upon your problem.

Previous Tips & Hints can be found on our website http://www.nag.co.uk/techtips/index.asp.

Product News - Latest Implementations

NAG is committed to offering new implementations of its broad range of numerical and statistical software components and compilers and tools. The following implementations for NAG products have become available since the last issue of our newsletter:

The NAG C Library (http://www.nag.co.uk/numeric/CL/CLdescription.asp, Mark 8 is now also available for the following platforms:

• Intel-32 Windows DLL using the Microsoft Visual C++ Compiler
• Apple Intel Mac OS X using the Gnu C Compiler

The NAG Fortran Library http://www.nag.co.uk/numeric/FL/FLdescription.asp, Mark 21 is now also available for the following platforms:

• Apple Intel Mac OS X using the NAG Fortran Compiler
• Apple Intel Mac OS X 64-bit using the Intel Fortran v10.1 Compiler

The NAG Fortran Compiler, Release 5.1 is now also available for the following platform:

• Apple Intel Mac OS X

For full details of these and all other available implementations, visit the NAG site. Comprehensive technical details of each implementation are given in the relevant Installation and User Notes at http://www.nag.co.uk/doc/inun.asp