Thursday, 24 May 2012

ISC'12 Hamburg Preview

ISC'12 - the summer's big international conference for the world of supercomputing - is next month in Hamburg.

I will be attending, along with several of my NAG colleagues. Will you be attending? What will you be looking to learn? I will be listening out for these five key topics.

GPU vs MIC vs Other

As at ISC'11 last year (and SC11), I think there will be a strong fight for attention in the key area of manycore/GPU devices - and a matching search for evidence of real progress. So far the loudest voice has been NVidia and CUDA, especially following NVidia's successful GTC event recently. However, interest in Intel's MIC (Knights Corner) is strong and growing - MIC has often been a big discussion topic in workshops, conferences and meetings over the last year. As the MIC product launch gets closer, people will be making obvious comparisons with NVidia's Kepler announced at the GTC.

What about others - will anyone else develop a strong voice in this manycore world? AMD Fusion? ARM? DSP-based products? Will we talk with the same energy about the software issues of manycore, or just the hardware choices?

What is happening with Exascale?

The quest to attain exascale computing rumbles on. I'd expect exascale to take a big share of the debate and agenda at ISC'12. What is happening with the exascale programs around the world? How are the budgets in the weak global economy affecting the exascale ambition? How are the various national pride (I mean national competitiveness) efforts towards exascale progressing? Will the software challenges get the level of investment needed? What new technologies will emerge to be studied as candidates to solve part of the problems getting to exascale?

Is exascale so old hat - do we need to move to discussion of zettaFLOPS to be trendy now? Will zettaFLOPS be impossible (Sterling) or inevitable (Barr)? Maybe we should spare some discussion for making multi-petaFLOPS work properly first?

Monday, 21 May 2012

An Affair with the Java Native Access (JNA)

I was recently speaking to a colleague about my first couple projects here at NAG. The first project was learning to call the Library from Python using c-types (thanks to Mike Croucher’s blog which helped immensely). Next, was a project using the Java Native Interface (JNI), which I had difficulty using. After hearing the above two pieces of information, my colleague recommended I look into Java Native Access (JNA) as it was very similar to c-types in Python. Thus began a brief love affair! I say ‘love affair’ because my experience the JNA was a bit of a roller coaster of highs and lows. In the beginning, the JNA and I got along great. As time went on, I was left sitting at the computer screen wondering what to do next, hoping for the JNA to fix things.

Background of JNI

NAG already has a thorough technical report on our website for calling the NAG Library using the Java Native Interface. This includes creating header files, compiling java files, compiling the interface library, and running the program. Seems like lots of work, even for simple functions. I was hoping the JNA would be easier.

First date with the JNA

To start using the JNA you just need to go to download the .jar file from https://github.com/twall/jna. Download the file and then move it to the directory you will be working in. Unzip it to create a com folder and you’re done! You can now start using it. Whenever you need to use a package from the JNA, just import it at the top of your Java file.

My first impression of the JNA started off on a high note. I found it extremely easy to start using the interface. Looking at code for calling the Bessel function (routine s17acc):

Friday, 11 May 2012

Optimization, statistics, big data and business analytics

Last month, we attended the INFORMS 2012 conference in order to learn more about current activities in the field of business analytics, and to present the results of some of the work we've done in this area.  The meeting kicked off with a series of interesting technology workshops run by commercial companies as a means of promulgating their software systems; the main insight I got from them was the importance that the community places on high-quality optimization solvers in areas like prescriptive analytics, in which quantitative methods are employed to help make better decisions in business.

The NAG Library contains a variety of optimization routines (for both local and global minimization) - along with, of course, a wide range of solvers for other types of problems in analytics (such as statistical analysis, correlation and regression modelling and time series analysis) and in a variety of other numerical areas.  At the conference, we presented the results of some consultancy work performed for a client who was using NAG routines to solve a large-scale constrained optimization problem arising from activities such as price promotion (see abstract 4 on this list for more details).


