Showing posts from 2011

Coffee and Filters

Given the origins of NAG and our mission, it’s natural for us to take the “long view” in giving back to the communities in which we operate. In the US, we’ve just finished our second year as sponsor of the DemandTec Retail Challenge (DTRC) scholarship competition for high school students in the Chicago area. DemandTec is one of our earliest and strongest software company partners who incorporate NAG components into their software products, providing demand management software for major retailers around the world.

The DTRC puts 2-person teams of high school seniors in the role of category managers for a retail store in a a 2-week computer simulation where each day represents a week in the “real world”. The students are given many weeks of data showing the price, inventory, unit sales, promotions used and the profit earned on each product they are managing. In the contest, they are responsible for two brands of coffee, one brand of tea and coffee filters. During the competition, they mu…

Calling NAG routines from R

R is a widely-used environment for statistical computing and data analysis. It is one of the modern implementations of the S programming language (i.e. much code written in S will run unaltered in R) although its underlying semantics are derived from Scheme. R is Free Software.

The capabilities of R can be extended through the use of add-on packages and a large number of these are available from the Comprehensive R Archive Network (CRAN). Some users have expressed an interest in calling NAG Library routines from within R; accordingly, we have recently created a package which provides access to some of NAG's numerical functionality. More specifically, the NAGFWrappers R package contains the local and global optimization chapters of the NAG Fortran Library, together with a few nearest correlation matrix solvers and some other simpler routines. The package incorporates documentation in the so-called Rdoc style that will automatically produce help pages within the R system (see f…

SC11 diary catch up

I posted here a week or two ago about my diary leading up to the year's biggest supercomputing event - SC11 in Seattle. I though it would be handy to give a quick summary of the diary entries so far for those who haven't been reading along.

If you recall, I said: "On my twitter stream (@hpcnotes), I described it as: "the world of #HPC in one week & one place but hard to find time for all of technical program + exhibition + customer/partner/supplier meetings + social meetings + sleep!" To follow the news about SC11 on twitter, follow @supercomputing and/or the #SC11 hashtag."

"Any hope of "live" blogging or actively tweeting during the week of SC11 itself is almost nil - the week is just too busy with the day job. Even simply consuming the relevant news, comment and gossip is a challenge."

"So instead I am going to try to write a diary of the lead up to SC11."

If you've missed them, here are the 8 SC11 blogs so far:


SC11 will be here soon

The SC11 conference, or just "supercomputing", will be held in Seattle this November. For many in the high performance computing community, including NAG, SC is the big event of the year. Certainly it is the one that attracts the most press (and press releases), the most attendees, the biggest exhibition, and absorbs the most amount of time in planning before we even get there. It is the event where we get to meet with many of our customers, most of our potential suppliers, and many friends and collaborators.

SC11 will generate a lot of news, articles and other media in the coming weeks. You can keep up with SC11 on twitter by following @supercomputing and/or the #SC11 hashtag. NAG's twitter team (@NAGtalk) will also keep you up to date with NAG's activities and stories at SC11 and beyond.

The NAG team will also post here on The NAG Blog over the coming days and weeks with news about what NAG will be doing at SC11.

I will be adding to all this with a series of posts …

Calling routines from the NAG Fortran and C libraries from within LabVIEW

This is a follow-on from my colleague Sorin Serban's recent post, in which he looked at invoking methods from the NAG Library for .NET from within the LabVIEW programming environment. The motivation for this work was the realization that many LabVIEW users want to enhance their applications by making use of some of NAG's numerical routines. Recently, I've been using our Fortran and C libraries to do the same thing, and some of this work is discussed here.

The mechanism used within LabVIEW to call a routine from either of these libraries is different from that used in the case of the .NET Library. This is because that library is a so-called .NET assembly, whilst the C and Fortran libraries are (on the Windows platform) dynamic link libraries (DLLs). The .NET assembly uses the common language runtime (CLR) and the .NET framework to manage assembly functions, and to export information about classes, methods, properties and events. The practical implication of this is tha…

NAG communications