The remainder of the conference consisted of a couple of plenary talks (from Google and eBay), an entertaining panel discussion on the perennial topic of Big Data, and a collection of contributed talks which were arranged in fifteen parallel sessions on topics like The Analytics Process, Decision Analytics, Analytics Around Us, etc.  I found the standard of the presentations to be very high; a few personal highlights were:


Friday, 13 April 2012

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!

Tuesday, 3 April 2012

How To: Call Brent's Root-Finding Algorithm From C#

As a Senior Technical Consultant for NAG, I answer many customer questions covering many topics. I thought I’d write up one such question I recently received from a NAG C Library user, as the answer may be useful to others.

Q: In looking through the C# associated info, I found many examples of InteropService calls from C# to the C Library (CLW3209DA_nag.dll). Have any examples been posted for the "c05" functions, e.g. nag_zero_cont_func_brent_bsrch(c05agc)?

A: I'm glad you asked! By the time you reach the end of this post, there will be one. J
In working with the NAG C Library from C#, there are three main factors to which we must attend. The first is how to represent the NAG C Library structure types in C#, and for C# this has largely been taken care of for you in NAGCFunctionsAPI.cs.

Tuesday, 20 March 2012

How to worry about everything (and nothing)




Worry - To feel uneasy or concerned about something.
In my last post I wrote about managing your e-mail inbox (in the narrow sense) and, more broadly, managing your work and commitments. I ended that last post with this quote: "If you worry about everything, then you don't have to worry about anything." At least one reader suggested that I owed them an explanation and so here it is.

You'll recall that I challenged you (and me) to get our e-mail inboxes empty at least once per week in a systematic way, as follows:
Go through you inbox one message at a time and ask yourself "Is there an action required?"

If the answer is "No", then either delete as trash, file it elsewhere for later reference or file it in your "great things I'd like to do someday but don't know when" folder. Be ruthless.

Thursday, 1 March 2012

Adding functionality to Excel using the NAG Library for .NET

Much of our work at NAG is devoted to creating new implementations of our numerical libraries and attempting to make their algorithms available from as many languages and packages as possible, so that our users have access to them from whichever environment they're working in. Thus, users of packages such as MATLAB® (and similar packages such Octave), LabVIEW and Maple, and programmers working in languages like Java, Python and Visual Basic (along with, of course, more traditional languages such as C and Fortran) have all been making use of NAG algorithms to enhance their applications and solve numerical problems for a long time.

Microsoft Excel® users can easily access NAG routines from both the NAG Fortran Library and the NAG C Library, because they are distributed as Dynamic Link Libraries (DLLs). For example, my colleague Marcin Krzysztofik has recently described how to solve a nonlinear least-squares problem in Excel using the nag_opt_nlin_lsq (e04unc) routine from the NAG C Library.

Thursday, 23 February 2012

Upgrades - hotels, airlines and HPC

I was pointed to this short but interesting blog today: "What's your upgrade?" by @therichbrooks, which makes the point that customers like it when businesses over-deliver on expectations. It is easy to understand what over-deliver might mean for hotels, airlines, rental cars, etc. - upgrades! - but it is equally important for other businesses to consider.

In the contexts of High Performance Computing (HPC) and of software, upgrades are a part of the routine. This covers both upgrades to newer or more powerful hardware (e.g. see the recent upgrades to the Cray supercomputers at HECToR - the UK's national supercomputing service - run by partners including NAG for CSE Support); and software upgrades for new features etc. However, these are all expected and planned upgrades - whilst they do deliver more to the customers, they are not a "over-delivery". And of course, for the service teams, upgrades mean hard work installing, testing, benchmarking and documenting the updated system.

But the key point of the linked blog was not upgrades, rather it was about managing (and meeting) customer expectations - and about over-delivery.

Friday, 17 February 2012

Self Improvement - An Algorithm for getting to "empty"

Whether we like it or not, at NAG and many other organizations, we live in an "e-mail" culture meaning that e-mails are how we communicate, receive and retain information. For many of us, e-mails also document both what we have done and what we still have to do. If you are like most in this culture, your e-mail inbox is the hub of your work life. I'm going to suggest an inbox "experiment" for you but first, a little fun.

One of my favorite ways to get to know someone is to ask how they use their inbox. It's almost a litmus test for personalities. So, what does yours say about you? Is yours:

The Black Hole: E-mail gets sucked in but never leaves, a filing cabinet with one gigantic drawer and two folders labelled "In" and "Sent". Periodically, either due to an inspired desire to get organized or "intervention" from a systems administrator, the inbox gets purged and the cycle begins anew.

The Formula One Pit: E-mail comes racing in and the pit crew (you) frantically tries to dash off a response that nominally addresses or acknowledges the item. It could be a "holding" response (thinking about it, promise to get back to you later) or a delegating response (passing it on or telling the writer to see some one else). The key feature, like the pit crew, is to get it out as fast as possible. This is a difficult personality to maintain, especially when you aren't connected to the network or need to sleep;-)

The Swiss Army Knife: This inbox, like its multi-tool namesake, can do most everything. It carries information for later reference, tasks that need to be done, dates/times for meetings, etc. It does it all. Stuff gets thrown out or filed elsewhere occasionally when it has been taken care of but it remains the ultimate "nerve center" of work life.

Wednesday, 15 February 2012

How to solve a NLLS problem using SQP method in Excel?

NLLS stands for nonlinear least-squares and SQP is sequential quadratic programming. So essentially this is an optimization problem, and everyone knows that NAG Library's chapter e04 is the best place to look for optimization solvers. The appropriate NAG routine in our C Library is nag_opt_nlin_lsq (e04unc).

A few weeks ago one of our users contacted NAG and asked for an example program of using e04unc in Excel. NAG and Excel page has quite a few examples and guidelines about using NAG Library in Excel, but we didn't have this particular one.

I wrote this example and now it is available for download on the Excel page. I encourage readers of this blog to download it and play with it on your own. It wasn't difficult to create it, but there was one issue that caused me a nasty headache. Some routines that have callback functions (just as e04unc does) where a vector or matrix is passed to/from a subroutine require usage of Windows API subroutine RtlMoveMemory.

Thursday, 2 February 2012

Girls, Geeks, Twitter and Me.

When I get to work one of the first things that I do each morning is check out what’s happening on my Twitter timeline. One Thursday, a couple of weeks ago, one particular tweet caught my eye. It lead me to a great blog 'Girls can love computing; someone just needs to show them how' about the Manchester Girl Geeks. They are a group who are trying to encourage more girls and women to be interested in maths, science and technology. Being a girl myself, (OK, a woman really), and working for a mathematical software company, the article sparked a real interest.




A Girl Geek Tea Party

When I was at school, maths wasn’t my best subject, well actually and I’m going to be completely honest with you, it was my worst subject. My fear of all things mathematical started after being made to stand in front of the class reciting times tables. So it’s somewhat ironic that I found myself working at a numerical software company a few years ago, albeit in the marketing department. Had the 'Girl Geeks' been around in the 80s and had visited my school it might have made maths and science a bit more alluring for me. It’s a sad truth that girls are still way in the minority in choosing technical and science options at GCSE, A’level and degree level*. 

NAG want to help in some way to reverse this trend. I think I can speak for NAG in saying that we want to see more women achieving prominence in our organisation and in scientific computing in general.

Anyway, back to my reason for blogging. After reading about the great work that Manchester Girl Geeks are involved in we decided to support them by way of sponsorship. I’m writing today to raise awareness of their mission as we feel it’s really worthwhile. We have some ideas for other ways in which NAG can assist their goals in the future.

What other ways can we as an organisation make a positive difference?


*around 16% in 2009 of students in undergraduate computer science degrees are female.