We know that it can be hard for you to keep track of all the new stuff that is happening at NAG, such as the regular Library updates, new ways to use routines from various computing environments, events and conferences, training days, talks at customer sites, collaborations with numerical specialists, work on new technology platforms, and so on. The list of new activities and developments can seem endless, but we try to directly communicate the information that seems likely to be of most interest to you.For example:If you are a NAG user, we let you know when a new release of the Library is available for your system, so that you have the quickest access to new routines.When we know your field of interest, we send you information about events and highlight relevant examples in order to help you get the most from NAG.We periodically release brief case studies that contain novel ways of using NAG routines; some of these might help trigger new ideas for your problem solving.However, one of…

How do you use NAG in Excel?

For years NAG has considered Excel users as a group with certain needs for good numerical algorithms. Nowadays Excel is the industry-standard for spreadsheets, but it is not a statistical package nor is it a numerical analysis tool. That’s why Excel users come to NAG and ask how our accurate, robust and efficient NAG Library can be utilised in Excel.There are a few ways in which the Library can be called in Excel:xls/xlsm spreadsheet and VBAThe most popular, widely used way: NAG and Excel page describes how to do it with the help of technical papers and downloadable examples. Basically you create a new spreadsheet and add VBA code to it. NAG has created VBA Declaration Statements which provide the bridge between NAG and Excel- the user just has to add the declaration file to a VBA module and the NAG DLL becomes visible to Excel & VBA. From this moment on you can create macros that will, for example, read data from an external data file, process it in VBA and then display the resul…

What is this HPC thing?

I’m sure something like this is familiar to many readers of this blog. The focus here is HPC, but there is a similar story for mathematicians, numerical software engineeers, etc.

You've just met an old acquaintance. Or a family member is curious. Or at social events (when social means talking to real people not twitter/facebook). We see that question coming. We panic. Then the family/friend/stranger, asks it. We freeze. How to reply? Can I get a meaningful, ideally interesting, answer out before they get bored? What if I fail to get the message across correctly? Oops, this pause before answering has gone on too long. Now they are looking at me strangely. They are thinking the answer is embarrassing or weird. This is not a good start.

The question? “What do you do then?” Followed by: “Oh! So what exactly is supercomputing then?

The problem is that it usually takes a several slides or a few minutes of explanation to give a decent overview to a scientist who is new to HPC. Your q…

Seeing the good for the trees

We put a lot of effort into trying to ensure that our numerical libraries are available on the platforms that are most popular with our users. For each library, this leads to a proliferation of implementations, each of which is targeted at a specific combination of compute processor, operating system and compiler. The details of current implementations are on our website - for example, here is the list for the NAG Fortran Library, which also includes download links for each implementation. Although this list - which currently features forty-nine implementations - is an impressive array (and the fruits of a great deal of careful work on the part of our implementation team), its presentation could perhaps be viewed as being tricky to navigate by those who are searching for the appropriate implementation for their particular system.

Types in The NAG Toolbox for Matlab®

I was recently asked why the NAG Toolbox for Matlab requires users to be explicit about the types of parameters passed to NAG routines, for example:

[vr, info] = f08nf(int64(1), int64(4), vr, tau); and similarly why output parameters like info in this example have class int64 as opposed to double.

The original reason for this was efficiency. The NAG Toolbox consists of wrappers to NAG Library routines and there are always issues in transforming data into the correct format when calling between different languages. As well as the top-level call (like the one shown here), we also have to transform data when calling Matlab functions in "call backs", for example when evaluating the objective function during the solution of an optimisation problem. In such cases there may be many thousands of calls and so we want to make the data transformation as efficient as possible. It was for this reason that we decided to put the onus on the user to do any coercions and checks on the v…

Why migrate from legacy systems?

I was tempted by a colleague into posting an answer to a question on LinkedIn. I thought it might be useful to reproduce that here for a potentially different audience ...

Q: (from LinkedIn)
"Why is it important to migrate from legacy systems? Is there anyone who can simplify the migration process?"

A: (my answer, there are others too)

Why migrate from legacy systems? There are two aspects to consider - protection and opportunity.

Using NAG .NET methods in LabVIEW

Recently we were asked by users at a few European universities about how to call the NAG Library from within the popular LabVIEW programming environment. They're interested in doing this because they wanted to supplement the functionality of their LabVIEW applications using some of the numerical routines offered by NAG. We already have some preliminary material on our website which describes a few aspects of using the NAG Fortran Library in LabVIEW, but alternative approaches (which could be viewed by some as reflecting more modern programming paradigms such as object orientation) are also possible. Specifically, we’ve been taking a look at calling routines from the NAG Library for .NET from LabVIEW, and we describe some of this work here.

ISC11 Review

Several of NAG's staff attended the International Supercomputing Conference (ISC) in Hamburg, Germany last week. We took part in several aspects of the show ("Talk to us in Hamburg"). I also posted a ISC11 preview with comments on I would be looking out for. So, what were my impressions after the show?

First, as ever, ISC is a (the?) great mid-season HPC event - breathing renewed life into the HPC community half-way around the world and half-way around the year from the biggest show of the HPC calandar ("SC" in USA each November).

In my preview, I said I was watching out for three battles:

Storing Banded Matrices for Speed

Introduction A real n-by-n matrix A will, in general, be defined by its n2 elements that would need to be stored for computations to be performed using A. If n is very large, this can amount to a lot of storage.

Talk to us in Hamburg - ISC11

NAG will be at the International Supercomputing Conference (ISC) in Hamburg, Germany next week (June 19-23). Come and see us at booth number 830 in the main exhibition hall. We will be demonstrating how our product, services and training can help your HPC applications.Products on show will include the NAG Library for SMP & Multicore, the NAG Parallel Library, numerical routines for GPUs, the NAG Toolbox for MATLAB®.We will also be able to tell you more about how NAG’s HPC training courses, impartial technology advice and HPC software engineering services are helping HPC users around the world.We will have the latest news and code performance success stories from the Computational Science and Engineering Support Service provided by NAG as part of the UK’s HECToR National Supercomputing Service.NAG is even contributing to the technical program. We are joint hosts (with Intel and RRZE Erlangen) of BoF session 7: “Data‐Parallelism/SIMD for HPC in the Future” on Wednesday. And NAG’s An…

Now hear this

Recently I’ve been doing some work producing a web-based seminar (or webinar, to use the fashionable neologism) which demonstrates some aspects of NAG’s optimization routines and their use in the finance industry (specifically for the optimization of financial portfolios). We originally scheduled a live broadcast of the seminar using the GoToWebinar package, which works very well; we’ve also used Webex’s offering, with similar results. Unfortunately, in spite of a lot of preparation and rehearsal, some technical problems (unconnected with the package) arose during the broadcast which rendered the recording of the session useless. Reasoning that better results might be obtained through simplification (our broadcast was a joint effort between two sites, which contributed to the problems), we decided to try just recording the seminar and put it up as a video.And so it was last week that I found myself talking to my computer in an isolated room whilst deftly manipulating slides and dem…

.NET examples: C++ and using Object fields

Recently we had a question from a user of the NAG Library for .NET. He wondered whether it was possible to use methods from objects rather than static methods as callback parameters to the NAG methods. The library was designed such that this should be possible, but we were made aware that there were not many examples of this usage in the documentation. Also the user was coding in C++/CLR and currently we have no examples of this, all examples being C#, F# or VB.Net.

We took the existing C# example for the optimisation routine e04uc and modified it in two ways. Firstly converting to C++/CLR, and then modifying the example so that the objective function being minimised is a method of an object (of locally declared class NagDelegate) and to demonstrate two ways in which data may be passed between successive calls to this callback parameter.

Programming gnuplot

One of the side effects of having the word 'visualisation' in your job title is that people expect you to know something about the subject. Accordingly, every now and again I get contacted by one of my colleagues who needs to draw a graph, or reformat an image, or incorporate a visualisation into a document, and is - usually - too busy with other (probably more important) activities to spend a lot of time figuring out how to make a graphics package behave itself and do the right thing.

Good Business Analytics Conference

I have not yet written a note about the good experience I had at the 2011 INFORMS Conference on Business Analytics and Operations Research in Chicago, where NAG had a booth with demonstrations of our library routines. ....I guess 'now' is as good a time as any to do so. The conference was very well attended, up around 30% over last year by many accounts, and included a wide variety of analytical types; academics and practitioners with many different specialities. It was a good opportunity to understand how the best analytical techniques are applied in different environments. During the three days my colleagues and I managed to talk with lots of people. Some were users of NAG routines and some who did not know us at all. It was a pleasure to meet all of you. My note is just to say thanks to fellow attendees, as well as the organizers, for a stimulating 3 days – hope to speak with many of you again soon

Aging Fortran Codes - A Crisis in Slow Motion

Fortran isn't dead but some of the critical scientific codes written in it will be on life-support soon if research sponsoring organizations don't react soon. It was just a little over four years years ago that we read about the death of John Backus, the leader of the IBM that invented the Fortran language in 1954. It was 54 years ago that the first Fortran compiler was released commercially.

In that span of time millions of lines of Fortran code have been written in Fortran IV, Fortran 66 and 77 as well as variants such as Watfor. In listening to managers of codes at DOE, NASA universities and private companies (including independent software vendors) over the past several years, I am constantly amazed at how much code is in the early versions of Fortran.

People readily acknowledge the amount of code and the concern about the aging "expertise base" (i.e., people) who are charged with  maintaining and improving the code. They recognize that much of this code is &quo…

Turning off logic

Everybody knows about the two halves of our brain. One half deals with logical thought, facts etc. while the other deals with feelings, imagination and other things. They are linked at the base of the brain by the corpus collosum which is the sole place that they communicate with each other. The two halves work together as they take in information from the world through all of your senses, painting a "complete" picture of what is going on around you. For example the left side of your brain deals with the names of objects, whereas the right side deals with the objects function, so that when presented with a computer you are able to name it and describe what it does.

Artists and programmers are probably at two extremes of the spectrum when it comes down to which parts of our brain we use for our work. Artists almost certainly use much of their right brain, whereas I imagine that programmers use a lot of their left brains.

Whatever parts of our brain we use get exercised an…

Sticking to coding guidelines

Here at NAG we have a lot of rules governing how we write our code. These include things like which constructs we're allowed to use (not all compilers support complete specifications of languages such as Fortran 2003), how we allocate and deallocate memory (we insist on explicit deallocation in the same program scope as the original allocation to avoid memory leaks), how we name and declare variables etc. For many of these we have tools which can verify that the rules are being adhered to, some of which are based on our own compiler. For the rest, however, we rely on an internal peer review process where a colleague checks our work independently to ensure that it conforms to our standards. Recently a case arose where a relatively new colleague was writing a rather complicated piece of code and he came up against a problem. Being a clever chap he came up with an elegant solution which worked perfectly in the context that he was working in and required only a minimal change to t…

Performance and Results

What's in a catch phrase?

As you will hopefully know, NAG's strapline is "Results Matter. Trust NAG".

What matters to you, our customers, is results. Correct results that you can rely on. Our strapline invites you to trust NAG - our people and our software products - to deliver that for you.

When I joined NAG to help develop the High Performance Computing (HPC) services and consulting business, one of the early discussions raised the possibility of using a new version of this strapline for our HPC business, reflecting the performance emphasis of the increased HPC activity. Probably the best suggestion was "Performance Matters. Trust NAG." Close second was "Productivity Matters. Trust NAG."

The Addictive Allure of Supercomputing

The European Medical Device Technology (EMDT) magazine interviewed me recently. InsideHPC also has pointed to the interview here.

The interview discusses false hopes of users: "Computers will always get faster – I just have to wait for the next processor and my application will run faster."

We still see this so often - managers, researchers, programmers even - all waiting for the silver bullet that will make multicore processors run their application faster with no extra effort from them. There is nothing now or coming soon that will do that except for a few special cases. Getting performance from multicore processors means evolving your code for parallel processing. Tools and parallelized library plugins can help - but in many cases they won't be a substitute for re-writing key parts of the code using multithreading or similar techniques.

Of course, NAG can help ...

NAG out and about

The NAG website has a section called "Meet our experts - NAG out and about", which gives a list of upcoming events worldwide that NAG experts will be attending or presenting at.

The page also notes: "We regularly organise and participate in conferences, seminars and training days with our customers and partners. If you would like to talk to us about hosting a NAG seminar at your organisation or any training requirements you might have email us at".

In my own focus of high performance computing (HPC), I have previously written (for ZDNet UK) about some key supercomputing events. For those of you interested in meeting up with HPC experts (especially from NAG!), I have set up a survey of HPC events - please let us know which events you plan to attend in 2011 - and see which events other readers of The NAG Blog are attending.

Calling NAG routines from IDL

The collection of numerical algorithms contained in the NAG Library has been a valuable and widely-used resource for many years, and it's something that we're continually updating and maintaining lest the expression "has been" becomes an uncomfortably relevant adjective. To this end, we're - for example - developing and testing new routines for the next Mark of the Library, have just released a new version of the Library for the .NET environment, and are continuing to try and make our algorithms accessible from as many languages and packages as possible. Besides .NET, these include MATLAB®, Excel, Maple, Java, Python and many others (some of which are listed on this page). In spite of our best efforts in this area however, there will always be environments that we've yet to cover fully.Fortunately, our users - besides possessing a commendably high level of discernment in their selection of numerical libraries - are talented and resourceful individuals. Fo…

Wandering Precision

If you call the same numerical library routine twice with exactly the same input data, you expect to get identical results - don't you? Well, it all depends. If you're calling a routine that somehow uses random numbers, for example a solver based on a monte carlo method, then the results might be different - but then you'd probably accept that (assuming that you'd been warned in the documentation). But what if you're calling a numerical routine that in theory contains no randomness, but you still get slightly different results? And what if those slightly different results cause you problems - for example if you depend on repeatability for testing purposes? Then you might waste a lot of time hunting for the cause. Well, this problem has turned up more than once recently for us at NAG, and in the cases we've looked at it has turned out to be a problem with the way the machine does its arithmetic - or rather, in the way that the compiler tells the machine to do…

The joy of creating new solvers...

It’s an exciting time at the moment with a whole range of new routines being completed ready for the next Library release. The development group here are a highly motivated set of hard working folks, many with post-doc experience in a plethora of different areas of mathematics and computer science. While bringing their own individual knowledge to the code, they also get together as a well orchestrated team as all the methods are cross checked and fine tuned and documented for inclusion as new additions to the NAG library. The next Library release will include more optimization routines, additional regression methods, extended wavelet functions, new surface fitting routines, further ODE solvers, enhanced random number generators... to mention only some of the content. So, particularly at the moment, it’s a real pleasure to have conversations with the individual developers and hear how some of the subtle design decisions that are made during the development process provide such large …

True Customer Engagement (when social is not so social)

About a year ago NAG embarked on a new journey into the realms of social media as a new way of engaging with our customers and potential customers. For many years we’d relied on communicating via the website, email, telephone and letter (all of which we still do of course), but we felt social media outlets could provide a great new way of improving communication.

First we created the NAG Blog. The vision for the blog is to provide an outlet for NAG staff to share their thoughts with the outside world in an informal way. We also created a space for NAG on Twitter and a group on Linkedin. So far, we’ve been pleased with how the groups have grown with followers and readers, but feel what might be lacking with all three places is true interaction with our audience.

The statistics show that people are reading and following, yet there's little two way dialogue. I’ve been trying to understand why this is, I've concluded that it's probably down to a host of reasons. Here are my …

NAG Life Service Recognition Award

You don’t often feel like singing about being 40 years old except when you are a software company with such a rich history and as many good friends, colleagues and controbutors to remember. So it would seem very fitting in NAG’s 40th anniversary year to create the NAG Life Service Recognition Award. The award aims to recognise valuable contribution to the company over an extended period of time. An invitation went out last week to all members of NAG to submit nominations for this award. The award will be made at AGM35 this September. It’s a shame that we have lost touch with quite a few good friends, colleagues and contributors, I would love to hear from anyone who is interested in what we are up to now.