<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1352688022620133175</id><updated>2012-01-27T10:43:22.531Z</updated><category term='mex'/><category term='Compiler'/><category term='NAG Toolbox for Matlab'/><category term='differential equations'/><category term='fantasy football'/><category term='collaboration'/><category term='C'/><category term='manycore'/><category term='Computational Science'/><category term='recognition'/><category term='events'/><category term='interfaces'/><category term='algorithms'/><category term='linkedin'/><category term='trends'/><category term='customer engagement'/><category term='queries'/><category term='DOM'/><category term='applications'/><category term='University'/><category term='NAG'/><category term='e-mail'/><category term='video'/><category term='Algorithm Design'/><category term='email'/><category term='Fortran Standards'/><category term='Documentation'/><category term='Monte Carlo'/><category term='training'/><category term='SIAM'/><category term='supercomputing'/><category term='prize'/><category term='option pricing'/><category term='Higham'/><category term='NAG Library'/><category term='colour'/><category term='plot'/><category term='information overload'/><category term='java'/><category term='Fortran 2003'/><category term='webinar'/><category term='inverse problems'/><category term='life numerical analyst'/><category term='algol 60'/><category term='Mathematical Finance'/><category term='XML'/><category term='routine names'/><category term='F#'/><category term='quant congress'/><category term='personal productivity'/><category term='VBA'/><category term='gpu'/><category term='Fortran'/><category term='pseudorandom'/><category term='wrappers'/><category term='MATLAB'/><category term='color'/><category term='optimization'/><category term='portfolio optimisation'/><category term='marketing'/><category term='quality'/><category term='DLM'/><category term='LabVIEW'/><category term='statistics'/><category term='blogging'/><category term='descriptions'/><category term='tree display'/><category term='svn'/><category term='subversion'/><category term='.NET'/><category term='figure'/><category term='Excel'/><category term='file formats'/><category term='gnuplot'/><category term='Python'/><category term='Impact of Architecture and Technology for Extreme Scale on Software and Algorithm Design'/><category term='hpc'/><category term='Malcolm Cohen'/><category term='public'/><category term='Fortran 90'/><category term='IDL'/><category term='HECToR'/><category term='image recognition'/><category term='Libraries'/><category term='visualisation'/><category term='VSTO'/><category term='decision tree'/><category term='random numbers'/><category term='Visual Basic'/><category term='trivia'/><category term='ParaView'/><category term='DotNET'/><category term='productivity'/><category term='image'/><category term='SC11'/><category term='football'/><category term='new york'/><category term='c library'/><category term='Numerical'/><category term='research'/><category term='cloud computing'/><category term='supercomputer'/><category term='endianness'/><category term='Freemat'/><category term='Matrix Exponential'/><category term='Fortran 95'/><category term='implementation'/><category term='migration'/><category term='multicore'/><category term='web services'/><category term='VB'/><category term='SMP'/><category term='quiz'/><category term='Manchester'/><category term='illusion'/><category term='student'/><category term='diagram'/><category term='GPGPU'/><category term='twitter'/><category term='Fortran 2008'/><category term='social media'/><category term='writing'/><category term='Pascal'/><category term='R'/><category term='quasirandom'/><title type='text'>The NAG Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.nag.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.nag.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Katie O'Hare</name><uri>http://www.blogger.com/profile/09366741271809330805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_i0peT_HmUfg/S1bVfzjngYI/AAAAAAAAACk/VCRfSRPJ7KQ/S220/ImageforGoogle.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>93</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4690143193879606291</id><published>2012-01-19T18:22:00.001Z</published><updated>2012-01-19T18:27:19.402Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='statistics'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='supercomputing'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Science'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud computing'/><category scheme='http://www.blogger.com/atom/ns#' term='public'/><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='supercomputer'/><category scheme='http://www.blogger.com/atom/ns#' term='research'/><category scheme='http://www.blogger.com/atom/ns#' term='trends'/><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><title type='text'>Cloud computing or HPC? Finding trends.</title><content type='html'>&lt;b&gt;Enable innovation and efficiency in product design and manufacture by using more powerful simulations. Apply more complex models to better understand and predict the behaviour of the world around us. Process datasets faster and with more advance analyses to extract more reliable and previously hidden insights and opportunities.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
All ambitions that will probably resonate with those seeking scientific advances, commercial innovation, industrial growth and more cost-effective research. Underpinning all of the above is the use of more powerful computing methods and technologies. Faster and more capable computers - but equally important - more advanced and better performing algorithms and software implementations.&lt;br /&gt;
&lt;br /&gt;
It's a pretty convincing story for those who take the time to listen - whether business leaders, governments, or research funders. Even in these challenging economic times, it has led to investments from industry and governments for this reason - the potential return is well documented and significant. It is even enticing enough to interest the media and the public - especially when we use emotive descriptions like "&lt;i&gt;world's fastest supercomputer&lt;/i&gt;", "&lt;i&gt;international competitiveness in digital economy&lt;/i&gt;", "&lt;i&gt;personal supercomputing&lt;/i&gt;", and so on.&lt;br /&gt;
&lt;br /&gt;
And it is this last thought that cause me to diverge from the grand theme to explore names and attention. I will come back to the main theme later (a future blog), as it is both important and timely. But on to my side topic.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Anybody using, selling or funding the technologies and methods described above will know what I am talking about. But the names and labels applied to it can vary significantly across the diverse audience. High performance computing (HPC), supercomputing, computational science and engineering, technical computing, advanced computer modelling, advanced research computing, etc. The range of names/labels and the diversity of the audience involved mean that what is a common everyday term for many (e.g. HPC) is an unrecognised meaningless acronym to others - even though they are doing "HPC".&lt;br /&gt;
&lt;br /&gt;
This can create a barrier to engaging politicians, companies that could benefit, the media, and people in search of solutions for their day-to-day modelling/simulation/data processing challenges.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Let's play.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Most of us who see this as part of our daily life use the terms HPC or supercomputing. How do these stack   up with the wider world? Let's turn to Google Trends as an arbitrary tool of statistics.&lt;br /&gt;
&lt;br /&gt;
The following graph shows the search popularity of these terms ("supercomputer" and "HPC") over the last few years. Clearly "HPC" is a more common keyword.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://www.google.com/trends/viz?q=supercomputer,+hpc&amp;amp;date=all&amp;amp;geo=all&amp;amp;graph=weekly_img&amp;amp;sort=0&amp;amp;sa=N" width="500" /&gt;&lt;br /&gt;
&lt;b&gt;[Plot 1: blue = supercomputer, red = HPC]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
But what if we add in that term that is so often considered just a buzzword by seasoned HPC professionals - "cloud computing"?&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://www.google.com/trends/viz?q=supercomputer,+hpc,+cloud+computing&amp;amp;date=all&amp;amp;geo=all&amp;amp;graph=weekly_img&amp;amp;sort=0&amp;amp;sa=N" width="500" /&gt;&lt;br /&gt;
&lt;b&gt;[Plot 2: blue = supercomputer, red = HPC, orange = cloud computing]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We see that in the last few years "cloud computing" has soared above the traditional names in usage. This means a wider audience - and thus more possibilities for that ambitious opening paragraph of mine.&lt;br /&gt;
&lt;br /&gt;
Adding some more technical terms ("parallel computing", "multicore") hardly register in comparative popularity.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://www.google.com/trends/viz?q=supercomputer,+hpc,+cloud+computing,+parallel+computing,+multicore&amp;amp;date=all&amp;amp;geo=all&amp;amp;graph=weekly_img&amp;amp;sort=0&amp;amp;sa=N" width="500" /&gt;&lt;br /&gt;
&lt;b&gt;[Plot 3: blue = supercomputer, red = HPC, orange = cloud computing, green = parallel computing, purple = multicore]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Interestingly, adding a domain specific term ("CFD") tracks the popularity of HPC rather than cloud computing.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://www.google.com/trends/viz?q=hpc,+cloud+computing,+cfd&amp;amp;date=all&amp;amp;geo=all&amp;amp;graph=weekly_img&amp;amp;sort=0&amp;amp;sa=N" width="500" /&gt;&lt;br /&gt;
&lt;b&gt;[Plot 4: blue = CFD, red = HPC, orange = cloud computing]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You can play the same game with key technologies of the supercomputing world - e.g. [&lt;i&gt;MPI, OpenMP, CUDA, OpenCL, Fortran&lt;/i&gt;] - and discover more interesting trends, but as this blog is already getting long - that is for another day.&lt;br /&gt;
&lt;br /&gt;
I'll just leave you with this one, which might be interpreted as speaking volumes to the challenges faced in delivering the promise of my opening paragraph - [&lt;i&gt;computer, software, programmer, algorithm&lt;/i&gt;].&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="computer {blue}, software {red}, programmer {orange}, algorithm {green}" src="http://www.google.com/trends/viz?q=computer,+software,+programmer,+algorithm&amp;amp;date=all&amp;amp;geo=all&amp;amp;graph=weekly_img&amp;amp;sort=0&amp;amp;sa=N" width="500" /&gt;&lt;br /&gt;
&lt;b&gt;[Plot 5: red = computer, blue = software, orange = programmer, green = algorithm]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;What interesting related trends can you find and analyze?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4690143193879606291?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4690143193879606291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2012/01/cloud-computing-or-hpc-finding-trends.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4690143193879606291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4690143193879606291'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2012/01/cloud-computing-or-hpc-finding-trends.html' title='Cloud computing or HPC? Finding trends.'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-646189285253049915</id><published>2012-01-05T18:09:00.000Z</published><updated>2012-01-05T19:26:31.373Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='productivity'/><category scheme='http://www.blogger.com/atom/ns#' term='email'/><category scheme='http://www.blogger.com/atom/ns#' term='e-mail'/><category scheme='http://www.blogger.com/atom/ns#' term='writing'/><title type='text'>Self-Improvement</title><content type='html'>Winston Churchill once said "The pessimist sees difficulty in every opportunity. The optimist sees the opportunity in every difficulty." (for you confirmed pedants, it may have been L.P. Jacks)&lt;br /&gt;
&lt;br /&gt;
My custom is to use the time away from work at the end of the year to think about what I want to do differently in the year ahead. Among the topics that came up was e-mail, the bane of my life and perhaps yours as well. I get hundreds every day (and that doesn't include the SPAM). &lt;br /&gt;
&lt;br /&gt;
Being a lifelong optimist I've decided to make e-mail less of a pain in my life, both work and personal. Being an occasional realist, I recognize that I have a limited number of options and they must focus on what I can do.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
So, here's my plan for 2012 (with acknowledgement to Scott Belsky and Stever Robbins&amp;nbsp;who supplied some of the ideas and got me thinking). See &lt;a href="http://www.fastcompany.com/1796677/work-smart-disrupt-your-inbox" target="_blank"&gt;Disrupt Your Inbox&lt;/a&gt; and &lt;a href="http://getitdone.quickanddirtytips.com/what-should-you-never-say-in-an-email.aspx" target="_blank"&gt;What you should never say in an e-mail&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Experiment with three-sentence emails when I need an answer from someone. (improve the likelihood that someone will actually read and answer).&lt;/li&gt;
&lt;li&gt;Start e-mails with action I want, Don't leave the reader guessing until the end.&lt;/li&gt;
&lt;li&gt;Use subject lines that intrigue the reader and actually invite them to open and read&amp;nbsp;the e-mail.&lt;/li&gt;
&lt;li&gt;Take disagreements offline. There are volumes that could be written on this. &lt;/li&gt;
&lt;li&gt;Don't "reply all" unless everyone needs to be involved. How do you feel when you are one of 92 people copied on an e-mail that doesn't interest or pertain to you? Resist the urge, it's probably illegal.&lt;/li&gt;
&lt;li&gt;If you need to make several points and expect a response, use&amp;nbsp;numbers for reference to reduce length, opportunity for confusion.&lt;/li&gt;
&lt;/ul&gt;
What's your plan?&lt;br /&gt;
&lt;br /&gt;
More on managing e-mail in a future installment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-646189285253049915?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/646189285253049915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2012/01/self-improvement.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/646189285253049915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/646189285253049915'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2012/01/self-improvement.html' title='Self-Improvement'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4485219156077083564</id><published>2012-01-03T17:20:00.000Z</published><updated>2012-01-05T12:12:37.944Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='image recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='quiz'/><category scheme='http://www.blogger.com/atom/ns#' term='queries'/><category scheme='http://www.blogger.com/atom/ns#' term='inverse problems'/><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><title type='text'>Question one: Where's my phone?</title><content type='html'>The end of the year at NAG is always celebrated with a rather splendid Christmas lunch, which is generously paid for by the company as an acknowledgement of the hard work its employees have put in over the previous twelve months.  Accordingly, it provides an occasion for some much-needed relaxation and refreshment before the Christmas break.  It's also the time for the NAG Christmas Quiz which, whilst not necessarily contributing to the participants' relaxation, usually provides some entertainment or diversion for those who care about such arcane matters as the &lt;a href="http://en.wikipedia.org/wiki/Octopus#Biology"&gt;number of hearts an octopus has&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Paul_mccartney"&gt;Paul McCartney's middle name&lt;/a&gt;.  One of those tortured souls is the present author, who cleverly realized some time ago that the only way to be sure of knowing all the answers to the questions was to set them.&lt;br /&gt;
&lt;br /&gt;
Setting quiz questions in the connected age - particularly for a technical-savvy band such as the employees of NAG - can present a few challenges, however.  For example, anyone with internet access (via, say, a smartphone's web browser) would be able to find the answers to the questions indicated above in a matter of moments.  More direct questions, such as&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/A_Child's_Christmas_in_Wales"&gt;Who&lt;/a&gt; wrote "A Child's Christmas In Wales"?&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.carols.org.uk/good_king_wenceslas.htm"&gt;What&lt;/a&gt; kind of logs did Good King Wenceslas ask for?&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Merry_Christmas_Everybody"&gt;When&lt;/a&gt; was "Merry Xmas Everybody" number 1 in the UK?&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
are even easier to answer, though some skill and judgement may still be required in the selection of the correct response to an ambiguous or ill-posed question such as the first one on this list (does it refer to Dylan Thomas's prose piece or &lt;a href="http://en.wikipedia.org/wiki/Paris_1919_(album)"&gt;John Cale's song&lt;/a&gt;?).  Whilst this is clearly a valid and imaginative use of technology, I wondered whether it would provide an unfair advantage over those participants who wouldn't be using their phones in this fashion (or texting more knowledgeable friends for answers) and started wondering about ways to obviate their effectiveness. &lt;br /&gt;
&lt;br /&gt;
I realized fairly quickly that confiscating all phones on entry to the restaurant didn't fall within my powers as quizmaster (chiefly because I didn't have any) and, for a similar reason, there were no funds in the quizmaster's budget for the purchase of a mobile phone jammer.  My suggestion that we should move the location of the Christmas lunch to the interior of a Faraday cage in order to attenuate the phone signal wasn't looked on too kindly by senior management (or the restaurant) either.  Accordingly, I began thinking about using questions that were more indirect, which might make searching for an answer more difficult.  For example: &lt;i&gt;what's the connection between these three things?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Queen Jezebel&lt;/li&gt;
&lt;li&gt;The Regents of Prague&lt;/li&gt;
&lt;li&gt;Chopin's piano&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
This type of query is - very roughly - analogous to a so-called &lt;a href="http://en.wikipedia.org/wiki/Inverse_problem"&gt;inverse problem&lt;/a&gt; in science, in which we're asked to use observed data or results to deduce something about an underlying system or model.  It can be harder to answer because there may be several models that are consistent with the observations - for example, one thing that connects the three things is that each contains the letter 'n', but that's not necessarily the right answer (which is ever-so-vaguely computer related, lest I be accused of straying too far off-topic). &lt;br /&gt;
&lt;br /&gt;
Another type of problem that might present more challenges in the search for an answer is image recognition.  Whilst mobile tools such as &lt;a href="http://www.google.com/mobile/goggles/#text"&gt;Google Goggles&lt;/a&gt; are already trying to make this easier for specific examples (e.g. in the identification of labels and landmarks), it's still either very difficult or impossible to recognize arbitrary objects.  In the context of the quiz, this means questions such as: &lt;i&gt;identify these people:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vOUum-tK7Jk/TwSO-8H0CzI/AAAAAAAAAGA/l8WvTNMM4hM/s1600/f5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="186" src="http://4.bp.blogspot.com/-vOUum-tK7Jk/TwSO-8H0CzI/AAAAAAAAAGA/l8WvTNMM4hM/s200/f5.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3IsOE5kohlo/TwSO_VQ16xI/AAAAAAAAAGE/OU2YmXB7plQ/s1600/f4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="165" src="http://4.bp.blogspot.com/-3IsOE5kohlo/TwSO_VQ16xI/AAAAAAAAAGE/OU2YmXB7plQ/s200/f4.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ooI0mpFT_o0/TwSO_gSpYYI/AAAAAAAAAGM/u--faHoK2WI/s1600/f3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://1.bp.blogspot.com/-ooI0mpFT_o0/TwSO_gSpYYI/AAAAAAAAAGM/u--faHoK2WI/s200/f3.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-gnY1Ye0UGjs/TwSPABmRmNI/AAAAAAAAAGU/utp71w6ZHdg/s1600/f2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="184" src="http://2.bp.blogspot.com/-gnY1Ye0UGjs/TwSPABmRmNI/AAAAAAAAAGU/utp71w6ZHdg/s200/f2.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ozefOimCfqI/TwSPAq6rL1I/AAAAAAAAAGY/EFRU3XOWUgg/s1600/f1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/-ozefOimCfqI/TwSPAq6rL1I/AAAAAAAAAGY/EFRU3XOWUgg/s200/f1.png" width="190" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
or &lt;i&gt;name these films:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-PpA_sMey-qU/TwSQHS5T3ZI/AAAAAAAAAGs/Lc2E8SPsW78/s1600/ds.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-PpA_sMey-qU/TwSQHS5T3ZI/AAAAAAAAAGs/Lc2E8SPsW78/s200/ds.png" width="135" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-20PZpcE1mVM/TwSQHnoPXNI/AAAAAAAAAGw/FNRQddQxvmU/s1600/hp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-20PZpcE1mVM/TwSQHnoPXNI/AAAAAAAAAGw/FNRQddQxvmU/s200/hp.png" width="135" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ev3_fN20QO0/TwSQIOrPjTI/AAAAAAAAAG4/xvgaNrOQtkw/s1600/mc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-ev3_fN20QO0/TwSQIOrPjTI/AAAAAAAAAG4/xvgaNrOQtkw/s200/mc.png" width="135" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vb8PPIkz4_g/TwSQIj3k-2I/AAAAAAAAAHA/xFkS6k_8fvc/s1600/slih.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/-vb8PPIkz4_g/TwSQIj3k-2I/AAAAAAAAAHA/xFkS6k_8fvc/s200/slih.png" width="133" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-FqKSht1LXg0/TwSQJA1huyI/AAAAAAAAAHE/jJBFCPokk08/s1600/sw3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-FqKSht1LXg0/TwSQJA1huyI/AAAAAAAAAHE/jJBFCPokk08/s200/sw3.png" width="135" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I'm not sure how effective my preparations were, but the quiz appeared to provide the usual amount of stimulation, along with a certain degree of exaltation and frustration (only for those who care about this sort of thing, naturally).  Some of the participants have even started talking to me again, but that might be just the supervening effect of the Christmas break, and all the goodwill-to-all associated with that happy season.&lt;br /&gt;
&lt;br /&gt;
PS If you'd like to answer any of the questions above, please feel free to add a comment below, although I regret to say that the unbelievably fabulous prizes have long been consumed by the winners of the quiz.  Don't use your phone, though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4485219156077083564?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4485219156077083564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2012/01/question-one-wheres-my-phone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4485219156077083564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4485219156077083564'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2012/01/question-one-wheres-my-phone.html' title='Question one: Where&apos;s my phone?'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-vOUum-tK7Jk/TwSO-8H0CzI/AAAAAAAAAGA/l8WvTNMM4hM/s72-c/f5.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8917724711453985832</id><published>2011-12-01T13:42:00.001Z</published><updated>2011-12-01T13:53:05.634Z</updated><title type='text'>Coffee and Filters</title><content type='html'>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,&amp;nbsp;providing demand management software for major retailers around the world.&lt;br /&gt;
&lt;br /&gt;
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 must analyze prior results to set the new price of each item, decide whether to run promotions and decide&amp;nbsp;how much inventory to&amp;nbsp;purchase. The simulation creates an interaction both with consumers and with the other teams in the competition. Ultimately, the three teams with the highest profit at the end of two weeks advance to the regional finals here in Chicago. &lt;br /&gt;
&lt;br /&gt;
At the Chicago Regional finals held November 10th, teams from Glenbard West High School and Wheaton Warrenville South High School gave presentations of their data analysis, strategy formulation and how they worked as a team as they adapted their strategy in the course of the contest. The judges for the contest were experienced professionals in retail analytics from DemandTec and other local companies. Our winners were team “Price Lords” consisting of Peter Ericksen and Greg Grabarek. Each of them received $2500 toward their colleges expenses next year from NAG and our co-sponsor software company Informatica. Our third sponsor was the Network of Executive Women (NEW), which supports the education and advancement of women in leadership roles.&lt;br /&gt;
&lt;br /&gt;
This contest is a labor of love for those of us involved. We have cultivated relationships with teachers of mathematics and statistics at local schools and have made presentations on the contest to a number of high school classes. It not only engages us with the students and teachers but it also helps us educate the next generation of applied scientists who might one day be NAG users. We wish Peter and Greg good luck as they compete in the national semi-finals in early December and are already making plans or next year’s contest.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8917724711453985832?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8917724711453985832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/12/coffee-and-filters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8917724711453985832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8917724711453985832'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/12/coffee-and-filters.html' title='Coffee and Filters'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4069070667928433172</id><published>2011-11-23T11:21:00.001Z</published><updated>2012-01-03T17:00:20.646Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Calling NAG routines from R</title><content type='html'>&lt;a href="http://www.r-project.org/"&gt;R&lt;/a&gt; is a widely-used environment for statistical computing and data analysis.  It is one of the modern implementations of the &lt;a href="http://en.wikipedia.org/wiki/S_(programming_language)"&gt;S&lt;/a&gt; programming language (i.e. much code written in S will run unaltered in R) although its underlying semantics are derived from &lt;a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)"&gt;Scheme&lt;/a&gt;.  R is &lt;a href="http://www.r-project.org/COPYING"&gt;Free Software&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The capabilities of R can be extended through the use of &lt;i&gt;add-on packages&lt;/i&gt; and a large number of these are available from the &lt;a href="http://cran.r-project.org/"&gt;Comprehensive R Archive Network (CRAN)&lt;/a&gt;.  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 &lt;a href="http://www.nag.co.uk/numeric/R/r-package"&gt;NAGFWrappers R package&lt;/a&gt; contains the &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/pdf/E04/e04intro.pdf"&gt;local&lt;/a&gt; and &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/pdf/E05/e05intro.pdf"&gt;global&lt;/a&gt; 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 &lt;i&gt;Rdoc&lt;/i&gt; style that will automatically produce help pages within the R system (see figure below), and also in HTML and PDF - for example, &lt;a href="http://www.nag.co.uk/numeric/R/html23/00Index.html"&gt;here&lt;/a&gt; is the full list of NAG routines that are contained in the package.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-FSqL51CSbvk/Ts0ECUpTTxI/AAAAAAAAAF0/1AyuzcMxkFg/s1600/rhelp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;
&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-FSqL51CSbvk/Ts0ECUpTTxI/AAAAAAAAAF0/1AyuzcMxkFg/s400/rhelp.png" style="display: block; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center;" /&gt;&lt;br /&gt;
&lt;span style="font-size: 85%;"&gt;Help for the NAG routine e04uc, as displayed in R&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
For completeness, and to help R users further, we have also published &lt;a href="http://www.nag.co.uk/numeric/R/r-overview"&gt;more general instructions&lt;/a&gt; about how to use the R extension mechanisms to access any NAG routine from within R.&lt;br /&gt;
&lt;br /&gt;
The original version of NAGFWrappers has been available since mid-2011; we have just updated it to use &lt;a href="http://www.nag.co.uk/numeric/FL/newatmark23"&gt;Mark 23&lt;/a&gt; of the Fortran Library, and are releasing R binary packages for &lt;a href="http://www.nag.co.uk/numeric/R/R2.13/NAGFWrappers_23.0.zip"&gt;Windows 32 bit&lt;/a&gt; and &lt;a href="http://www.nag.co.uk/numeric/R/R2.13-64/NAGFWrappers_23.0.zip"&gt;Windows 64 bit&lt;/a&gt;, along with the &lt;a href="http://www.nag.co.uk/numeric/R/NAGFWrappers_23.0.tar.gz"&gt;R source package&lt;/a&gt; which can be used on other platforms (for example, we have built and run it on 64 bit Linux).&lt;br /&gt;
&lt;br /&gt;
It should perhaps be noted that this is a preview release of the package, which is aimed at obtaining user feedback.  Although it has been built and run on the platforms mentioned above, it is not a NAG product.  We are keen to receive user feedback, and will respond to technical queries and problem reports via &lt;a href="mailto:support@nag.co.uk"&gt;support@nag.co.uk&lt;/a&gt; so that we can further refine this package and make it still more useful to the R community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4069070667928433172?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4069070667928433172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/11/calling-nag-routines-from-r.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4069070667928433172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4069070667928433172'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/11/calling-nag-routines-from-r.html' title='Calling NAG routines from R'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-FSqL51CSbvk/Ts0ECUpTTxI/AAAAAAAAAF0/1AyuzcMxkFg/s72-c/rhelp.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-374686888155530338</id><published>2011-11-01T18:41:00.000Z</published><updated>2011-11-02T19:14:55.835Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='supercomputing'/><category scheme='http://www.blogger.com/atom/ns#' term='SC11'/><title type='text'>SC11 diary catch up</title><content type='html'>I &lt;a href="http://blog.nag.com/2011/10/sc11-will-be-here-soon.html"&gt;posted here&lt;/a&gt; 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&amp;nbsp;summary&amp;nbsp;of the diary&amp;nbsp;entries&amp;nbsp;so far for those who haven't been reading along.&lt;br /&gt;
&lt;br /&gt;
If you recall, I said: "&lt;i&gt;On my twitter stream (&lt;a href="http://twitter.com/#!/hpcnotes"&gt;@hpcnotes&lt;/a&gt;), I described it as: "the world of #HPC in one week &amp;amp; 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 &lt;a href="http://twitter.com/#!/supercomputing"&gt;@supercomputing&lt;/a&gt; and/or the &lt;a href="http://twitter.com/#!/search?q=%23SC11"&gt;#SC11&lt;/a&gt; hashtag.&lt;/i&gt;"&lt;br /&gt;
&lt;br /&gt;
"&lt;i&gt;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.&lt;/i&gt;"&lt;br /&gt;
&lt;br /&gt;
"&lt;i&gt;So instead I am going to try to write a diary of the lead up to SC11.&lt;/i&gt;"&lt;br /&gt;
&lt;br /&gt;
If you've missed them, here are the 8 SC11 blogs so far:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-1.html"&gt;The big HPC&amp;nbsp;event of the year - lots of news, people &amp;amp; meetings. Busy week.&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-2.html"&gt;schedule certainty, locations, spare time &amp;amp; hard work&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-3.html"&gt;SC11 news deluge, the missing HPC world&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-4.html"&gt;how do you do it?&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-5.html"&gt;navigation, rope and choosing wisely&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-6.html"&gt;fog and sports events&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-7.html"&gt;not everyone will be in Seattle&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"&lt;a href="http://www.hpcnotes.com/2011/11/my-sc11-diary-8.html"&gt;ppt, professionals, preparation &amp;amp; precipitation&lt;/a&gt;"&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;Along the way, I have&amp;nbsp;briefly&amp;nbsp;alluded to a few things NAG will be doing at SC11. One of my&amp;nbsp;colleagues&amp;nbsp;will be along shortly to post here about our activities at SC11, but in the meantime, plan to visit us on booth 2622, or get in touch to arrange a conversation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-374686888155530338?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/374686888155530338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/11/sc11-diary-catch-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/374686888155530338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/374686888155530338'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/11/sc11-diary-catch-up.html' title='SC11 diary catch up'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1427228408591354793</id><published>2011-10-20T16:52:00.002+01:00</published><updated>2011-11-01T18:41:22.479Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='supercomputing'/><category scheme='http://www.blogger.com/atom/ns#' term='SC11'/><title type='text'>SC11 will be here soon</title><content type='html'>The &lt;a href="http://sc11.supercomputing.org/"&gt;SC11&lt;/a&gt; conference, or just "&lt;i&gt;supercomputing&lt;/i&gt;", will be held in Seattle this November. For many in the high performance computing community, including &lt;a href="http://www.nag.com/"&gt;NAG&lt;/a&gt;, SC is &lt;a href="http://www.hpcnotes.com/p/hpc-events.html"&gt;the big event&lt;/a&gt; of the year. Certainly&amp;nbsp;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.&lt;br /&gt;
&lt;br /&gt;
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&amp;nbsp;&lt;a href="http://twitter.com/#!/supercomputing"&gt;@supercomputing&lt;/a&gt;&amp;nbsp;and/or the&amp;nbsp;&lt;a href="http://twitter.com/#!/search?q=%23SC11"&gt;#SC11&lt;/a&gt;&amp;nbsp;hashtag. NAG's twitter team (&lt;a href="http://twitter.com/nagtalk"&gt;@NAGtalk&lt;/a&gt;) will also keep you up to date with NAG's activities and stories at SC11 and beyond.&lt;br /&gt;
&lt;br /&gt;
The NAG team will also post here on &lt;a href="http://blog.nag.com/"&gt;The NAG Blog&lt;/a&gt;&amp;nbsp;over&amp;nbsp;the coming days and weeks with&amp;nbsp;news about what NAG will be doing at SC11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will be adding to all this with a series of posts on my personal&amp;nbsp;&lt;a href="http://hpcnotes.com/"&gt;blog&lt;/a&gt;&amp;nbsp;- a&amp;nbsp;&lt;a href="http://www.hpcnotes.com/search/label/SC11"&gt;diary of the lead up and planning for SC11&lt;/a&gt;&amp;nbsp;- the&amp;nbsp;&lt;a href="http://www.hpcnotes.com/2011/10/my-sc11-diary-1.html"&gt;first entry was posted today&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
See you in Seattle.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1427228408591354793?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1427228408591354793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/10/sc11-will-be-here-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1427228408591354793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1427228408591354793'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/10/sc11-will-be-here-soon.html' title='SC11 will be here soon'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8592165550216185592</id><published>2011-10-06T15:02:00.024+01:00</published><updated>2011-10-13T11:36:09.524+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='statistics'/><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG Library'/><category scheme='http://www.blogger.com/atom/ns#' term='LabVIEW'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Calling routines from the NAG Fortran and C libraries from within LabVIEW</title><content type='html'>&lt;p&gt;This is a follow-on from my colleague Sorin Serban's recent &lt;a href="http://blog.nag.com/2011/07/using-nag-net-methods-in-labview.html"&gt;post&lt;/a&gt;, in which he looked at invoking methods from the &lt;a href="http://www.nag.co.uk/netdevelopers.asp"&gt;NAG Library for .NET&lt;/a&gt; from within the &lt;a href="http://www.ni.com/labview/"&gt;LabVIEW&lt;/a&gt; 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 &lt;a href="http://www.nag.co.uk/numeric/fl/FLdescription.asp"&gt;Fortran&lt;/a&gt; and &lt;a href="http://www.nag.co.uk/numeric/CL/CLdescription.asp"&gt;C&lt;/a&gt; libraries to do the same thing, and some of this work is discussed here.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="http://en.wikipedia.org/wiki/.NET_assembly"&gt;.NET assembly&lt;/a&gt;, whilst the C and Fortran libraries are (on the Windows platform) &lt;a href="http://en.wikipedia.org/wiki/Dynamic-link_library"&gt;dynamic link libraries&lt;/a&gt; (DLLs).  The .NET assembly uses the &lt;a href="http://en.wikipedia.org/wiki/Common_Language_Runtime"&gt;common language runtime&lt;/a&gt; (CLR) and the &lt;a href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET framework&lt;/a&gt; to manage assembly functions, and to export information about classes, methods, properties and events.  The practical implication of this is that when a method from the NAG Library for .NET is &lt;a href="http://blog.nag.com/2011/07/using-nag-net-methods-in-labview.html"&gt;loaded into LabVIEW&lt;/a&gt;, information about its function arguments is automatically loaded as well.  This is not the case with a DLL, as we shall see.&lt;/p&gt;

&lt;p&gt;As previously, we begin building a LabVIEW application by creating a blank virtual instrument (VI) using, for example, the &lt;i&gt;Blank VI&lt;/i&gt; option on LabVIEW’s Getting Started splash screen, and go to the &lt;i&gt;block diagram&lt;/i&gt;, which is where our routine will be loaded.  Once again, we build our example around the NAG routine &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;, which performs simple statistical calculations on a set of ungrouped data; besides being implemented as a method in the .NET Library, it is also available in both the &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl22/pdf/G01/g01aaf.pdf"&gt;Fortran&lt;/a&gt; and the &lt;a href="http://www.nag.co.uk/numeric/CL/nagdoc_cl09/pdf/G01/g01aac.pdf"&gt;C&lt;/a&gt; libraries.&lt;/p&gt;

&lt;p&gt;To load the routine, we first bring up the &lt;b&gt;&lt;i&gt;Functions Palette&lt;/i&gt;&lt;/b&gt;, using the option on the &lt;i&gt;View&lt;/i&gt; menu on the block diagram window.  Next, we open the &lt;b&gt;&lt;i&gt;Connectivity&lt;/i&gt;&lt;/b&gt; collection from the palette, and then the &lt;b&gt;&lt;i&gt;Libraries &amp;amp; Executables&lt;/i&gt;&lt;/b&gt; item.  This palette contains a variety of functions for calling code from libraries and executing system commands, and we select the &lt;b&gt;&lt;i&gt;Call Library Function&lt;/i&gt;&lt;/b&gt; item – which calls a DLL directly – and drag it onto the block diagram in order to initialize it.  To specify the library we want to call, we right-click on the node and select &lt;b&gt;&lt;i&gt;Configure...&lt;/i&gt;&lt;/b&gt;.  This brings up the &lt;b&gt;&lt;i&gt;Call Library Function&lt;/i&gt;&lt;/b&gt; dialog box, and we enter the name of the DLL in the &lt;b&gt;&lt;i&gt;Library name or path&lt;/i&gt;&lt;/b&gt; box.  In general, either the name or the path is acceptable, although the choice between between them &lt;a href="http://zone.ni.com/reference/en-XX/help/371361H-01/lvexcodeconcepts/locations_for_shared_libraries/"&gt;has consequences&lt;/a&gt; if the VI is to be distributed or relocated.  In our example, we're running LabVIEW under Windows, and are using the implementation of the NAG Fortran Library contained in &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;&lt;a href="http://www.nag.co.uk/doc/inun/fl22/dll4ml/un.html"&gt;FLDLL224M_nag.dll&lt;/a&gt;&lt;/span&gt;&lt;/b&gt; and the NAG C Library implementation in &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;&lt;a href="http://www.nag.co.uk/doc/inun/cl09/w32dal/un.html"&gt;CLW3209DA_nag.dll&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Having specified the library, we next select the name of the routine we wish to call by picking it from the drop-down list in the &lt;b&gt;&lt;i&gt;Function name&lt;/i&gt;&lt;/b&gt; dialog box; in our example, this is &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;G01AAF&lt;/span&gt;&lt;/b&gt; if we're using the NAG Fortran Library, or &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aac&lt;/span&gt;&lt;/b&gt; if it's the NAG C Library that we're calling.  In either case, we specify the calling convention as &lt;b&gt;&lt;i&gt;stdcall (WINAPI)&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;The next step is to tell LabVIEW about the argument list for our routine via the &lt;b&gt;&lt;i&gt;Parameters&lt;/i&gt;&lt;/b&gt; tab on the &lt;b&gt;&lt;i&gt;Call Library Function&lt;/i&gt;&lt;/b&gt; dialog box.  For each parameter, we specify its name, type and how it is to be passed (as a value or a pointer to a value) to LabVIEW when it calls the routine.  As these details are entered, LabVIEW updates the &lt;b&gt;&lt;i&gt;Function prototype&lt;/i&gt;&lt;/b&gt; display at the bottom of the dialog box with the C prototype of the routine (LabVIEW is written in C, and it is from this language that the external routine is called).  This table shows the parameters for &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;G01AAF&lt;/span&gt;&lt;/b&gt;, including their Fortran type, their LabVIEW specification and the C type that LabVIEW generates for the function prototype:&lt;/p&gt;

&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Fortran variable name&lt;/th&gt;&lt;th&gt;NAG Fortran type&lt;/th&gt;&lt;th&gt;LabVIEW Type&lt;/th&gt;&lt;th&gt;LabVIEW Constant?&lt;/th&gt;&lt;th&gt;LabVIEW Data type&lt;/th&gt;&lt;th&gt;LabVIEW Pass&lt;/th&gt;&lt;th&gt;LabVIEW Array

Format&lt;/th&gt;&lt;th&gt;LabVIEW C type&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;N&lt;/td&gt;&lt;td&gt;INTEGER&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;Y&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;const int32_t*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;X&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt; array&lt;/td&gt;&lt;td&gt;Array&lt;/td&gt;&lt;td align="center"&gt;Y&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td align="center"&gt;Array Data Pointer&lt;/td&gt;&lt;td&gt;const

double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IWT&lt;/td&gt;&lt;td&gt;INTEGER&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;int32_t*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WT&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt; array&lt;/td&gt;&lt;td&gt;Array&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td align="center"&gt;Array Data

Pointer&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XMEAN&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;S2&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;S3&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;S4&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XMIN&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XMAX&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WTSUM&lt;/td&gt;&lt;td&gt;&lt;i&gt;double precision&lt;/i&gt;&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-

&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IFAIL&lt;/td&gt;&lt;td&gt;INTEGER&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;int32_t*&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Although there are several parameters, many of them have the same characteristics.  Firstly we recall that, since Fortran passes arguments by reference (not by value), each parameter must be passed as a pointer when calling the Fortran routine from LabVIEW (i.e. from C).  Next, the &lt;a href="http://www.nag.co.uk/doc/inun/fl22/dll4ml/un.html#interpretation"&gt;documentation&lt;/a&gt; for this implementation of the NAG Fortran Library tells us that &lt;i&gt;double precision&lt;/i&gt; means &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;DOUBLE PRECISION&lt;/span&gt;&lt;/b&gt; - that is, an 8-byte floating point number, whilst the Fortran &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;INTEGER&lt;/span&gt;&lt;/b&gt; type is a 32-bit integer.  Hence, these two types can be respectively mapped to &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;double&lt;/span&gt;&lt;/b&gt; and &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;int32_t&lt;/span&gt;&lt;/b&gt;, via LabVIEW's &lt;b&gt;&lt;i&gt;8-byte Double&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;Signed 32-bit Integer&lt;/i&gt;&lt;/b&gt; types.  Finally, it can be seen how designating a variable as a constant (because it's only used on input to the routine) results in LabVIEW applying the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;const&lt;/span&gt;&lt;/b&gt; qualifier to the C type.&lt;/p&gt;

&lt;p&gt;Similar remarks apply, for the most part, to the use of the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aac&lt;/span&gt;&lt;/b&gt; routine (note that the parameter list is slightly different for this version of the routine):&lt;/p&gt;

&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;C variable name&lt;/th&gt;&lt;th&gt;NAG C type&lt;/th&gt;&lt;th&gt;LabVIEW Type&lt;/th&gt;&lt;th&gt;LabVIEW Constant?&lt;/th&gt;&lt;th&gt;LabVIEW Data type&lt;/th&gt;&lt;th&gt;LabVIEW Pass&lt;/th&gt;&lt;th&gt;LabVIEW Array

Format&lt;/th&gt;&lt;th&gt;LabVIEW C type&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;n&lt;/td&gt;&lt;td&gt;Integer&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;Y&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;const int32_t

&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;const double array&lt;/td&gt;&lt;td&gt;Array&lt;/td&gt;&lt;td align="center"&gt;Y&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td align="center"&gt;Array Data Pointer&lt;/td&gt;&lt;td&gt;const

double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;wt&lt;/td&gt;&lt;td&gt;const double array&lt;/td&gt;&lt;td&gt;Array&lt;/td&gt;&lt;td align="center"&gt;Y&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td align="center"&gt;Array Data Pointer&lt;/td&gt;&lt;td&gt;const double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;nvalid&lt;/td&gt;&lt;td&gt;Integer*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;int32_t*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xmean&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xsd&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xskew&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xkurt&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xmin&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xmax&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;wsum&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;8-byte Double&lt;/td&gt;&lt;td align="center"&gt;Pointer to Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;double*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;fail&lt;/td&gt;&lt;td&gt;NagError*&lt;/td&gt;&lt;td&gt;Numeric&lt;/td&gt;&lt;td align="center"&gt;N&lt;/td&gt;&lt;td&gt;Signed 32-bit Integer&lt;/td&gt;&lt;td align="center"&gt;Value&lt;/td&gt;&lt;td align="center"&gt;-&lt;/td&gt;&lt;td&gt;int32_t&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Since we're now calling a C routine from C, there is a closer correspondence between the NAG type and the LabVIEW C type, although a couple of additional explanatory remarks might be necessary.  Firstly, the NAG C Library uses a data type called &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;Integer&lt;/span&gt;&lt;/b&gt;; for &lt;a href="http://www.nag.co.uk/doc/inun/cl09/w32dal/un.html"&gt;this implementation&lt;/a&gt;, this is defined as &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;long&lt;/span&gt;&lt;/b&gt;, which is a 32-bit integer on Windows systems.  Secondly, the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;fail&lt;/span&gt;&lt;/b&gt; variable is a pointer to a C structure named &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;NagError&lt;/span&gt;&lt;/b&gt;; we access this using a 32-bit integer (not a pointer to an integer), which is the same size as the address of the structure.&lt;/p&gt;

&lt;p&gt;More information about how to create an interface between LabVIEW and external libraries (including advice for more complicated cases than those used here) is available &lt;a href="http://zone.ni.com/reference/en-XX/help/371361E-01/lvexcodeconcepts/configuring_the_clf_node/"&gt;here&lt;/a&gt;.  Having created the interface to the NAG routine, the final step is to add LabVIEW controls and indicators to handle the input and output of our application.  This is exactly the same procedure as was described &lt;a href="http://blog.nag.com/2011/07/using-nag-net-methods-in-labview.html"&gt;previously&lt;/a&gt;, and we conclude this post with Figure 1, which shows the block diagram of our application, centered around the &lt;b&gt;&lt;i&gt;Call Library Function&lt;/i&gt;&lt;/b&gt;, which is where the NAG routine (in this case, &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aac&lt;/span&gt;&lt;/b&gt;) is being called.&lt;/p&gt;

&lt;div style="text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-o_XX2eyCrvA/TpWro_LcZdI/AAAAAAAAAFQ/udnlULm2Djw/s1600/cfortlabview-fig1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 178px; height: 400px;" src="http://3.bp.blogspot.com/-o_XX2eyCrvA/TpWro_LcZdI/AAAAAAAAAFQ/udnlULm2Djw/s400/cfortlabview-fig1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5662620827130815954" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  The g01aac routine in the LabVIEW block diagram&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8592165550216185592?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8592165550216185592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/10/calling-routines-from-nag-fortran-and-c.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8592165550216185592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8592165550216185592'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/10/calling-routines-from-nag-fortran-and-c.html' title='Calling routines from the NAG Fortran and C libraries from within LabVIEW'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-o_XX2eyCrvA/TpWro_LcZdI/AAAAAAAAAFQ/udnlULm2Djw/s72-c/cfortlabview-fig1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-9172823528171308342</id><published>2011-09-08T14:35:00.003+01:00</published><updated>2011-09-08T14:49:30.420+01:00</updated><title type='text'>NAG communications</title><content type='html'>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, one of the best ways to keep up with all the information is via NAGnews. This e-newsletter contains articles on new product development and technical advancements along with developer tips and hints and event information. More than 7,000 subscribers already receive NAGNews, which is distributed approximately every 6 weeks. Registration is free of charge, and NAG will not share your details with any third party.&lt;/p&gt;

&lt;p&gt;NAGNews has been going for some time – in fact, the next issue will be the hundredth. Why not take a look &lt;a href="http://www.nag.com/NAGNews/index.asp"&gt;here&lt;/a&gt; if you’d like to consider asking to receive a copy?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-9172823528171308342?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/9172823528171308342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/09/nag-communications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9172823528171308342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9172823528171308342'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/09/nag-communications.html' title='NAG communications'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1141117719289396690</id><published>2011-08-22T15:27:00.005+01:00</published><updated>2011-08-22T15:42:18.757+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VSTO'/><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='DotNET'/><title type='text'>How do you use NAG in Excel?</title><content type='html'>&lt;p class="MsoNormal"&gt;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.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There are a few ways in which the Library can be called in Excel:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;xls/xlsm spreadsheet and VBA&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The most popular, widely used way: &lt;a href="http://www.nag.co.uk/numeric/nagandexcel.asp"&gt;NAG and Excel&lt;/a&gt; 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 &amp;amp; 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 results on the spreadsheet. Or you can create a UDF (User Defined Function) that is called straight from the spreadsheet, but inside uses NAG to compute some statistics, &lt;a href="http://www.nag.co.uk/numeric/NAGExcelExamples/NAGReverseComm_CLDLL.xls"&gt;find a zero of a function&lt;/a&gt;, or find a value of a European call option using &lt;a href="http://www.nag.co.uk/numeric/NAGExcelExamples/Option_Pricing_Example_Simple_CLDLL.xls"&gt;Black-Scholes Model&lt;/a&gt; or Heston’s Stochastic Volatility Model. This is the great thing about using NAG in conjunction with Excel- you can do it in many ways!&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;xla/xlam add-in and VBA&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Very similar to the previous point. The difference is that the VBA code for the macros and UDFs is in an Excel add-in. As a result the user’s data and the user’s code may be in two separate files. So the user needs to load the xla add-in while using his xls file to have the functions available. &lt;a href="http://www.cpearson.com/excel/createaddin.aspx"&gt;http://www.cpearson.com/excel/createaddin.aspx&lt;/a&gt; nicely describes how an xla add-in works and how to create it.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;xll add-in&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;An xll is a different type of add-in, it actually allows you to use your C/C++, Fortran, or VB code from Excel. This is actually a Dynamic Link Library (DLL) file that is compiled and accessible via Excel API. The benefit of having an xll is that it’s compiled and will be faster than using VBA. However it requires very cautious programming due to memory issues and is generally harder to program.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;VSTO&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Visual Studio Tools for Office is a set of development tools that allows creating Visual Studio projects in C# or VB.NET in the form of Excel add-ins that extend Excel’s features or customise the user interface. Since this is a .NET environment, it’s advisable to use the &lt;a href="http://www.nag.co.uk/netdevelopers.asp"&gt;NAG Library for .NET&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We look forward to hearing from our users and anyone that is interested in using Excel in conjunction with NAG. &lt;span&gt; &lt;/span&gt;How do you use Excel? What example programs do you think we should have on our website? Currently we have many examples on using NAG via VBA, but not many on the other methods. &lt;/p&gt;&lt;p class="MsoNormal"&gt;Tell us what you would find useful! &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1141117719289396690?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1141117719289396690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/08/how-do-you-use-nag-in-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1141117719289396690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1141117719289396690'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/08/how-do-you-use-nag-in-excel.html' title='How do you use NAG in Excel?'/><author><name>Marcin Krzysztofik</name><uri>http://www.blogger.com/profile/18261558624689201066</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_6PyYVdaBhFw/S1RmqpcRTCI/AAAAAAAAAAM/e0nyrnucwPU/S220/pic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-9180547173624860414</id><published>2011-08-19T22:38:00.003+01:00</published><updated>2011-08-22T07:59:36.927+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='supercomputing'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Science'/><category scheme='http://www.blogger.com/atom/ns#' term='public'/><title type='text'>What is this HPC thing?</title><content type='html'>&lt;i&gt;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.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The question? “&lt;i&gt;What do you do then?&lt;/i&gt;” Followed by: “&lt;i&gt;Oh! So what exactly is supercomputing then?&lt;/i&gt;”&lt;br /&gt;
&lt;br /&gt;
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 questioner is almost certainly not a scientist, and maybe even thinks using email, facebook or twitter is a big computing achievement.&lt;br /&gt;
&lt;br /&gt;
So, where do you start? The big computer? The science it enables? The money involved? You want to quickly convey the scale, the enormous range of user disciplines, the specialist nature, the benefits to everyday life. You want to distinguish it from laptops, tablet computers, and corporate servers. You want to avoid mentioning nuclear weapons labs. You’d even like to come across as cool, but it’s way too late for that.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It’s a question that I have seen leaders in the field of HPC struggle to answer effectively - either talking rubbish, stalling, or starting a monologue on computer science theory.
But really, especially in the current tough funding climate, it is something we should all learn to answer properly. Be able to explain quickly, simply – and relevantly – what HPC is all about. Make it sound the interesting, high paced, leading edge field that it is.&lt;br /&gt;
&lt;br /&gt;
Why can’t HPC have the same positive media grab that particle physics and astronomy have? If the mass media feel they can talk about &lt;a href="http://www.bbc.co.uk/news/science-environment-14258601"&gt;particle physics&lt;/a&gt;, &lt;a href="http://www.bbc.co.uk/news/science-environment-12891215"&gt;radio telescopes&lt;/a&gt;, &lt;a href="http://www.bbc.co.uk/news/science-environment-14581095"&gt;space telescopes&lt;/a&gt;, or &lt;a href="http://www.bbc.co.uk/news/science-environment-14580995"&gt;sun storms&lt;/a&gt;, 
then we should be able to make supercomputing amenable to the same audience.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;We know that many areas of research and industry can benefit hugely from High Performance Computing. And so it is important to the economy and society to have a strong HPC future. &lt;/b&gt;But for a strong future, HPC needs millions of HPC-aware students and public – maybe more than it needs thousands of extra HPC skilled programmers. The latter will follow naturally if the former is done well.  It is more essential to ensure the benefits of HPC are recognised by end user organisations for future generations.&lt;br /&gt;
&lt;br /&gt;
So, next time you are asked by family or strangers what you do, avoid the pause followed by a shy “&lt;i&gt;computer stuff&lt;/i&gt;” – instead answer “&lt;b&gt;supercomputing&lt;/b&gt;” and then quickly explain what that is and why it matters.&lt;br /&gt;
&lt;br /&gt;
And, if you can get the message across positively to family and strangers, then as well as the long term benefits above, you will find you have the skills to get it across positively to your funders, politicians, senior managers, board, etc. when the situation arises.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-9180547173624860414?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/9180547173624860414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/08/what-is-this-hpc-thing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9180547173624860414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9180547173624860414'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/08/what-is-this-hpc-thing.html' title='What is this HPC thing?'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1779759306168658202</id><published>2011-08-05T09:43:00.013+01:00</published><updated>2011-08-19T21:26:49.498+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='decision tree'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='tree display'/><category scheme='http://www.blogger.com/atom/ns#' term='implementation'/><title type='text'>Seeing the good for the trees</title><content type='html'>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, &lt;a href="http://www.nag.co.uk/downloads/fldownloads.asp"&gt;here&lt;/a&gt; is the list for the &lt;a href="http://www.nag.co.uk/numeric/fl/FLdescription.asp"&gt;NAG Fortran Library&lt;/a&gt;, 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Recently I was asked if I could produce a more intelligible representation of pages like this.  I was reminded initially of a &lt;a href="http://en.wikipedia.org/wiki/Decision_tree"&gt;decision tree&lt;/a&gt;, mainly because we already make use of these tools in our documentation as a way to help users select the most appropriate algorithm (or NAG routine) for the solution of their problem.  For example, figure 1 shows one of the decision trees which is part of the documentation for &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/html/D01/d01conts.html#D01"&gt;chapter D01&lt;/a&gt; of the NAG Fortran Library, which deals with numerical integration, or quadrature.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-qpB1IznmeaA/TjvFf2UUgRI/AAAAAAAAAEw/kLXqkOqPM8I/s1600/treefig1.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5637316509531668754" src="http://1.bp.blogspot.com/-qpB1IznmeaA/TjvFf2UUgRI/AAAAAAAAAEw/kLXqkOqPM8I/s400/treefig1.png" style="cursor: hand; cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 344px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  Decision tree to help users select the appropriate NAG quadrature routine&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This chapter currently contains twenty-nine routines, each of which is tailor-made for a different type of problem (e.g. integrands defined as a set of points or a function, functions that contain singularities, integration intervals that are finite, semi-infinite or infinite, etc), and the decision tree guides the user to a correct choice by asking questions about their problem.&lt;br /&gt;
&lt;br /&gt;
Recasting the implementation list as a decision tree (with questions such as "what platform?", "what operating system?", "what compiler?") seemed, then, to be the way forward.  However, I was conscious that I didn't want something which was as as set in stone as figure 1; for one thing, I was unsure about the initial layout of my tree.  I also knew that the tree would require maintenance as new implementations became available - for example, the &lt;a href="http://www.nag.co.uk/numeric/FL/newatmark23"&gt;latest release&lt;/a&gt; of the NAG Fortran Library is currently being made available on more platforms, and the picture (and the list) will have to be periodically updated to reflect this.  In addition, because the tree only contains branching nodes (points at which the path diverges) and leaf nodes (points at which the path terminates) but no converging nodes (points at which several paths come together), it could quickly become very large, and difficult to draw by hand.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there are a range of options for the display of decision trees.  Some of these - for example, &lt;a href="http://www.montefiore.ulg.ac.be/%7Egeurts/dtapplet/dtexplication.html"&gt;this one&lt;/a&gt; and &lt;a href="http://www.predictionworks.com/decisiontree/index.html"&gt;this one&lt;/a&gt; - also incorporate the calculation of the tree itself (for use in &lt;a href="http://en.wikipedia.org/wiki/Decision_tree_learning"&gt;machine learning&lt;/a&gt; applications), but this isn't necessary in the present example because we already have the structure of our tree.  The display of trees and graphs is an active research area (see, for example, &lt;a href="http://vidi.cs.ucdavis.edu/research/graphtree"&gt;here&lt;/a&gt;) and there is a variety of freely-available applications (for example &lt;a href="http://www.graphviz.org/About.php"&gt;this one&lt;/a&gt; and &lt;a href="http://www.codeproject.com/KB/WPF/LayeredTreeDraw.aspx"&gt;this one&lt;/a&gt;) which can be used.  In the end, I chose &lt;a href="http://prefuse.org/"&gt;prefuse&lt;/a&gt;, which is a Java-based toolkit for building interactive applications in &lt;a href="http://en.wikipedia.org/wiki/Information_visualization"&gt;information visualization&lt;/a&gt;, chiefly because their &lt;a href="http://prefuse.org/gallery/treeview/"&gt;treeview demo&lt;/a&gt; appeared to be close to what I wanted to do.&lt;br /&gt;
&lt;br /&gt;
I downloaded the prefuse distribution and, after some only limited success with the supplied build script, followed the advice of the documentation and built it from within the &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; IDE (more specifically, their advice was to use Eclipse "if you are a Java novice", which certainly rang a bell with me).  Adapting the treeview demo to my purposes was very straightforward because the tree structure and node names are read in as an XML file whose format is very simple (there are essentially just three elements: &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;tree&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;branch&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;leaf&lt;/span&gt;; these are labelled via &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;attribute&lt;/span&gt;s).  Figure 2 is a screen shot of the treeview demo running as a Java applet in the browser, displaying the implementation information for the NAG Fortran Library (i.e., based on the information presented &lt;a href="http://www.nag.co.uk/downloads/fldownloads.asp"&gt;here&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-qG3_F4RtuYU/Tjv79VPsZQI/AAAAAAAAAE4/6i4sMvxeBME/s1600/treefig2.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5637376389677868290" src="http://3.bp.blogspot.com/-qG3_F4RtuYU/Tjv79VPsZQI/AAAAAAAAAE4/6i4sMvxeBME/s400/treefig2.png" style="cursor: hand; cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 377px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 2.  Screenshot of the treeview demo, running as an applet in the browser&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The instructions at the bottom of the web page give the details of the applet's interface: how the user can pan, zoom and also change the orientation of the tree from its default left-to-right ordering.  Clicking on any of the nodes expands the tree from that point (and collapses any expanded node at the same level) which facilitates navigation.  Figure 3 shows the applet being used to determine the appropriate implementation of the NAG Fortran Library for applications built on machines having  the Sun X64 architecture, and using the Sun Studio 11 compiler; its NAG product code is &lt;a href="http://www.nag.co.uk/doc/inun/fl22/sa6dcl/in.html"&gt;FLSA622DCL&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Z8DELHqBgpU/TjwBdEHrb6I/AAAAAAAAAFA/at0d1YHo860/s1600/treefig3.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5637382432394801058" src="http://2.bp.blogspot.com/-Z8DELHqBgpU/TjwBdEHrb6I/AAAAAAAAAFA/at0d1YHo860/s400/treefig3.png" style="cursor: hand; cursor: pointer; display: block; height: 192px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 3.  Using the applet to select an appropriate version of the NAG Fortran Library for Sun&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
In a similar fashion, Figure 4 is a partial screenshot of the applet being used to select the correct implementation of the NAG Fortran Library for applications built on machines having the AMD64 architecture, and using the GNU Fortran compiler with the ILP64 data model; its NAG product code is &lt;a href="http://www.nag.co.uk/doc/inun/fl22/l6adhl/in.html"&gt;FLL6A22DHL&lt;/a&gt;.  Note that, in this screenshot, the orientation of the tree has been switched to a top-to-bottom ordering, which might be easier to navigate for some users.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-rNuE_euJQlg/TjwBv4ZWLVI/AAAAAAAAAFI/_qv8W2A0PTI/s1600/treefig4.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5637382755665194322" src="http://4.bp.blogspot.com/-rNuE_euJQlg/TjwBv4ZWLVI/AAAAAAAAAFI/_qv8W2A0PTI/s400/treefig4.png" style="cursor: hand; cursor: pointer; display: block; height: 285px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 4.  As figure 3, but now for Linux&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The applet is currently being tested internally at NAG, but initial feedback seems to indicate that its presentation of the implementation data represents a helpful supplement to the list format which has been in use up until now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1779759306168658202?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1779759306168658202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/08/seeing-good-for-trees.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1779759306168658202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1779759306168658202'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/08/seeing-good-for-trees.html' title='Seeing the good for the trees'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-qpB1IznmeaA/TjvFf2UUgRI/AAAAAAAAAEw/kLXqkOqPM8I/s72-c/treefig1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1875331395777069095</id><published>2011-07-14T20:26:00.011+01:00</published><updated>2011-08-19T21:27:46.806+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NAG Toolbox for Matlab'/><title type='text'>Types in The NAG Toolbox for Matlab®</title><content type='html'>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:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[vr, info] = f08nf(int64(1), int64(4), vr, tau);&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
and similarly why output parameters like info in this example have class int64 as opposed to double.&lt;br /&gt;
&lt;br /&gt;
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 validity of those coercions.  When we beta tested our original prototype the feedback we got was that this wasn't a big deal.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Back then, all the integers used in the NAG Toolbox were 32 bit, even on 64 bit machines.  This was because the version of LAPACK that Matlab used was 32 bit and we needed to be compatible with that since we were calling those routines ourselves.  In Matlab, 32 bit integers behave quite nicely: you can perform arithmetic on them and use them as the bounds in loops so users were unlikely to notice the types of objects that we returned.  However when Matlab switched to 64 bit integer versions of LAPACK we had to follow, and that's when things started to get harder. Back then it wasn't possible to do arithmetic on 64 bit integers in Matlab or to loop over them, and so programs to call our routines and their associated call-backs started to look quite clumsy with lots of casts between int64 and double.  At this point we started to consider whether to accept and return doubles and do the coercions transparently inside our wrappers.&lt;br /&gt;
&lt;br /&gt;
Unfortunately there is a problem with this approach, in that not all 64 bit integers can be represented as doubles.  For example consider the following Matlab session:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;gt;&amp;gt; x=2^53
x =
 9.0072e+015
&amp;gt;&amp;gt; x+1-x
ans =
    0
&amp;gt;&amp;gt; n=int64(2)^53
n =
    9007199254740992
&amp;gt;&amp;gt; n+1-x
ans =
                   1&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Since there are only 53 bits available to represent the mantissa in a double precision number, once we get beyond 2&lt;sup&gt;53&lt;/sup&gt; we can't represent every integer exactly.  For example in this case we can represent x and x+2, but not x+1.  In many cases integers returned by NAG routines will never be big enough for this to be a problem but there are places where we cannot be sure of this. The good news is that recent versions of Matlab support arithmetic on 64 bit integers although you still cannot loop over them, so the problem has been alleviated but hasn't quite gone away.&lt;br /&gt;
&lt;br /&gt;
There is another issue with having versions of the Toolbox that accept different kinds of integers, which is that it's harder to write portable code.  In the next version of the Toolbox we will provide two functions &lt;i&gt;nag_int&lt;/i&gt; and &lt;i&gt;nag_int_name&lt;/i&gt; to allow users to perform operations like:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[vr, info] = f08nf(nag_int(1), nag_int(4), vr, tau);
a = zeros(100, nag_int_name);&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
which will work correctly on both 32- and 64-bit toolboxes.&lt;br /&gt;
&lt;br /&gt;
As explained above, we can't always coerce a 64 bit integer to a double so we have no option but to pass integers to call-backs and return integers from calls to NAG routines.  However we could give users the option of passing doubles in the place of integer parameters to NAG routines, and returning doubles from call-back functions. With this approach the user could avoid explicit coercions (except when using a 64 bit integer as the end point of a loop) if they wished, but they would incur a performance penalty, which would be noticeable if arrays were involved (both in terms of execution speed and memory usage).  While we aren't planning this for the release later this year we would consider it for a future version if users wanted it.  I'd love to hear your thoughts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1875331395777069095?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1875331395777069095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/07/types-in-nag-toolbox-for-matlab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1875331395777069095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1875331395777069095'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/07/types-in-nag-toolbox-for-matlab.html' title='Types in The NAG Toolbox &lt;em&gt;for Matlab&lt;/em&gt;&lt;sup&gt;®&lt;/sup&gt;'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1875270733775799097</id><published>2011-07-12T14:09:00.001+01:00</published><updated>2011-07-12T15:08:10.556+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='migration'/><category scheme='http://www.blogger.com/atom/ns#' term='linkedin'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Why migrate from legacy systems?</title><content type='html'>&lt;i&gt;I was tempted by a colleague into posting an answer to a question on &lt;a href="http://www.linkedin.com/e/vgh/2707514/"&gt;LinkedIn&lt;/a&gt;. I thought it might be useful to reproduce that here for a potentially different audience ...&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Q: (&lt;a href="http://www.linkedin.com/answers/technology/software-development/TCH_SFT/864809-96558479"&gt;from LinkedIn&lt;/a&gt;)&lt;/b&gt;&lt;br /&gt;
"Why is it important to migrate from legacy systems? Is there anyone who can simplify the migration process?"&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;A: (my answer, there are others too)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Why migrate from legacy systems? There are two aspects to consider - protection and opportunity.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
On the protection side, it is a balance of risks - the future maintainability risk of staying with an older system against the inevitable pains of migration. The old saying "&lt;i&gt;if it ain't broke, don't fix it&lt;/i&gt;" is relevant, but the catch is that the further your legacy system falls behind current practice, when it finally does break the cost of the eventual fix is likely to be much greater.&lt;br /&gt;
&lt;br /&gt;
On the opportunity side, legacy systems may well be constrained in terms of performance, capabaility, features, etc. A more modern system may thus provide &lt;a href="http://blog.nag.com/2011/03/performance-and-results.html"&gt;significant business benefits from better performance, more powerful capabilities, or more relevant features&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In the end, if you are using a different system (e.g. &lt;a href="http://www.hpcnotes.com/2009/11/tough-choices-for-supercomputings.html"&gt;legacy&lt;/a&gt;) to most of your industry colleagues/competitors, then you are either operating at an advantage (e.g. cost, established solution, ...) or disadvantage (e.g. cost, performance, capability, ...). Make sure you know which.&lt;br /&gt;
&lt;br /&gt;
As to who can help - it depends on what migration you need (from which system? &lt;a href="http://blog.nag.com/2010/09/do-you-want-ice-with-your-supercomputer.html"&gt;migrate the application or recreate the functionaility?&lt;/a&gt; etc.)&lt;br /&gt;
&lt;br /&gt;
Readers of &lt;a href="http://blog.nag.com/"&gt;this blog&lt;/a&gt; will know that NAG provides &lt;a href="http://www.nag.co.uk/hpc"&gt;services&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/training"&gt;training&lt;/a&gt; and &lt;a href="http://www.nag.co.uk/hpc"&gt;consulting&lt;/a&gt; to support migration of application software (especially science &amp;amp; engineering, or involving parallel computing - &lt;a href="http://blog.nag.com/search/label/multicore"&gt;multicore&lt;/a&gt;, &lt;a href="http://blog.nag.com/search/label/hpc"&gt;supercomputers&lt;/a&gt;, etc).&lt;br /&gt;
&lt;br /&gt;
You can also &lt;a href="http://www.linkedin.com/e/vgh/2707514/"&gt;follow NAG on LinkedIn by joining our group&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1875270733775799097?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1875270733775799097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/07/why-migrate-from-legacy-systems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1875270733775799097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1875270733775799097'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/07/why-migrate-from-legacy-systems.html' title='Why migrate from legacy systems?'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-6570842812690948958</id><published>2011-07-08T14:01:00.025+01:00</published><updated>2011-08-04T14:48:46.352+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='statistics'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='LabVIEW'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Using NAG .NET methods in LabVIEW</title><content type='html'>Recently we were asked by users at a few European universities about how to call the NAG Library from within the popular &lt;a href="http://www.ni.com/labview/"&gt;LabVIEW&lt;/a&gt; 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 &lt;a href="http://www.nag.co.uk/numeric/LabView.asp"&gt;preliminary material&lt;/a&gt; on our website which describes a few aspects of using the &lt;a href="http://www.nag.co.uk/numeric/fl/FLdescription.asp"&gt;NAG Fortran Library&lt;/a&gt; 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 &lt;a href="http://www.nag.co.uk/netdevelopers.asp"&gt;NAG Library for .NET&lt;/a&gt; from LabVIEW, and we describe some of this work here.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
We begin building a LabVIEW application by creating a blank virtual instrument (VI) using, for example, the &lt;i&gt;Blank VI&lt;/i&gt; option on LabVIEW’s Getting Started splash screen.  This brings up two windows: a &lt;i&gt;front panel&lt;/i&gt; and a &lt;i&gt;block diagram&lt;/i&gt;.  The former contains the user interface of the VI which the user creates using &lt;i&gt;controls&lt;/i&gt; and &lt;i&gt;indicators&lt;/i&gt;, each of which is selected from a palette of options.  Code to control the objects in the front panel is added by the user to the block diagram; this is a manifestation of LabVIEW’s visual programming paradigm, which sees an application as being made up of a collection of nodes that are connected together in a way which reflects the flow of data between them.&lt;br /&gt;
&lt;br /&gt;
Our simple example application is built around the NAG method &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;, which calculates the mean, standard deviation and various other statistical quantities from a set of ungrouped data (details about the documentation for the NAG Library for .NET is available &lt;a href="http://www.nag.co.uk/netdevelopers.asp"&gt;here&lt;/a&gt;, while the documentation for the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt; routine in the NAG Fortran library is &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/xhtml/G01/g01aaf.xml"&gt;here&lt;/a&gt;).  To load the method, we first bring up the &lt;b&gt;&lt;i&gt;Functions Palette&lt;/i&gt;&lt;/b&gt;, using the option on the &lt;i&gt;View&lt;/i&gt; menu on the block diagram window.  Next, we open the &lt;b&gt;&lt;i&gt;Connectivity&lt;/i&gt;&lt;/b&gt; collection from the palette, and then the &lt;b&gt;&lt;i&gt;.NET&lt;/i&gt;&lt;/b&gt; item.  This palette contains a variety of functions for creating .NET objects, setting properties or calling methods on those objects.  We select the &lt;b&gt;&lt;i&gt;Invoke Node&lt;/i&gt;&lt;/b&gt; item – which invokes methods or performs actions on an object – and drag it onto the block diagram in order to initialize it.&lt;br /&gt;
&lt;br /&gt;
To specify the class on which to execute the property, we right-click on the node and select &lt;b&gt;&lt;i&gt;Select Class &amp;gt;&amp;gt; .NET &amp;gt;&amp;gt; Browse...&lt;/i&gt;&lt;/b&gt;.  This brings up the &lt;b&gt;&lt;i&gt;Select Object From Assembly&lt;/i&gt;&lt;/b&gt; dialog box.  If the NAG Library is not listed in the &lt;b&gt;&lt;i&gt;Assembly&lt;/i&gt;&lt;/b&gt; component, then we find it (typically in a location like &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;C:/Program Files/NAG/NAG Library for .NET/&lt;/span&gt;&lt;/b&gt;) using the &lt;b&gt;&lt;i&gt;Browse...&lt;/i&gt;&lt;/b&gt; component, choosing either &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;NAGLibrary32.dll&lt;/span&gt;&lt;/b&gt; or &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;NAGLibrary64.dll&lt;/span&gt;&lt;/b&gt;, depending on our machine architecture.  Double-clicking on the &lt;b&gt;&lt;i&gt;NagLibrary&lt;/i&gt;&lt;/b&gt; item in the Objects component on the dialog box then shows the objects which are available in this assembly; in our example we select &lt;b&gt;&lt;i&gt;G01&lt;/i&gt;&lt;/b&gt;, followed by &lt;i&gt;OK&lt;/i&gt; to load it into the Property Node.  To select the desired method from within the G01 class, we right-click once again on the node and select &lt;b&gt;&lt;i&gt;Create &amp;gt;&amp;gt; Method for NAGLibrary.G01 class &amp;gt;&amp;gt; g01aa&lt;/i&gt;&lt;/b&gt; (note that the items on the method menu explicitly show the function argument list, including the .NET types; they’re also prefixed with &lt;b&gt;&lt;i&gt;[S]&lt;/i&gt;&lt;/b&gt; if they’re a static .NET method).  This creates a node corresponding to a new instance of the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt; method in the block diagram (see figure 1).&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-n6MuvjyrWuw/ThcWy9aKuWI/AAAAAAAAABc/kZlUIP1BgSg/s1600/fig1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5626991324156311906" src="http://3.bp.blogspot.com/-n6MuvjyrWuw/ThcWy9aKuWI/AAAAAAAAABc/kZlUIP1BgSg/s320/fig1.png" style="cursor: hand; cursor: pointer; display: block; height: 263px; margin: 0px auto 10px; text-align: center; width: 116px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  The g01aa method in the LabVIEW block diagram&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
The next step in building our demo is to add LabVIEW controls and indicators to handle, respectively, the input and output of our application.  These get placed on the front panel and corresponding objects appear on the block diagram, where they’re then connected to other objects to specify the flow of data and control through the program.  In our application (see figure 2), we use a &lt;b&gt;&lt;i&gt;Numeric Indicator&lt;/i&gt;&lt;/b&gt; to display each output quantity from &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;, and a &lt;b&gt;&lt;i&gt;Numeric Control&lt;/i&gt;&lt;/b&gt; within an &lt;b&gt;&lt;i&gt;Array&lt;/i&gt;&lt;/b&gt; shell control to allow the user to enter the data values for which the routine will calculate the statistics (see &lt;a href="http://zone.ni.com/devzone/cda/tut/p/id/7571"&gt;here&lt;/a&gt; for more information on creating and using array controls in LabVIEW).&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-ApgjUbYleWQ/ThcXB69PdZI/AAAAAAAAABk/d-m-xadJPP4/s1600/fig2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5626991581196154258" src="http://4.bp.blogspot.com/-ApgjUbYleWQ/ThcXB69PdZI/AAAAAAAAABk/d-m-xadJPP4/s320/fig2.png" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 204px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 2.  Front panel of our demo application, with the (input) data array on the left, and the (output) statistics on the right&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
The block diagram of our application is shown in Figure 3.  Along with the objects corresponding to the controls and indicators described above, we’ve also used the &lt;b&gt;&lt;i&gt;Array Size&lt;/i&gt;&lt;/b&gt; function to determine the number of elements in the Data values array.  The output from this is used as input for &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;'s input parameter &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;n&lt;/span&gt;&lt;/b&gt; (i.e., the length of the array &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;x&lt;/span&gt;&lt;/b&gt;, which contains the data values), and also as the &lt;b&gt;&lt;i&gt;dimension size&lt;/i&gt;&lt;/b&gt; input parameter for the &lt;b&gt;&lt;i&gt;Initialize Array&lt;/i&gt;&lt;/b&gt; function.  The other input parameter for this function is &lt;b&gt;&lt;i&gt;element&lt;/i&gt;&lt;/b&gt;, which specifies the value to which all elements of the array are to be set; we use a &lt;b&gt;&lt;i&gt;DBL Numeric Constant&lt;/i&gt;&lt;/b&gt; to set this to zero, and the resultant array is used as input for &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;'s input parameter &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;wt&lt;/span&gt;&lt;/b&gt;, which is the array used to weight the data values in the in the calculation.  In fact, in this example, all values are weighted equally; we specify this by using a &lt;b&gt;&lt;i&gt;Numeric Constant&lt;/i&gt;&lt;/b&gt; to set &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt;'s input parameter &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;iwt&lt;/span&gt;&lt;/b&gt; to zero (see the &lt;b&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;g01aa&lt;/span&gt;&lt;/b&gt; &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/xhtml/G01/g01aaf.xml"&gt;documentation&lt;/a&gt; for more details).&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-TtIhT_P4mq4/ThcXGe7SCxI/AAAAAAAAABs/mRjmDJ97QLI/s1600/fig3.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5626991659571088146" src="http://1.bp.blogspot.com/-TtIhT_P4mq4/ThcXGe7SCxI/AAAAAAAAABs/mRjmDJ97QLI/s320/fig3.png" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 218px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 3.  Block diagram for our demo application.  Inputs to g01aa are on the left, and outputs on the right&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Although simple in application, this example has hopefully given a flavour of the way in which the NAG library for .NET can be used within LabVIEW.  Other methods which are offered by the library address the more complicated problems of local and global optimization of multivariate functions, pseudo and quasi random number generation, wavelet transforms, least-squares and eigenvalue determination, curve and surface fitting, summation of series and interpolation; more details about its functionality are available &lt;a href="http://www.nag.co.uk/netdevelopers.asp"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
If you have any questions about this work (or want to know more about using the NAG Fortran Library or the &lt;a href="http://www.nag.co.uk/numeric/CL/CLdescription.asp"&gt;NAG C Library&lt;/a&gt; with LabVIEW), then please &lt;a href="mailto:support@nag.co.uk?Subject=Using%20NAG%20in%20LabVIEW"&gt;get in touch&lt;/a&gt;.   I’d really love to hear from users (or prospective users) of NAG and/or LabVIEW, and want to build new examples that will be useful to researchers in this area.&lt;br /&gt;
&lt;br /&gt;
Finally, I’m grateful to my colleague &lt;a href="http://www.nag.co.uk/about/jwalton.asp"&gt;Jeremy Walton&lt;/a&gt; for his help in preparing this post, and his interest in this work.&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-6570842812690948958?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/6570842812690948958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/07/using-nag-net-methods-in-labview.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6570842812690948958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6570842812690948958'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/07/using-nag-net-methods-in-labview.html' title='Using NAG .NET methods in LabVIEW'/><author><name>Sorin</name><uri>http://www.blogger.com/profile/14742632015056333247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-n6MuvjyrWuw/ThcWy9aKuWI/AAAAAAAAABc/kZlUIP1BgSg/s72-c/fig1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2016425756111492370</id><published>2011-06-27T16:28:00.004+01:00</published><updated>2011-06-27T16:40:24.397+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='HECToR'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='GPGPU'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><category scheme='http://www.blogger.com/atom/ns#' term='manycore'/><title type='text'>ISC11 Review</title><content type='html'>Several of NAG's staff attended the &lt;a href="http://www.isc11.org/"&gt;International Supercomputing Conference (ISC)&lt;/a&gt; in Hamburg, Germany last week.

We took part in several aspects of the show ("&lt;a href="http://blog.nag.com/2011/06/talk-to-us-in-hamburg-isc11.html"&gt;Talk to us in Hamburg&lt;/a&gt;"). I also posted a &lt;a href="http://www.hpcnotes.com/2011/06/isc-11-preview.html"&gt;ISC11 preview&lt;/a&gt; with comments on I would be looking out for. So, what were my impressions after the show?&lt;br /&gt;
&lt;br /&gt;
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 ("&lt;a href="http://sc11.supercomputing.org/"&gt;SC&lt;/a&gt;" in USA each November).&lt;br /&gt;
&lt;br /&gt;
In my &lt;a href="http://www.hpcnotes.com/2011/06/isc-11-preview.html"&gt;preview&lt;/a&gt;, I said I was watching out for three battles:&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;&lt;b&gt;GPU vs MIC vs Fusion&lt;/b&gt;

The fight for top voice in &lt;a href="http://www.hpcnotes.com/2010/06/technical-computing-futures-part-2-gpu.html"&gt;manycore/GPU world&lt;/a&gt; will be one interesting theme of ISC11. Will this be the year that the GPU/manycore theme really means more than just NVidia and CUDA? AMD has opened the lid on Fusion in recent weeks and has sparked some real interest. Intel's MIC (or Knights) is probably set for some profile at ISC11 now the Knights Ferry program has been running a while. How will NVidia react to no longer being the loudest (only?) noise in GPU/manycore land? Or will NVidia's early momentum carry through?
&lt;/i&gt;&lt;/blockquote&gt;
&lt;b&gt;Review:&lt;/b&gt; None of this is definitive, but my gut reaction is that MIC won this battle. GPU lost. Fusion didn't play again. My feeling from talking to attendees was that MIC was second only to the &lt;a href="http://top500.org/lists/2011/06/press-release"&gt;K story&lt;/a&gt;, in terms of what people were talking about (and asking &lt;a href="http://www.nag.co.uk/Market/articles/nag_participating_with_intel_mic.pdf"&gt;NAG - as collaborators in the MIC programme&lt;/a&gt; - what we thought). Partly because of the MIC hype, and the K success (performance and power efficient without GPUs), GPUs took a quieter role than recent years. Fusion, disappointingly, once again seemed to have a quiet time in terms of people talking about it (or not). Result? As I thought, manycore is now realistically meaning more than just NVidia/CUDA.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;&lt;b&gt;Exascale vs Desktop HPC&lt;/b&gt;

Both the exascale vision/race/distraction (&lt;i&gt;select according to your preference&lt;/i&gt;) and the promise of desktop HPC (personal supercomputing?) have space on the agenda and exhibit floor at ISC11. Which will be the defining scale of the show? Will most attendees be discussing exascale and the research/development challenges to get there? Or will the hopes and constraints of "HPC for the masses" have people talking in the aisles? Will the lone voices trying to link the two extremes be heard? (technology trickle down, market solutions to efficient parallel programming etc.) What about the "missing middle"?
&lt;/i&gt;&lt;/blockquote&gt;
&lt;b&gt;Review:&lt;/b&gt; Exascale won this one hands down, I think. Some lone voices still tried to talk about desktop HPC, missing middles, mass usage of HPC and so-on. But exascale got the hype again (not necessarily wrong for one of the year's primary "supercomputing" shows!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;&lt;b&gt;Software vs Hardware&lt;/b&gt;

The biggie for me. Will this be the year that software really gets as much attention as hardware? &lt;a href="http://www.hpcnotes.com/2010/03/whats-next-revolution-in-technical.html"&gt;Will the challenges and opportunities of major applications renovation get the profile it deserves&lt;/a&gt;? Will people just continue to say "and software too". Or will the debate - and actions - start to follow? The themes above might (&lt;i&gt;should&lt;/i&gt;) help drive this (porting to GPU, new algorithms for manycore, new paradigms for exascale, etc). Will people trying to understand where to focus their budget get answers? Balance of hardware vs software development vs new skills? Balance of "protect legacy investment" against opportunity of fresh look at applications?
&lt;/i&gt;&lt;/blockquote&gt;
&lt;b&gt;Review:&lt;/b&gt; Hardware still got more attention than software. Top500, MIC, etc. Although ease-of-programming for MIC was a common question too. I did miss lots of talks, so perhaps there was more there focusing on applications and software challenges than I caught. But the chat in the corridors was still hardware dominated I thought.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;&lt;b&gt;The rest?&lt;/b&gt;

What have I not listed? &lt;b&gt;&lt;a href="http://www.hpcnotes.com/2010/10/comparing-hpc-across-china-usa-and_8099.html"&gt;National flag waving&lt;/a&gt;&lt;/b&gt;. I'm not sure I will be watching too closely whether USA, Japan, China, Russia or Europe get the most [systems|petaflops|press releases|whatever]. Nor the issue of &lt;b&gt;cloud vs traditional HPC&lt;/b&gt;. I'm not saying those two don't matter. But I am guessing the three topics above will have more impact on the lives of HPC users and technology developers - both next week and for the next year once back at work.
&lt;/i&gt;&lt;/blockquote&gt;
&lt;b&gt;Review:&lt;/b&gt; Well, I got those two wrong! Flags were out in force, with Japan (&lt;a href="http://www.fujitsu.com/global/about/tech/k/"&gt;K&lt;/a&gt;, Fujitsu, &lt;a href="http://www.top500.org/"&gt;Top500&lt;/a&gt;, etc) and France (Bull keynote) waving strongly among others. And clouds were seemingly the question to be asked at every panel! But in a way, I was still right - flags and clouds do matter and will get people talking - but I maintain that manycore, exascale vs desktop, and the desperation of software all matter more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;What did you learn? What stood out for you? Please add your comments and thoughts below ...&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2016425756111492370?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2016425756111492370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/06/isc11-review.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2016425756111492370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2016425756111492370'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/06/isc11-review.html' title='ISC11 Review'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3740541849202235065</id><published>2011-06-23T17:29:00.019+01:00</published><updated>2011-08-19T21:28:48.580+01:00</updated><title type='text'>Storing Banded Matrices for Speed</title><content type='html'>&lt;h2&gt;




&lt;/h2&gt;
&lt;h2&gt;



Introduction&lt;/h2&gt;
A real &lt;i&gt;n&lt;/i&gt;-by-&lt;i&gt;n&lt;/i&gt; matrix &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt; will, in general, be defined by its &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;&lt;i&gt;2&lt;/i&gt;&lt;/sup&gt; elements that would need to be stored for computations to be performed using &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt;.
If &lt;i&gt;n&lt;/i&gt; is very large, this can amount to a lot of storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Fortunately, many real world applications use sparse matrices that are comprised mainly of zero-valued elements; the number of defining elements that need to be stored is typically some fixed multiple of &lt;i&gt;n&lt;/i&gt; (30&lt;i&gt;n&lt;/i&gt;, say).

A special case is the banded matrix:&lt;br /&gt;
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;&lt;i&gt;Illustration 1: A banded matrix &lt;b&gt;A&lt;/b&gt;, with k&lt;sub&gt;l&lt;/sub&gt; sub- and k&lt;sub&gt;u&lt;/sub&gt; super-diagonals&lt;/i&gt;&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621507337963478338" src="http://1.bp.blogspot.com/-qRPSb1dvrNY/TgObI82QnUI/AAAAAAAAACQ/lZOXVSQW7Bc/s320/banded_storage_html_2c9a55a6.gif" style="cursor: pointer; display: block; height: 274px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
This banded matrix has elements defined on its main diagonal (the dashed line), on &lt;i&gt;k&lt;sub&gt;l&lt;/sub&gt;&lt;/i&gt; sub-diagonals (blue region) and on &lt;i&gt;k&lt;sub&gt;u&lt;/sub&gt;&lt;/i&gt;super-diagonals (green region). The total number of non-zero elements is &lt;i&gt;(k&lt;sub&gt;l&lt;/sub&gt;+k&lt;sub&gt;u&lt;/sub&gt;+1)n&lt;/i&gt; minus a few corner points.
What we would really like to do is solve problems using this matrix, like &lt;b&gt;&lt;i&gt;AX = Y&lt;/i&gt;&lt;/b&gt;, but storing only the non-zero elements.

Various storage formats emerged from various packages, but the most familiar to people solving such problems is that adopted by the linear algebra package LAPACK (and also used extensively in the NAG Libraries). This works by storing the non-zero elements of &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt; in a rectangular, (&lt;i&gt;k&lt;sub&gt;l&lt;/sub&gt;+k&lt;sub&gt;u&lt;/sub&gt;+1&lt;/i&gt;) by &lt;i&gt;n&lt;/i&gt;, matrix &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt;, such that the diagonals of &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt; become rows of &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt; while the columns of &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt; remain as columns of &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;
&lt;i&gt;Illustration 2: The matrix&lt;b&gt; A&lt;/b&gt; stored in LAPACK banded storage format as matrix &lt;b&gt;B&lt;/b&gt;.
&lt;/i&gt;
&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621740186739756610" src="http://2.bp.blogspot.com/-jnfg5GZUJvQ/TgRu6iIpTkI/AAAAAAAAADQ/FNzgEj91Hf4/s320/banded_storage_html_m3821073d.gif" style="cursor: pointer; display: block; height: 169px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
While this is appealing in terms of being able to reconstruct readily in our mind's eye the original matrix, it is less well suited to solving problems (such as &lt;i&gt;&lt;b&gt;AX = B&lt;/b&gt;&lt;/i&gt;) as quickly as possible. The problem is that most matrix computations rely, for their speed, on very fast kernel operations (written by the likes of Intel or AMD) working on smallish matrix blocks; this requires matrix blocks to be stored as you would expect for a general matrix, while in &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt; above the block elements have become higgledy-piggledy.
What is required is a storage format that keeps some of the block structure of the original matrix &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;h2&gt;


&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;


The Simplest Case - to ease you in&lt;/h2&gt;
To begin to describe an alternative storage scheme that preserves block structure, it is probably best to begin with the simplest scenario ...
a symmetric matrix with bandwidth &lt;i&gt;k&lt;/i&gt; and dimension &lt;i&gt;n&lt;/i&gt; = (&lt;i&gt;k&lt;/i&gt;+1)&lt;i&gt;m&lt;/i&gt;
(that is, &lt;i&gt;n&lt;/i&gt; is an integer multiple of &lt;i&gt;k+1&lt;/i&gt;)
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;
&lt;i&gt;Illustration 3: Symmetric banded matrix with lower half partitioned into triangular blocks.
&lt;/i&gt;
&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621739848755548002" src="http://1.bp.blogspot.com/-kxpWApSpA-I/TgRum3C7j2I/AAAAAAAAACw/142sSeDneJ8/s320/banded_storage_html_37bd49.gif" style="cursor: pointer; display: block; height: 292px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Once you partition a lower band (including main diagonal) into triangles as above, the possibilities for improved storage forms become immediately clear.
The &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt; triangular blocks can either be slid up or slid across to the right to complete a square (&lt;i&gt;k+1&lt;/i&gt; by &lt;i&gt;k+1&lt;/i&gt;) block with a neighbouring &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt; triangular block.
To make it easier to convert from LAPACK storage format, I will go for sliding the &lt;i&gt;&lt;b&gt;B&lt;/b&gt;&lt;/i&gt; blocks up, giving:&lt;br /&gt;
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;
&lt;i&gt;Illustration 4: Storage of symmetric band matrix preserving block structure.
&lt;/i&gt;
&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621739771829827794" src="http://2.bp.blogspot.com/-8IUeH41YUDs/TgRuiYeaONI/AAAAAAAAACo/UwR_CypWSco/s320/banded_storage_html_64dc1c3.gif" style="cursor: pointer; display: block; height: 87px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
The zero paranoiacs might want to remove the trailing zeros above by storing the last &lt;b&gt;&lt;i&gt;A&lt;sub&gt;3&lt;/sub&gt;&lt;/i&gt;&lt;/b&gt; triangle in &lt;i&gt;Rectangular Full Packed&lt;/i&gt; (RFP) format [see
&lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl23/xhtml/F07/f07intro.xml#recomm_32a"&gt;http://www.nag.co.uk/numeric/fl/nagdoc_fl23/xhtml/F07/f07intro.xml#recomm_32a&lt;/a&gt;], but this may be a little over-the-top.
&lt;br /&gt;
&lt;h3&gt;

&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;

What can you do with these blocks?&lt;/h3&gt;
Those in touch with their linear algebra side will now wonder what can be done with the banded matrix stored in this form. In particular, they will whisper the words &lt;i&gt;Cholesky decomposition&lt;/i&gt;.
Don't worry, it is just the first of two steps in solving &lt;i&gt;&lt;b&gt;AX = Y&lt;/b&gt;&lt;/i&gt;, a set of simultaneous equations. Without going into the nitty-gritty, I will just say that the lower triangular banded &lt;i&gt;&lt;b&gt;L&lt;/b&gt;&lt;/i&gt; formed in this decomposition can be partitioned exactly as above, and it can work with each triangular block in turn, overwriting them as it goes.
The second stage of solution, &lt;i&gt;backsubstitution&lt;/i&gt;, then works with the triangular blocks of  &lt;i&gt;&lt;b&gt;L&lt;/b&gt;&lt;/i&gt; to return the solution &lt;i&gt;&lt;b&gt;X&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;h3&gt;




How do I put A into this strange storage format?&lt;/h3&gt;
You couldn't be expected to do this yourself.
On the other hand it would be easy to write a utility routine that converted from the LAPACK style format to the above triangular block style; and this can be done in-place since columns are preserved.
The mapping between elements of the blocked storage matrix (&lt;i&gt;&lt;b&gt;C&lt;/b&gt;&lt;/i&gt;, say) and the elements of &lt;b&gt;&lt;i&gt;A&lt;/i&gt;&lt;/b&gt; is also quite straightforward:
&lt;br /&gt;
&lt;div style="font-size: 130%; text-align: center;"&gt;
&lt;b&gt;&lt;i&gt;C&lt;sub&gt;qj&lt;/sub&gt; = A&lt;sub&gt;ij&lt;/sub&gt;&lt;/i&gt;&lt;/b&gt;    for &lt;i&gt;j = 1,...,n&lt;/i&gt;   and   &lt;i&gt;i = j,...,j+k&lt;/i&gt;,
  where &lt;i&gt;q = mod(i-1,k+1) + 1&lt;/i&gt;.&lt;/div&gt;
This makes life easy when &lt;i&gt;&lt;b&gt;A&lt;sub&gt;ij&lt;/sub&gt;&lt;/b&gt;&lt;/i&gt; is a function of &lt;i&gt;i&lt;/i&gt; and &lt;i&gt;j&lt;/i&gt;.
&lt;br /&gt;
&lt;h2&gt;

&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;

The next simplest case -- to lessen your ease&lt;/h2&gt;
In the simplest case everything fitted just nicely, but for more general&lt;i&gt; n&lt;/i&gt; there are going to be some leftovers at the bottom-right of &lt;i&gt;&lt;b&gt;A&lt;/b&gt;&lt;/i&gt;.
A picture tells the story ...&lt;br /&gt;
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;
&lt;i&gt;Illustration 5: Symmetric banded matrix (lower half) with left-overs.
&lt;/i&gt;
&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621740045514943842" src="http://1.bp.blogspot.com/-cW6KPKaS5WQ/TgRuyUCBrWI/AAAAAAAAADA/4Qlie52Z-a4/s320/banded_storage_html_m63b7bfaf.gif" style="cursor: pointer; display: block; height: 268px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
And the mapping above tells us where to put the left-overs ...&lt;br /&gt;
&lt;br /&gt;
&lt;table class="image"&gt;
&lt;caption align="bottom"&gt;
&lt;i&gt;Illustration 6: Block storage pattern for symmteric banded matrix for general n.
&lt;/i&gt;
&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5621739966075588786" src="http://2.bp.blogspot.com/-dmJTiBqS-kU/TgRutsGNULI/AAAAAAAAAC4/vvwSIs8Ixuw/s320/banded_storage_html_m6efbb266.gif" style="cursor: pointer; display: block; height: 75px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;

&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;

Next?&lt;/h2&gt;
This stuff is all very well when we have symmetric matrices, but what about non-symmetric matrices like that in Illustration 1?
I'll leave that till the next blog (very soon).

Lawrence&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3740541849202235065?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3740541849202235065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/06/storing-banded-matrices-for-speed.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3740541849202235065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3740541849202235065'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/06/storing-banded-matrices-for-speed.html' title='Storing Banded Matrices for Speed'/><author><name>Lawrence Mulholland</name><uri>http://www.blogger.com/profile/01045459211178088315</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-qRPSb1dvrNY/TgObI82QnUI/AAAAAAAAACQ/lZOXVSQW7Bc/s72-c/banded_storage_html_2c9a55a6.gif' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2290458729902136991</id><published>2011-06-15T10:56:00.003+01:00</published><updated>2011-06-29T00:06:50.696+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>Talk to us in Hamburg - ISC11</title><content type='html'>&lt;p&gt;NAG will be at the &lt;a href="http://www.supercomp.de/isc11/"&gt;International Supercomputing Conference &lt;/a&gt;(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.&lt;/p&gt;
&lt;p&gt;Products on show will include the &lt;a href="http://www.nag.co.uk/numeric/FL/FSdescription.asp"&gt;NAG Library for SMP &amp; Multicore&lt;/a&gt;, the &lt;a href="http://www.nag.co.uk/numeric/fd/FDdescription.asp"&gt;NAG Parallel Library&lt;/a&gt;, numerical routines for GPUs, the &lt;a href="http://www.nag.co.uk/numeric/mb/design.asp"&gt;NAG Toolbox&lt;/a&gt; for MATLAB®.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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 Andrew Jones is one of the four panel members on the conference closing “Analyst Crossfire”, hosted by Addison Snell of InterSect360 on Thursday.&lt;/p&gt;
&lt;p&gt;Finally, NAG is expanding our HPC team in the USA and are looking for HPC programmers or CSE experts to be based at a customer site in Houston – so please come and talk to us if you are interested or can recommend anyone.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2290458729902136991?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2290458729902136991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/06/talk-to-us-in-hamburg-isc11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2290458729902136991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2290458729902136991'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/06/talk-to-us-in-hamburg-isc11.html' title='Talk to us in Hamburg - ISC11'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-7218252415179365185</id><published>2011-06-14T11:46:00.004+01:00</published><updated>2011-06-14T12:23:01.821+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video'/><category scheme='http://www.blogger.com/atom/ns#' term='webinar'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematical Finance'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>Now hear this</title><content type='html'>&lt;p&gt;Recently I’ve been doing some work producing a web-based seminar (or &lt;i&gt;webinar&lt;/i&gt;, to use the fashionable neologism) which demonstrates some aspects of NAG’s &lt;a href="http://www.nag.co.uk/optimization/index.asp"&gt;optimization routines&lt;/a&gt; and their use in the &lt;a href="http://www.nag.co.uk/main_finance.asp"&gt;finance industry&lt;/a&gt; (specifically for the &lt;a href="http://www.nag.co.uk/doc/techrep/Pdf/tr2_00.pdf"&gt;optimization of financial portfolios&lt;/a&gt;).  We originally scheduled a live broadcast of the seminar using the &lt;a href="http://www.gotomeeting.co.uk/fec/webinar"&gt;GoToWebinar&lt;/a&gt; package, which works very well; we’ve also used &lt;a href="http://www.webex.co.uk/"&gt;Webex&lt;/a&gt;’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.&lt;/p&gt;

&lt;p&gt;And so it was last week that I found myself talking to my computer in an isolated room whilst deftly manipulating slides and demos.  It was just as if I was giving a real live seminar - albeit one that nobody had turned up to (come to think of it, that wasn’t the first time such a thing had happened).  I used &lt;a href="http://sourceforge.net/projects/camstudios/files/legacy/"&gt;CamStudio 2.0&lt;/a&gt; to record the session (an earlier attempt using the more up-to-date  &lt;a href="http://sourceforge.net/projects/camstudios/files/stable/"&gt;CamStudio 2.6b&lt;/a&gt; failed on this Windows 7 machine for some unknown reason) and &lt;a href="http://explore.live.com/windows-live-movie-maker?os=other"&gt;Windows Live Movie Maker&lt;/a&gt; to do some very minimal editing of the resultant video file.  The results can be seen and heard &lt;a href="http://www.youtube.com/watch?v=hkcYtxfYqIE"&gt;here&lt;/a&gt; and &lt;a href="http://www.youtube.com/watch?v=IHSpQVj0q08"&gt;here&lt;/a&gt; (there's also some explanatory text about the seminar on &lt;a href="http://www.nag.co.uk/numeric/NAGExcelExamples/webinars.asp"&gt;this page&lt;/a&gt; for the curious).  I was quite pleased with the way they turned out, although I’d be interested to hear from anyone who knows of a tool that can automatically remove the large number of um’s and err’s from the soundtrack.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-7218252415179365185?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/7218252415179365185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/06/now-hear-this.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7218252415179365185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7218252415179365185'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/06/now-hear-this.html' title='Now hear this'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-105635743092409355</id><published>2011-06-02T15:58:00.004+01:00</published><updated>2011-06-08T10:19:01.029+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>.NET examples: C++ and using Object fields</title><content type='html'>Recently we had a question from a user of the &lt;a href="http://www.nag.co.uk/DT"&gt;NAG Library for .NET&lt;/a&gt;. 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.&lt;br /&gt;
&lt;br /&gt;
We took the existing C# example for the optimisation routine &lt;b&gt;e04uc&lt;/b&gt; 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 &lt;b&gt;NagDelegate&lt;/b&gt;) and to demonstrate two ways in which data may be passed between successive calls to this callback parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Note that C++/CLR has extended syntax (notably &lt;b&gt;^&lt;/b&gt; and &lt;b&gt;gcnew&lt;/b&gt; in this example) which declare managed data that will be managed and potentially garbage collected by the .NET runtime system.&lt;br /&gt;
Once the class and its method are defined, the only thing that needs to be done to pass this method to the &lt;b&gt;e04uc&lt;/b&gt; method is to declare the delegate object using the syntax&lt;br /&gt;
&lt;pre class="nag"&gt;E04::E04UC_OBJFUN^ objfunE  =
    &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; E04::E04UC_OBJFUN(nagdelegate, &amp;amp;NagDelegate::objfun);
&lt;/pre&gt;
Unlike the situation in C#, you need to specify both the class and the particular method as two separate parameters when declaring the delegate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned above, the method &lt;b&gt;NagDelegate::objfun&lt;/b&gt; demonstrates two ways in which data may be accessed, in both cases here the data is a counter reporting how many times the objective function was evaluated by the optimisation algorithm. &lt;b&gt;static_counter&lt;/b&gt; is a static variable and &lt;b&gt;counter&lt;/b&gt; is a local field of the &lt;b&gt;NagDelegate&lt;/b&gt; object. As may be seen by the results when the program is run, both methods work as expected, returning the same value.&lt;br /&gt;
&lt;pre class="nag"&gt;  static_counter++;
  counter++;
&lt;/pre&gt;
The C++ example program is shown in full at the end of this post. To run it using Visual Studio, just start a new project and replace the default program by the code below. You must then select the project references and add a reference to the &lt;b&gt;NagLibrary32&lt;/b&gt; or &lt;b&gt;NagLibrary64&lt;/b&gt; .NET assemblies. The program  should then run and produce the output shown.&lt;br /&gt;
&lt;pre class="nag"&gt;&lt;span style="color: green;"&gt;// csharpfromcpp.cpp : main project file.&lt;/span&gt;
 &lt;span style="color: green;"&gt; &lt;/span&gt;
 &lt;span style="color: blue;"&gt;#include&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"stdafx.h"&lt;/span&gt;
 &lt;span style="color: #a31515;"&gt; &lt;/span&gt;
 &lt;span style="color: blue;"&gt;using&lt;/span&gt; &lt;span style="color: blue;"&gt;namespace&lt;/span&gt; System;
 &lt;span style="color: blue;"&gt;using&lt;/span&gt; &lt;span style="color: blue;"&gt;namespace&lt;/span&gt; NagLibrary;
  
 &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; static_counter;
                           
 &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;ref&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; NagDelegate
 {
 &lt;span style="color: blue;"&gt;public&lt;/span&gt;:
     &lt;span style="color: blue;"&gt;int&lt;/span&gt; counter;
     &lt;span style="color: blue;"&gt;void&lt;/span&gt; objfun(&lt;span style="color: blue;"&gt;int&lt;/span&gt;% mode, &lt;span style="color: blue;"&gt;int&lt;/span&gt; n, &lt;span style="color: blue;"&gt;array&lt;/span&gt; &amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ x, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% objf,
                 &lt;span style="color: blue;"&gt;array&lt;/span&gt; &amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ objgrd, &lt;span style="color: blue;"&gt;int&lt;/span&gt; nstate)
     {
         &lt;span style="color: green;"&gt;//      Routine to evaluate objective function&lt;/span&gt;
         &lt;span style="color: green;"&gt;//      and its 1st derivatives.&lt;/span&gt;
         static_counter++;
         counter++;
         &lt;span style="color: blue;"&gt;double&lt;/span&gt; one = 1.00e0;
         &lt;span style="color: blue;"&gt;double&lt;/span&gt; two = 2.00e0;
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 0) || (mode == 2))
             {
                 objf = x[0] * x[3] * (x[0] + x[1] + x[2]) + x[2];
             }
         &lt;span style="color: green;"&gt;//&lt;/span&gt;
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 1) || (mode == 2))
             {
                 objgrd[0] = x[3] * (two * x[0] + x[1] + x[2]);
                 objgrd[1] = x[0] * x[3];
                 objgrd[2] = x[0] * x[3] + one;
                 objgrd[3] = x[0] * (x[0] + x[1] + x[2]);
             }
         &lt;span style="color: green;"&gt;//&lt;/span&gt;
     }
 };
  
 &lt;span style="color: blue;"&gt;void&lt;/span&gt; confun( &lt;span style="color: blue;"&gt;int&lt;/span&gt;% mode, &lt;span style="color: blue;"&gt;int&lt;/span&gt; ncnln, &lt;span style="color: blue;"&gt;int&lt;/span&gt; n, &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; &amp;gt;^ needc,
               &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ x, &lt;span style="color: blue;"&gt;array&lt;/span&gt; &amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ c,
                     &lt;span style="color: blue;"&gt;array&lt;/span&gt; &amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;,2&amp;gt;^ cjac, &lt;span style="color: blue;"&gt;int&lt;/span&gt; nstate)
     {
       &lt;span style="color: green;"&gt;//      Routine to evaluate the nonlinear constraints&lt;/span&gt;
       &lt;span style="color: green;"&gt;//       and their 1st derivatives.&lt;/span&gt;
       &lt;span style="color: blue;"&gt;double&lt;/span&gt; zero = 0.00e0;
       &lt;span style="color: blue;"&gt;double&lt;/span&gt; two = 2.00e0;
       &lt;span style="color: blue;"&gt;int&lt;/span&gt; i,  j;
       &lt;span style="color: blue;"&gt;if&lt;/span&gt; (nstate == 1)
       {
         &lt;span style="color: green;"&gt;//  First call to confun.  Set all Jacobian elements to zero.&lt;/span&gt;
         &lt;span style="color: green;"&gt;//  Note that this will only work when 'Derivative Level = 3'&lt;/span&gt;
         &lt;span style="color: green;"&gt;//  (the default; see Section 11.2).&lt;/span&gt;
         &lt;span style="color: blue;"&gt;for&lt;/span&gt; (j = 1; j &amp;lt;= n; j++)
         {
           &lt;span style="color: blue;"&gt;for&lt;/span&gt; (i = 1; i &amp;lt;= ncnln; i++)
           {
             cjac[i - 1, j - 1] = zero;
           }
         }
       }
       &lt;span style="color: green;"&gt;//&lt;/span&gt;
       &lt;span style="color: blue;"&gt;if&lt;/span&gt; (needc[0] &amp;gt; 0)
       {
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 0) || (mode == 2))
         {
           c[0] = (x[0]) * (x[0]) +
                          (x[1]) * (x[1]) + (x[2]) * (x[2]) + (x[3]) * (x[3]);
         }
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 1) || (mode == 2))
         {
           cjac[0, 0] = two * x[0];
           cjac[0, 1] = two * x[1];
           cjac[0, 2] = two * x[2];
           cjac[0, 3] = two * x[3];
         }
       }
       &lt;span style="color: green;"&gt;//&lt;/span&gt;
       &lt;span style="color: blue;"&gt;if&lt;/span&gt; (needc[1] &amp;gt; 0)
       {
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 0) || (mode == 2))
         {
           c[1] = x[0] * x[1] * x[2] * x[3];
         }
         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((mode == 1) || (mode == 2))
         {
           cjac[1, 0] = x[1] * x[2] * x[3];
           cjac[1, 1] = x[0] * x[2] * x[3];
           cjac[1, 2] = x[0] * x[1] * x[3];
           cjac[1, 3] = x[0] * x[1] * x[2];
         }
       }
       &lt;span style="color: green;"&gt;//&lt;/span&gt;
     }
  
  
 &lt;span style="color: blue;"&gt;int&lt;/span&gt; main(&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;System::String ^&amp;gt; ^args)
 {
         &lt;span style="color: blue;"&gt;double&lt;/span&gt; objf = 0.0;
         &lt;span style="color: blue;"&gt;int&lt;/span&gt; i,  ifail,  iter,  j,  n,  nclin,  ncnln;
         Console::WriteLine(L&lt;span style="color: #a31515;"&gt;"e04uc Example Program Results"&lt;/span&gt;);
         &lt;span style="color: green;"&gt;//      Skip heading in data file&lt;/span&gt;
         n = 4;
         nclin = 1;
         ncnln = 2;
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;^ a = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;( nclin, n);
         a[0, 0]=1;
         a[0, 1]=1;
         a[0, 2]=1;
         a[0, 3]=1;
  
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ bl = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(n + nclin +ncnln);
         bl[0] = 1.0;
         bl[1] = 1.0;
         bl[2] = 1.0;
         bl[3] = 1.0;
         bl[4] = -1.0e+25;
         bl[5] = -1.0e+25;
         bl[6] = 25.0;
  
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ bu = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(n + nclin +ncnln);
         bu[0] = 5.0;
         bu[1] = 5.0;
         bu[2] = 5.0;
         bu[3] = 5.0;
         bu[4] = 20.0;
         bu[5] = 40.0;
         bu[6] = 1.0e25;
  
  
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ c = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(ncnln);
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;^ cjac = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;(ncnln, n);
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ clamda = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(n + nclin +ncnln);
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ objgrd = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(n);
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;^ r = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt;, 2 &amp;gt;(n, n);
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;^ x = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;double&lt;/span&gt; &amp;gt;(n);
         x[0] = 1.0;        
         x[1] = 5.0;        
         x[2] = 5.0;        
         x[3] = 1.0;        
  
         &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; &amp;gt;^ istate = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; &amp;gt;(n + nclin +ncnln);
  
              E04::e04ucOptions^ options = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; E04::e04ucOptions() ;
              E04::E04UC_CONFUN^ confunE = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt;  E04::E04UC_CONFUN(confun);
  

              NagDelegate^ nagdelegate = 
                        &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; NagDelegate();
              E04::E04UC_OBJFUN^ objfunE  =
                        &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt;  E04::E04UC_OBJFUN(nagdelegate,  &amp;amp;NagDelegate::objfun);
              E04::e04uc(n, nclin, ncnln, a, bl, bu, confunE, objfunE, iter, istate, c,
                         cjac, clamda, objf, objgrd, r, x, options, ifail);
  
              Console::WriteLine(&lt;span style="color: #a31515;"&gt;"The objective value on return is {0}. "&lt;/span&gt;,
                      objf);
              Console::WriteLine(&lt;span style="color: #a31515;"&gt;"Objfun has been  called {0} times, using class member"&lt;/span&gt;,
                      nagdelegate-&amp;gt;counter);
              Console::WriteLine(&lt;span style="color: #a31515;"&gt;"Objfun has been  called {0} times, using a static variable"&lt;/span&gt;,
                      static_counter);
  
  
  
     &lt;span style="color: blue;"&gt;return&lt;/span&gt; 0;
 }
&lt;/pre&gt;
When run the following output is produced:&lt;br /&gt;
&lt;pre class="nag"&gt;e04uc Example Program Results
The objective value on return is 17.0140172891347.
Objfun has been  called 7 times, using class member
Objfun has been  called 7 times, using a static variable 
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-105635743092409355?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/105635743092409355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/06/net-examples-c-and-using-object-fields.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/105635743092409355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/105635743092409355'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/06/net-examples-c-and-using-object-fields.html' title='.NET examples: C++ and using Object fields'/><author><name>David Carlisle</name><uri>https://profiles.google.com/107847268022850354754</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-5fp4icqY6kI/AAAAAAAAAAI/AAAAAAAAAAA/iRCXBm3Y1Fo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5652225398183590204</id><published>2011-05-23T15:03:00.020+01:00</published><updated>2011-06-08T10:17:31.114+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gnuplot'/><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='diagram'/><category scheme='http://www.blogger.com/atom/ns#' term='figure'/><title type='text'>Programming gnuplot</title><content type='html'>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.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
I received the latest of these queries last week, from a colleague who wanted to reproduce Figure 1 (below) as part of the documentation for the &lt;a href="http://www.nag.co.uk/numeric/fd/FDdescription.asp"&gt;NAG Parallel Library&lt;/a&gt;.  It's a schematic illustration of the way in which, for certain routines in the Library, elements of a matrix are distributed between compute processors.  More specifically, this example shows the distribution of a two-dimensional matrix consisting of twelve rows and columns (each numbered from 1 to 12) across a two by three grid of processors.&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-KagfUgl-CJY/Tdp4hWqfszI/AAAAAAAAAEM/nlMRgzfshHs/s1600/essIntFig2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5609928800258208562" src="http://1.bp.blogspot.com/-KagfUgl-CJY/Tdp4hWqfszI/AAAAAAAAAEM/nlMRgzfshHs/s400/essIntFig2.png" style="cursor: hand; cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  Data distribution across a grid of processors&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
The request was to reproduce the figure using &lt;a href="http://www.gnuplot.info/"&gt;gnuplot&lt;/a&gt;, a plotting program that can be used to create a wide variety of two- and three-dimensional plots of data, functions and approximations to data.  It runs on a variety of platforms, and is freely distributed.  Gnuplot's interface is command-driven - i.e. the user either enters commands one at a time at its interactive prompt, or puts the commands into a script, which the program then loads and runs.  Several example scripts (and their associated output) are available at the &lt;a href="http://gnuplot.sourceforge.net/demo_4.2/"&gt;gnuplot site&lt;/a&gt; - for example, &lt;a href="http://gnuplot.sourceforge.net/demo_4.2/simple.html"&gt;these&lt;/a&gt; illustrate the range of the program's functionality for plotting analytical functions.  We use the program a lot for the display of the results from the example programs which form an important part of NAG Library documentation; thus, Figure 2 is a plot of the output from the &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl22/xhtml/C06/c06baf.xml"&gt;c06ab&lt;/a&gt; routine, which is used in the numerical summation of series.&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-xPu7DWuc12U/TdqDATzd7kI/AAAAAAAAAEU/CAfMTOPvJjo/s1600/c06baf-plot.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5609940327182757442" src="http://3.bp.blogspot.com/-xPu7DWuc12U/TdqDATzd7kI/AAAAAAAAAEU/CAfMTOPvJjo/s400/c06baf-plot.png" style="cursor: hand; cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 2.  Results from the c06ba example program&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
Whilst producing this sort of picture in gnuplot is comparatively straightforward, and can be done with a handful of commands, the diagram in Figure 1 presents a few more challenges.  However, the elementary components aren't hard to find: thus, gnuplot has a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;set object rectangle&lt;/span&gt; command which creates a rectangle, given the coordinates of its diagonal corners, a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;set arrow&lt;/span&gt; command which creates an arrow (or a line) between two endpoints, and a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;set label&lt;/span&gt; command which adds text at a specified location.  So I started writing the script in this fashion:&lt;br /&gt;
&lt;pre class="nag"&gt;# draw box.
set object 1 rect from 0,0 to 6,8.2 

# add label.
set label "{1,0}" at 3,4.1 center

# draw y boundaries.
set arrow 2 from 1.5,0 to 1.5,8.2 nohead
set arrow 3 from 3.0,0 to 3.0,8.2 nohead
set arrow 4 from 4.5,0 to 4.5,8.2 nohead
...
&lt;/pre&gt;
but I hadn't got very far before realising that hardwiring all of the coordinate values wasn't a good idea if - say - the size of the boxes, or the spacing between them, needed changing.  And I was getting tired of keeping track of the running number of objects, and working out in my head the locations of the boundaries.  Fortunately, I recalled that a computer is good at this sort of thing (the clue is in the name, after all).  I also discovered that gnuplot allows user-defined variables to be declared, and supports mathematical operations on them.  This made writing the script a lot easier, but there's a large degree of repetition in the code which - although straightforward to produce by cutting and pasting - looks inelegant and verbose.  In a more fully-featured programming environment, this drawback would be overcome by using control statements such as loops or branches, or by using subprograms.  However, these features aren't supported by gnuplot (or if they are, I couldn't find them - and the call of more important activities was becoming too strident to ignore), so we're left with a lengthy script, which is reproduced below in all its resplendence for the curious.&lt;br /&gt;
&lt;br /&gt;
Buried within it (almost at the end) is one technical point that might be of wider interest: because gnuplot is, when all's said and done, a plotting package, each script must contain at least one &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;plot&lt;/span&gt; command, otherwise nothing will appear.  More specifically in our example, we've used the &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;set&lt;/span&gt; command to create items to be displayed by specifying values for its &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;object&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;arrow&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;label&lt;/span&gt; options, but these won't be drawn on the graph until the &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;plot&lt;/span&gt; command is issued.  This has a compulsory argument, but having specified everything to be displayed, we don't have anything else left to be explicitly plotted.  Other users who have used the command in similar circumstances (for example, &lt;a href="http://www.phyast.pitt.edu/%7Ezov1/gnuplot/html/multigrid.html"&gt;here&lt;/a&gt; and &lt;a href="http://gnuplot-tricks.blogspot.com/2010/02/parametric-plot-from-file-ii.html"&gt;here&lt;/a&gt;) have used the expression  &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;1/0&lt;/span&gt; for this argument; gnuplot evaluates this to &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;NaN&lt;/span&gt;, which is interpreted as an undefined point, and is quietly ignored by the &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre;"&gt;plot&lt;/span&gt; command when it's displaying the other objects in the figure.&lt;br /&gt;
&lt;pre class="nag"&gt;# gnuplot file for figure (data distribution from the 
# processors' point of view) from 'essential introduction 
# to nag parallel library'

# NB: delete '#EPS' or '#PNG' from the following set commands to 
# generate individual image files
#EPSset term postscript eps enhanced monochrome font "Times" 
#EPSset output "fdessint2_fig.ps"
#PNGset term png enhanced medium font "TIMES"
#PNGset output "fdessint2_fig.png"

# set values for total x and y dimensions.
xLength = 25
yLength = 25

# set values for overall offset at left and top, to make room 
# for labels.
xLabelOffset = 1.0
yLabelOffset = 1.0

# set values for x and y box sizes.
xBox = 6.0
yBox = 8.2

# set values for number of cells within each box.
xNumCell = 4
yNumCell = 6

# calcuate offset between each box.  There are 3 boxes along x, 
# and 2 along y.
xBoxOffset = (xLength - xLabelOffset - 3*xBox)/2.0
yBoxOffset = yLength - yLabelOffset - 2*yBox

# calculate spacing between each cell.
xCellSpace = xBox/xNumCell
yCellSpace = yBox/yNumCell

# Specify the extent of the plotting space.
set xrange [0:xLength]
set yrange [0:yLength] 

# specify the aspect ratio of the plot.
set size ratio 0.8

# turn off the key, the axis tics and the border around the plot.
unset key
unset xtics
unset ytics
unset border

# set the fill style (for the boxes).
set style fill empty border rgb "black"

# initialize counter for objects.
nobj = 0

############
# initialize location of box (bottom row). 
rx = xLabelOffset
ry = 0

# draw box.
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{1,0}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

# draw next box.
rx = rx+xBox+xBoxOffset 
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{1,1}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

# draw next box.
rx = rx+xBox+xBoxOffset 
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{1,2}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

############
# initialize location of box (top row). 
rx = xLabelOffset
ry = yBox + yBoxOffset

# draw next box.
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{0,0}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

# draw next box.
rx = rx+xBox+xBoxOffset 
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{0,1}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

# draw next box.
rx = rx+xBox+xBoxOffset 
nobj = nobj+1
set object nobj rect from rx,ry to rx+xBox,ry+yBox 

# add label.
set label "{0,2}" at rx+0.5*xBox,ry+0.5*yBox center

# initialize coordinates for cell boundaries. 
ax = rx
ay = ry

# draw y boundaries.
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead
ax = ax+xCellSpace
nobj = nobj+1; set arrow nobj from ax,ry to ax,ry+yBox nohead

# draw x boundaries.
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead
ay = ay+yCellSpace
nobj = nobj+1; set arrow nobj from rx,ay to rx+xBox,ay nohead

############
# Now draw the arrows between boxes.  
# First, in y direction (between rows).
ax = xLabelOffset + 0.5*xBox

# shave off a bit of the arrow so it's not touching the box 
# (looks nicer).
eps = 0.1*yBoxOffset

nobj = nobj+1 
set arrow nobj from ax,yBox+eps to ax,yBox+yBoxOffset-eps heads
ax = ax + xBox + xBoxOffset 
nobj = nobj+1
set arrow nobj from ax,yBox+eps to ax,yBox+yBoxOffset-eps heads
ax = ax + xBox + xBoxOffset 
nobj = nobj+1
set arrow nobj from ax,yBox+eps to ax,yBox+yBoxOffset-eps heads

# Second, in x direction (between columns - bottom row).
ax = xLabelOffset + xBox
ay = 0.5*yBox
eps = 0.1*xBoxOffset 

nobj = nobj+1
set arrow nobj from ax+eps,ay to ax+xBoxOffset-eps,ay heads
ax = ax + xBox + xBoxOffset 
nobj = nobj+1
set arrow nobj from ax+eps,ay to ax+xBoxOffset-eps,ay heads

# Third, in x direction (between columns - top row).
ax = xLabelOffset + xBox
ay = ay + yBox + yBoxOffset
eps = 0.1*xBoxOffset 

nobj = nobj+1
set arrow nobj from ax+eps,ay to ax+xBoxOffset-eps,ay heads
ax = ax + xBox + xBoxOffset 
nobj = nobj+1
set arrow nobj from ax+eps,ay to ax+xBoxOffset-eps,ay heads

############
# Add labels.  First, left of bottom row.
lx = 0.5*xLabelOffset
ly = 0.5*yCellSpace
set label "12" at lx,ly center  
ly = ly+yCellSpace
set label "10" at lx,ly center
ly = ly+yCellSpace
set label "8" at lx,ly center
ly = ly+yCellSpace
set label "6" at lx,ly center
ly = ly+yCellSpace
set label "4" at lx,ly center
ly = ly+yCellSpace
set label "2" at lx,ly center

# Second, left of top row.
lx = 0.5*xLabelOffset
ly = yBox + yBoxOffset + 0.5*yCellSpace
set label "11" at lx,ly center
ly = ly+yCellSpace
set label "9" at lx,ly center
ly = ly+yCellSpace
set label "7" at lx,ly center
ly = ly+yCellSpace
set label "5" at lx,ly center
ly = ly+yCellSpace
set label "3" at lx,ly center
ly = ly+yCellSpace
set label "1" at lx,ly center

# Third, top of the three columns.
rx = xLabelOffset
ly = yLength - yLabelOffset + 0.5*yCellSpace
lx = rx + 0.5*xCellSpace
set label "1" at lx,ly center
lx = lx+xCellSpace
set label "4" at lx,ly center
lx = lx+xCellSpace
set label "7" at lx,ly center
lx = lx+xCellSpace
set label "10" at lx,ly center

rx = rx+xBox+xBoxOffset 
lx = rx + 0.5*xCellSpace
set label "2" at lx,ly center
lx = lx+xCellSpace
set label "5" at lx,ly center
lx = lx+xCellSpace
set label "8" at lx,ly center
lx = lx+xCellSpace
set label "11" at lx,ly center

rx = rx+xBox+xBoxOffset 
lx = rx + 0.5*xCellSpace
set label "3" at lx,ly center
lx = lx+xCellSpace
set label "6" at lx,ly center
lx = lx+xCellSpace
set label "9" at lx,ly center
lx = lx+xCellSpace
set label "12" at lx,ly center

############
# call plot (with a dummy argument) to display the objects 
# we've defined.
plot 1/0

pause -1
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5652225398183590204?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5652225398183590204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/05/programming-gnuplot.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5652225398183590204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5652225398183590204'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/05/programming-gnuplot.html' title='Programming gnuplot'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-KagfUgl-CJY/Tdp4hWqfszI/AAAAAAAAAEM/nlMRgzfshHs/s72-c/essIntFig2.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3631511179174473756</id><published>2011-05-04T10:28:00.000+01:00</published><updated>2011-05-04T10:32:13.530+01:00</updated><title type='text'>Good Business Analytics Conference</title><content type='html'>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&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3631511179174473756?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3631511179174473756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/05/good-business-analytics-conference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3631511179174473756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3631511179174473756'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/05/good-business-analytics-conference.html' title='Good Business Analytics Conference'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5872244043330875815</id><published>2011-04-11T16:38:00.000+01:00</published><updated>2011-04-11T16:38:25.793+01:00</updated><title type='text'>Aging Fortran Codes - A Crisis in Slow Motion</title><content type='html'>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.&lt;br /&gt;
&lt;br /&gt;
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&amp;nbsp;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&amp;nbsp;the early versions of Fortran. &lt;br /&gt;
&lt;br /&gt;
People readily acknowledge the amount of code and the concern about the aging "expertise base" (i.e., people) who are charged with &amp;nbsp;maintaining&amp;nbsp;and improving the code. They recognize that much of this code is "mission-critical" to research in physics, chemistry, aerospace and alternative energy and worry about the long certification process for updating modernized versions of the code. And there the "disconnect" starts.&lt;br /&gt;
&lt;br /&gt;
When I ask how much resource they are putting into modernizing the codes to preserve the code and help it cope in a multi/many-core world the answer I often get is, effectively, "that's not one of our budget priorities right now". &lt;br /&gt;
&lt;br /&gt;
This quite unsatisfying situation suggests two responses. For us at NAG who get called upon to port, modernize and scale codes as part of our work with HECToR users and other customers it suggests that we need to continue to find more cost-effective tools and processes to convert, modernize and scale codes. The bigger challenge is for organizations such as those above and other research sponsoring organizations such as the NSF in the US and various research councils in the UK to not only recognize the issue but to find the resources to support the effort before we lose the base of talent and institutional "memory" needed to do the job.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5872244043330875815?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5872244043330875815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/04/aging-fortran-codes-crisis-in-slow.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5872244043330875815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5872244043330875815'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/04/aging-fortran-codes-crisis-in-slow.html' title='Aging Fortran Codes - A Crisis in Slow Motion'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3543441448738577213</id><published>2011-04-04T14:10:00.004+01:00</published><updated>2011-06-08T10:22:24.475+01:00</updated><title type='text'>Turning off logic</title><content type='html'>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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Whatever parts of our brain we use get exercised and will be become more adept at what they do. So for programmers their logic should improve; for artists their artistic skills should improve also.  But what happens to those parts of the brain that we don't use?  Are they getting worse? Better? Staying the same?  What would life be like if we made more of an effort to spread the work load over our whole brain?&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
I don't know what you do to relax, but usually I find that doing something completely different to my every day activities leads to me feeling very relaxed, even if that something involves physical activity.  I guess purposefully not using the part of your brain that gets the most daily use, means that it gets to relax while another function of the brain is being used.&lt;br /&gt;
&lt;br /&gt;
As a programmer I find that walking in the country side, enjoying the beauty of nature, gardening, creating something artistic are incredibly relaxing for me. I imagine conversely that if I was doing gardening or art for my job I would really enjoy programming as a relaxing thing to do.
&lt;br /&gt;
All of this is just speculatory as I only have my personal experience to go on and haven't researched into any scientific evidence.&lt;br /&gt;
&lt;br /&gt;
So my question is then, do you find the same thing? Do you need to relax by doing something completely different, whether by gardening, or doing something arty? If you do need to, but you find that you don't have the time, do you experience any negative consequences from not relaxing?
&lt;br /&gt;
I know that I tend to start treating my family like programs, and expecting everything to be logical if I don't relax.  This feeling of logicalness then becomes slightly detrimental when dealing with the emotions of a stressed wife or a frustrated toddler.&lt;br /&gt;
&lt;br /&gt;
So do you relax from a days programming? And if so how?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3543441448738577213?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3543441448738577213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/04/turning-off-logic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3543441448738577213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3543441448738577213'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/04/turning-off-logic.html' title='Turning off logic'/><author><name>Nathaniel</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2273221806622325647</id><published>2011-03-21T10:55:00.002Z</published><updated>2011-03-21T10:59:02.571Z</updated><title type='text'>Sticking to coding guidelines</title><content type='html'>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.
&lt;p&gt;
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 the user interface of his routine.  Strictly speaking that change was a subtle deviation from our standards since it involved some arrays being declared with explicit lengths rather than being assumed size.  What he didn't realise was that, when this code came to be incorporated into some of our other products, his solution would cause problems with the way the parameters were being used there, requiring a lot of effort to work around.
&lt;p&gt;
Luckily he was paired with one of our most eagle-eyed peer reviewers who queried the fact that these arrays did not conform to our normal practice.  This in turn led to the original problem and the issues with applying his solution in our other products being aired.  In the short term a fix conforming with our standards is being implemented which will work correctly in all our products, and in the longer term we will adopt an improved mechanism, better to address his original problem.
&lt;p&gt;
One lesson from this is that, particularly in a multi-developer environment like ours, its important to stick to agreed standards since its not always clear what the consequences of breaking them will be. But we all make mistakes and it would be nice if we had tools which could validate stylistic programming rules alongside the more mechanistic ones.  It might be possible to do this with formal specification languages but that seems like using a sledgehammer to crack a nut.  We already have tools which check the consistency of our documentation and our software, e.g. to ensure that the types and dimensions of parameters match.  Maybe we should develop this idea further to include more complicated checks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2273221806622325647?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2273221806622325647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/03/sticking-to-coding-guidelines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2273221806622325647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2273221806622325647'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/03/sticking-to-coding-guidelines.html' title='Sticking to coding guidelines'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3623901892205554299</id><published>2011-03-18T16:38:00.002Z</published><updated>2011-06-08T09:52:05.409+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='manycore'/><title type='text'>Performance and Results</title><content type='html'>&lt;i&gt;What's in a catch phrase?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
As you will hopefully know, &lt;a href="http://www.nag.co.uk/"&gt;NAG&lt;/a&gt;'s strapline is "&lt;b&gt;Results Matter. Trust NAG&lt;/b&gt;".&lt;br /&gt;
&lt;br /&gt;
What matters to you, our customers, is &lt;a href="http://www.nag.co.uk/Market/casestudies.asp"&gt;results&lt;/a&gt;. Correct results that you can rely on. Our strapline invites you to trust NAG - our &lt;a href="http://www.nag.co.uk/bdu/consultancy.asp"&gt;people&lt;/a&gt; and our &lt;a href="http://www.nag.co.uk/products_and_services.asp"&gt;software products&lt;/a&gt; - to deliver that for you.&lt;br /&gt;
&lt;br /&gt;
When &lt;a href="http://www.hpcnotes.com/2008/08/nag-embarks-on-new-business-venture.html"&gt;I joined NAG&lt;/a&gt; to help develop the &lt;a href="http://www.nag.com/hpc"&gt;High Performance Computing (HPC) services and consulting&lt;/a&gt; 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 "&lt;b&gt;Performance Matters. Trust NAG.&lt;/b&gt;" Close second was "&lt;b&gt;Productivity Matters. Trust NAG.&lt;/b&gt;"&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Our (then newly proactive but not new) HPC consulting business offers to help customers extract better performance from parallel computing technologies - whether multicore workstations, clusters with hundreds of cores, or multi-thousand node supercomputers. In many cases, application software must be evolved, optimized, or occasionally substantially re-architected with new algorithms, to effectively exploit the processing power of multicore based workstations and supercomputers. We do this through collaborative development of your applications to introduce parallel processing, or to improve scalability, or to develop new algorithms suited for the next generation of computing technology. We also offer training courses in the relevant skills and technologies (e.g. OpenMP, MPI, Fortran). And some &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/search/label/hpc"&gt;insights on HPC&lt;/a&gt; via the &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/"&gt;NAG blog&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
However, we also recognised that as well as our comprehensive HPC skills base, NAG brings an added value to the market - experience of developing portable, robust, production quality software that users can rely on for accurate results.&lt;br /&gt;
&lt;br /&gt;
HPC and supercomputing often focuses on getting the fastest performance. But that isn't much use unless you can trust those answers too. The converse is true also - answers must be delivered in a useful timescale - performance matters. I have &lt;a href="http://www.hpcnotes.com/search/label/performance"&gt;written about this performance/robustness balance several times&lt;/a&gt; - on the NAG blog and in my ZDNet UK columns. Good enough performance must always be balanced with accuracy and reliability.&lt;br /&gt;
&lt;br /&gt;
And so, we concluded that keeping the same strapline, "&lt;b&gt;Results Matter. Trust NAG.&lt;/b&gt;", was just right for the HPC aspects of NAG's business too.&lt;br /&gt;
&lt;br /&gt;
Because, in the end, Performance is part of Results - in fact, while the Results out of the code are obviously important, it is the Results out of your business or research that really Matters - and scalable application Performance could be the factor that drives your research, design, or even economic Results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3623901892205554299?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3623901892205554299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/03/performance-and-results.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3623901892205554299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3623901892205554299'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/03/performance-and-results.html' title='Performance and Results'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3527793665227126554</id><published>2011-03-17T10:26:00.002Z</published><updated>2011-03-17T11:08:16.600Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Science'/><category scheme='http://www.blogger.com/atom/ns#' term='manycore'/><title type='text'>The Addictive Allure of Supercomputing</title><content type='html'>The &lt;a href="http://www.emdt.co.uk/article/addictive-allure-supercomputing"&gt;European Medical Device Technology (EMDT) magazine interviewed me recently&lt;/a&gt;. &lt;a href="http://insidehpc.com/"&gt;InsideHPC &lt;/a&gt;also has &lt;a href="http://insidehpc.com/2011/03/17/interview-andrew-jones-on-the-addictive-allure-of-supercomputing/"&gt;pointed to the interview here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The interview discusses false hopes of users: "&lt;i&gt;Computers will always get faster – I just have to wait for the next  processor and my application will run faster.&lt;/i&gt;"&lt;br /&gt;
&lt;br /&gt;
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 &lt;a href="http://www.nag.co.uk/numeric/FL/FSdescription.asp"&gt;parallelized library plugins &lt;/a&gt;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.&lt;br /&gt;
&lt;br /&gt;
Of course, NAG can &lt;a href="http://www.nag.com/hpc"&gt;help&lt;/a&gt; ...&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3527793665227126554?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3527793665227126554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/03/addictive-allure-of-supercomputing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3527793665227126554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3527793665227126554'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/03/addictive-allure-of-supercomputing.html' title='The Addictive Allure of Supercomputing'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3523692744254064247</id><published>2011-03-10T14:00:00.016Z</published><updated>2011-03-10T14:46:58.772Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>NAG out and about</title><content type='html'>The NAG website has a section called "&lt;a href="http://www.nag.co.uk/market/events.asp"&gt;Meet our experts - NAG out and about&lt;/a&gt;", which gives a list of upcoming events worldwide that NAG experts will be attending or presenting at.&lt;br /&gt;
&lt;br /&gt;
The page also notes: "&lt;i&gt;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 
&lt;a href="mailto:sales@nag.co.uk"&gt;sales@nag.co.uk&lt;/a&gt;&lt;/i&gt;".&lt;br /&gt;
&lt;br /&gt;
In my own focus of &lt;a href="http://www.nag.co.uk/hpc"&gt;high performance computing (HPC)&lt;/a&gt;, I have previously &lt;a href="http://www.zdnet.co.uk/news/it-strategy/2010/02/24/events-guide-whats-on-in-supercomputing-40041925/"&gt;written (for ZDNet UK)&lt;/a&gt; about some key supercomputing events. For those of you interested in meeting up with HPC experts (especially from &lt;a href="http://www.nag.co.uk/"&gt;NAG&lt;/a&gt;!), I have set up a &lt;a href="http://www.hpcnotes.com/"&gt;survey of HPC events&lt;/a&gt; - please let us know which events you plan to attend in 2011 - and see which events other readers of &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/"&gt;The NAG Blog&lt;/a&gt; are attending.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3523692744254064247?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3523692744254064247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/03/nag-out-and-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3523692744254064247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3523692744254064247'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/03/nag-out-and-about.html' title='NAG out and about'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-6407481431281115735</id><published>2011-02-15T10:25:00.026Z</published><updated>2011-02-18T11:34:22.347Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDL'/><category scheme='http://www.blogger.com/atom/ns#' term='DLM'/><category scheme='http://www.blogger.com/atom/ns#' term='interfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='wrappers'/><title type='text'>Calling NAG routines from IDL</title><content type='html'>&lt;p&gt;The collection of numerical algorithms contained in the NAG Library has been a valuable and widely-used resource for &lt;a href="http://www.nag.co.uk/market/articles/nag_marks_40th_anniversary.asp"&gt;many years&lt;/a&gt;, 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 &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2011/01/joy-of-creating-new-solvers.html"&gt;new routines&lt;/a&gt; for the next Mark of the Library, have just released a &lt;a href="http://www.nag.co.uk/numeric/DT/DTdescription.asp"&gt;new version&lt;/a&gt; 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 &lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;MATLAB&lt;sup&gt;®&lt;/sup&gt;&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/numeric/nagandexcel.asp"&gt;Excel&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/numeric/MC/MCdescription.asp"&gt;Maple&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/doc/TechRep/html/Tr2_09/Tr2_09.asp"&gt;Java&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/python.asp"&gt;Python&lt;/a&gt; and many others (some of which are listed on &lt;a href="http://www.nag.co.uk/"&gt;this&lt;/a&gt; page).  In spite of our best efforts in this area however, there will always be environments that we've yet to cover fully.&lt;/p&gt;

&lt;p&gt;Fortunately, our users - besides possessing a commendably high level of discernment in their selection of numerical libraries - are talented and resourceful individuals.  For example, we've recently been in contact with a group at &lt;a href="http://www.ccfe.ac.uk/"&gt;Culham Centre for Fusion Energy&lt;/a&gt;, which is the UK's national &lt;a href="http://www.ccfe.ac.uk/introduction.aspx"&gt;fusion&lt;/a&gt; research laboratory.  They're users of the popular &lt;a href="http://www.ittvis.com/ProductServices/IDL.aspx"&gt;IDL&lt;/a&gt; programming language and visualization system, and were keen to enhance IDL's &lt;a href="http://www.idl-envi.com/idl-home/idl-datasend"&gt;functionality&lt;/a&gt; by calling NAG Library routines from within that environment.  They found that they were able to do this by writing a C wrapper around each Fortran routine call, and then passing the definition of the wrapper routine to IDL via its &lt;a href="http://idlastro.gsfc.nasa.gov/idl_html_help/Dynamically_Loadable_Modules.html"&gt;Dynamically Loadable Module (DLM)&lt;/a&gt; packaging method.  We highlight their work - which they've been kind enough to share with us - using the &lt;a href="http://www.nag.co.uk/numeric/FL/nagdoc_fl22/xhtml/E02/e02bef.xml"&gt;E02BEF&lt;/a&gt; routine as an example; this calculates the cubic spline approximation to a set of data points (and has previously formed the basis of &lt;a href="http://www.nag.co.uk/industryarticles/usingtoolboxmatlabpart2.asp#e02fittingsetpoints"&gt;one of the demos&lt;/a&gt; of the &lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;NAG Toolbox &lt;i&gt;for MATLAB&lt;/i&gt;&lt;/a&gt;&lt;sup&gt;&lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;®&lt;/a&gt;)&lt;/sup&gt;).&lt;/p&gt;

&lt;p&gt;We first give the wrapper function, which checks its input parameters and then calls the NAG routine.  The function prototypes for all the routines in the NAG Fortran Library are contained in the header file &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;&lt;a href="http://www.nag.co.uk/numeric/FLOLCH/chgen22da/nagmk22.h"&gt;nagmk22.h&lt;/a&gt;&lt;/span&gt;; this is part of the Fortran Library distribution, and makes it easier to call any of the routines from within C or C++.  We note in passing that the wrapper is only required because we're using the NAG Fortran Library.  IDL is written in C, so DLMs must also be written in C; if the &lt;a href="http://www.nag.co.uk/numeric/CL/CLdescription.asp"&gt;NAG C Library&lt;/a&gt; was being used instead, this code would be simpler.&lt;/p&gt;

&lt;pre class="nag"&gt;
//---------------------------------------------------------------
void IDL_CDECL idl_e02bef(int argc, IDL_VPTR argv[], char *argk){
// IDL wrapper function for NAG routine E02BEF.
//
// Arguments: 
//
//  0 start  char*   input  "C" or "W": cold or warm start
//  1 NP     int     input  number of data points
//  2 x      double* input  independent (abscissa) values      
//  3 y      double* input  dependent (ordinate) values
//  4 w      double* input  weights
//  5 s      double  input  smoothing factor 
//  6 nest   int     input  over-estimate of the no. of knots
//  7 n      int     input  prior no. of knots for a warm start
//                   output total number of spline knots      
//  8 lambda double* input  prior knot positions
//                   output knot positions
//  9 c      double* output spline coefficients
// 10 fp     double  output sum of square weighted residuals 
// 11 wrk    double* input  prior work array for a warm start
//                   output work array
// 12 lwrk   int     input  size of work array: 4*NP+16*nest+41
// 13 iwrk   int*    input  prior integer work array (warm start)
//                   output integer work array
// 14 ifail  int     input  must be set to 0, -1 or 1
//                   output 0 unless an error occurred
//
//      call E02BEF(start, NP, x, y, w, s, nest, n, 
//                  lamda, c, fp, wrk, lwrk, iwrk, ifail) 
//
//---------------------------------------------------------------
   char start[2];
   int i, NP, nest, lwrk, n, *iwrk, ifail, length_start;
   double s, fp, *x, *y, *w, *lambda, *c, *wrk;
   
// Import all arguments, and check their values.
   
// First, the input parameters only.      
   IDL_ENSURE_STRING(argv[0]);      
   IDL_ENSURE_SCALAR(argv[0]);
   strncpy(start, IDL_STRING_STR(&amp;amp;argv[0]-&amp;gt;value.str), 1);
   start[1] = '\0';
   if(strlen(IDL_STRING_STR(&amp;amp;argv[0]-&amp;gt;value.str)) != 1) 
      fprintf(stderr,"Start String Length Incorrect\n");

   IDL_ENSURE_SCALAR(argv[1]);
   NP = (int)IDL_LongScalar(argv[1]); 
   
   IDL_ENSURE_ARRAY(argv[2]);
   x = (double *)argv[2]-&amp;gt;value.arr-&amp;gt;data;   
   if(argv[2]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; NP) 
      fprintf(stderr,"X Array Too Small\n");
      
   IDL_ENSURE_ARRAY(argv[3]);
   y = (double *)argv[3]-&amp;gt;value.arr-&amp;gt;data;   
   if(argv[3]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; NP) 
      fprintf(stderr,"Y Array Too Small\n");  
    
   IDL_ENSURE_ARRAY(argv[4]);
   w = (double *)argv[4]-&amp;gt;value.arr-&amp;gt;data;   
   if(argv[4]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; NP) 
      fprintf(stderr,"W Array Too Small\n");  
   
   IDL_ENSURE_SCALAR(argv[5]);
   s = (double)IDL_DoubleScalar(argv[5]); 
   
   IDL_ENSURE_SCALAR(argv[6]); 
   nest = (int)IDL_LongScalar(argv[6]); 
   
   IDL_ENSURE_SCALAR(argv[12]); 
   lwrk = (int)IDL_LongScalar(argv[12]); 
   
// Second, the input &amp;amp; output parameters.  
   IDL_ENSURE_SCALAR(argv[7]);
   IDL_EXCLUDE_EXPR(argv[7]);      
   n = (int)IDL_LongScalar(argv[7]);
        
   IDL_ENSURE_ARRAY(argv[8]);
   IDL_EXCLUDE_EXPR(argv[8]);
   lambda = (double *)argv[8]-&amp;gt;value.arr-&amp;gt;data;   
   if(argv[8]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; nest) 
      fprintf(stderr,"Lambda Array Too Small\n");
           
   IDL_ENSURE_ARRAY(argv[9]);
   IDL_EXCLUDE_EXPR(argv[9]);
   c = (double *)argv[9]-&amp;gt;value.arr-&amp;gt;data;
   if(argv[9]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; nest) 
      fprintf(stderr,"C Array Too Small\n");
   
   IDL_ENSURE_SCALAR(argv[10]);
   IDL_EXCLUDE_EXPR(argv[10]); 
   fp = (double)IDL_DoubleScalar(argv[10]);
   
   IDL_ENSURE_ARRAY(argv[11]);
   IDL_EXCLUDE_EXPR(argv[11]);
   wrk = (double *)argv[11]-&amp;gt;value.arr-&amp;gt;data; 
   if(argv[11]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; lwrk) 
      fprintf(stderr,"Work Array Too Small\n");
   
   IDL_ENSURE_ARRAY(argv[13]);
   IDL_EXCLUDE_EXPR(argv[13]);
   iwrk = (int *)argv[13]-&amp;gt;value.arr-&amp;gt;data;
   if(argv[13]-&amp;gt;value.arr-&amp;gt;n_elts &amp;lt; lwrk) 
      fprintf(stderr,"IWork Array Too Small\n");
   
   IDL_ENSURE_SCALAR(argv[14]);
   IDL_EXCLUDE_EXPR(argv[14]);      
   ifail = (int)IDL_LongScalar(argv[14]);        

//---------------------------------------------------------------
// Call the NAG routine.  It was written in Fortran; here, we 
// assume we're running under Linux or Unix, where most 
// compilers convert the name to lower case and prepend an 
// underscore.  The function prototype is defined in nagmk22.h 
// (above).
//
// Because one of the parameters is a character string (and 
// we're calling Fortran from C), we also have to pass its 
// length.  Under this calling convention, this goes at the end 
// of the argument list.
   length_start = strlen(start); 
   e02bef_(start, &amp;amp;NP, x, y, w, &amp;amp;s, &amp;amp;nest, &amp;amp;n, lambda, c, &amp;amp;fp, 
      wrk, &amp;amp;lwrk, iwrk, &amp;amp;ifail, length_start); 

// Check for unsuccessful call of NAG routine (see documentation)
// and output warning if necessary.
   if(ifail != 0) 
      fprintf(stderr,
      "Warning: e02bef returned with ifail = %d\n", ifail);
                            
//---------------------------------------------------------------
// Return the scalar data to IDL (we don't have to explicitly 
// return the arrays, as they're automatically passed by 
// pointer/reference).
   IDL_StoreScalar(argv[7],  IDL_TYP_LONG,   (IDL_ALLTYPES*)&amp;amp;n);
   IDL_StoreScalar(argv[10], IDL_TYP_DOUBLE, (IDL_ALLTYPES*)&amp;amp;fp);
   IDL_StoreScalar(argv[14], IDL_TYP_LONG, 
      (IDL_ALLTYPES*)&amp;amp;ifail);
}
&lt;/pre&gt;

&lt;p&gt;Each NAG routine that we want to use would require a separate wrapper, constructed along similar lines to those illustrated in this example.  &lt;/p&gt;

&lt;p&gt;Here's the rest of the code (which should precede the specification of the wrapper function in our file - which could be called, say, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idlnag.c&lt;/span&gt;). Along with the NAG function prototypes, we also include &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idl_export.h&lt;/span&gt;, which defines the IDL API.  Next, after defining a useful macro and the prototype for the wrapper function, we set up the DLM by first defining a structure &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idl_nagprocedures&lt;/span&gt; that will be used to pass information about our routine to IDL, and then using that in the specification of a function called &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;IDL_Load&lt;/span&gt;.  Every DLM must have this function, which is called when the DLM is first loaded; it calls &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;IDL_SysRtnAdd&lt;/span&gt; to load the routine definition, and then defines the exit handler (which does nothing in our case).&lt;/p&gt;

&lt;pre class="nag"&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include "idl_export.h" // IDL API Header
#include "nagmk22.h"    // NAG C/Fortran Prototypes

// Useful macro.  
#define ARRLEN(arr) (sizeof(arr)/sizeof(arr[0]))

//---------------------------------------------------------------
// Procedure prototypes - one for each routine in this module.
extern void IDL_CDECL idl_e02bef(int argc, 
   IDL_VPTR argv[], char *argk);

//---------------------------------------------------------------
// Structure used to pass information about our routine to IDL.  
// Other routines would require similar entries in this table.
static IDL_SYSFUN_DEF2 idlnag_procedures[] = {
   {(IDL_FUN_RET) idl_e02bef, // name of routine in here.
   "IDL_E02BEF",              // name of the IDL procedure.
   15,            // Min no. of arguments for routine.
   15,            // Max "   "      "      "     " 
   0,             // Further options which we don't use.
   0              // Reserved for IDL use - always set to 0.
   },
};

//---------------------------------------------------------------
// This function is called when IDL is shut down.
void idlnag_exit_handler(void) {
   // Nothing to do.
}

//---------------------------------------------------------------
int IDL_Load(void) {
// This function is called when IDL loads this module.  

// Call IDL_SysRtnAdd to register the routine contained in this 
// module.  Note that this routine is what IDL calls a 
// procedure - i.e. it doesn't return a value (cf. what IDL 
// calls a function, which does).  This is specified by setting 
// the second parameter in the call to FALSE (it's TRUE for 
// functions). 
   if (!IDL_SysRtnAdd(idlnag_procedures, FALSE, 
      ARRLEN(idlnag_procedures))) return IDL_FALSE;

// Register the exit handler.
   IDL_ExitRegister(idlnag_exit_handler);

   return(IDL_TRUE);
}
&lt;/pre&gt;

&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idlnag.c&lt;/span&gt; must then be compiled and linked into a shared library (called &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idlnag.so&lt;/span&gt; on Unix) which should be placed in a location on the directory path specified by the &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;IDL_DLM_PATH&lt;/span&gt; environment variable.  The other file that must be in that location is the so-called DLM module description file.  In our example, its contents would be:&lt;/p&gt;

&lt;pre class="nag"&gt;
MODULE idlnag                    # Name of the DLM
DESCRIPTION IDL Interface to NAG # Optional one-line description
VERSION 1.0                      # Optional version number
PROCEDURE IDL_E02BEF 15 15 # Routine name, min, max no. of args
&lt;/pre&gt;

&lt;p&gt;Here, the name of the DLM must be the same as the name of the shared library we've created, whilst the routine name and the minimum and maximum number of arguments must be the same as that specified in the &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;IDL_SYSFUN_DEF2&lt;/span&gt; structure - i.e. &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;idlnag_procedures&lt;/span&gt; in our case.&lt;/p&gt;&lt;p&gt;Having defined the new function in this fashion, it will be loaded the next time that IDL is started, and it can be invoked within IDL as&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;pre class="nag"&gt;
IDL_E02BEF, start, NP, x, y, w, s, nest, n, lambda, c, fp, $
            wrk, lwrk, iwrk, ifail
&lt;/pre&gt;

&lt;p&gt;where &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;start&lt;/span&gt; is an IDL variable of type &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;string&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;NP&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;long&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;x&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;y&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;w&lt;/span&gt; are &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;double&lt;/span&gt; arrays of size &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;NP&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;s&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;double&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;nest&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;n&lt;/span&gt; are &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;long&lt;/span&gt;s, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;lambda&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;c&lt;/span&gt; are &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;double&lt;/span&gt; arrays of size &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;nest&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;fp&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;double&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;lwrk&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;long&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;wrk&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;double&lt;/span&gt; array of size &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;lwrk&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;iwrk&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;long&lt;/span&gt; array of size &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;nest&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;ifail&lt;/span&gt; is a &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;long&lt;/span&gt;.  The next step would be to call &lt;a href="http://www.nag.co.uk/numeric/FL/nagdoc_fl22/xhtml/E02/e02bbf.xml"&gt;E02BBF&lt;/a&gt;, which evaluates the spline curve using the parameters calculated by E02BEF - specifically, the knot positions &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;lambda(nest)&lt;/span&gt;, and the spline coefficients &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;c(nest)&lt;/span&gt; - see &lt;a href="http://www.nag.co.uk/industryarticles/usingtoolboxmatlabpart2.asp#e02fittingsetpoints"&gt;this demo&lt;/a&gt; for an illustration (albeit using a different package).&lt;/p&gt;

&lt;p&gt;A more complete description of how to call external routines from within IDL is available &lt;a href="http://www.atm.ox.ac.uk/code/mie/dlm_help/index.html"&gt;here&lt;/a&gt;.  That account also illustrates the use of IDL &lt;i&gt;keywords&lt;/i&gt; to modify the behaviour of the function; their use has been eschewed in this example in order to retain the exact correspondence between the argument list for the NAG Fortran Library routine and the way in which it's called in IDL. We've also opted for a simple error-handling mechanism in the wrapper; alternatives which are better-integrated with IDL are possible.  Finally, we note that more information on IDL DLMs is available from the IDL documentation, which can be found in various locations (such as &lt;a href="http://idlastro.gsfc.nasa.gov/idl_html_help/Dynamically_Loadable_Modules.html"&gt;here&lt;/a&gt;, for example).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-6407481431281115735?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/6407481431281115735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/02/calling-nag-routines-from-idl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6407481431281115735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6407481431281115735'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/02/calling-nag-routines-from-idl.html' title='Calling NAG routines from IDL'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5086139275245117178</id><published>2011-02-09T16:31:00.008Z</published><updated>2011-02-11T07:46:26.554Z</updated><title type='text'>Wandering Precision</title><content type='html'>If you call the same numerical library routine twice with exactly the same input data, you expect to get identical results - don't you?
&lt;p&gt;
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).
&lt;p&gt;
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.
&lt;p&gt;
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 its arithmetic.
&lt;p&gt;
Let me give you an example. Suppose you want to compute the inner product of two vectors x and y, each of length n. Simple - you just multiply each element of x by the corresponding element of y, then add all the products together to get the answer. No apparent randomness there. What could go wrong?
&lt;p&gt;
Well, if the hardware you are running on is equipped with Streaming SIMD Extension (SSE) instructions - and almost all modern hardware is - here's what.
&lt;p&gt;
SSE instructions enable low-level parallelism of floating-point arithmetic operations. For example, you can hold four single precision numbers at the same time in a 128-bit register, and operate on them all at the same time. This leads to massive time savings when working on large amounts of data.
&lt;p&gt;
But this may come at a price. Efficient use of SSE instructions can sometimes depend on exactly how the memory used to store vectors x and y is aligned. If it's aligned nicely - by which I mean, in the inner product example, that the addresses of the first elements of the arrays x and y are multiples of 16 bytes - then that's good. The hardware can efficiently move numbers from memory into registers to work on them, using instructions that depend on that alignment. So for our inner product, with a good optimizing compiler, we'd load numbers four at a time, multiply them together four at a time, and accumulate the results as we go along into our final result.
&lt;p&gt;
But if the memory is not nicely aligned - and there's a good chance it may not be - the compiler needs to generate a different code path to deal with the situation. Here the result will take longer to get because the numbers have to be accumulated one at a time. At run time, the code checks whether it can take the fast path or not, and works appropriately.
&lt;p&gt;
The problem is that by messing with the order of the accumulations, you are quite possibly changing the final result, simply due to rounding differences when working with finite precision computer arithmetic.
&lt;p&gt;
Instead of getting
&lt;pre&gt;
  s = x1*y1 + x2*y2 + x3*y3 + ...
&lt;/pre&gt;
you get
&lt;pre&gt;
  s = (x1*y1 + x5*y5 + x9*y9 + x13*y13) +
      (x2*y2 + x6*y6 + x10*y10 + x14*y14) + ...
&lt;/pre&gt;
&lt;p&gt;
Chances are that the result will be just as accurate either way - but it's different by a tiny amount. And if that tiny difference leads to a different decision made by the code that called the inner product routine, the difference can be magnified.
&lt;p&gt;
In some cases, for example when solving a mathematical optimization problem using a local minimizer, the final result can be completely different - and yet still valid - because a local minimizer might converge to any one of several different minimum points, if the function does not have a unique minimum.
&lt;p&gt;
And all because of how a piece of memory happens to be aligned. If you allocated the memory yourself you might be able to do something about it, but on the other hand the alignment might be completely outside your control. NAG users have reported cases where running a program from the command line would give consistently different results from running the same program by clicking on its name in Windows Explorer.
&lt;p&gt;
Is there anything we can do about problems like this?  The fact is that NAG users want their code to run fast, so using SSE instructions makes sense. We can lobby the compiler writers to ask them to be careful how they optimize the code they produce, but they won't necessarily take notice. Compiler writers could also help by making their memory allocation routines only return 16-byte aligned memory, specifically to help with the use of SSE instructions. In the past, though, I had no success trying to convince the gfortran compiler folks to do that. In any case, even if they did, it wouldn't always help - if the first element of a single or double precision array is aligned on a 16 byte boundary, the second element will definitely not be, so if you want to operate on a vector starting at that location you've no chance.
&lt;p&gt;
We could choose not to use SSE instructions at all. But, apart from efficiency reasons, the "legacy" extended precision  80-bit register arithmetic which started in the 1980s with the 8087 numeric co-processor had its own "wobbling precision" problems for numerical code.
&lt;p&gt;
As new hardware with AVX instructions and 256 bit registers comes along, even more numerical work can be done in parallel. So - it seems that for the foreseeable future we're just going to have to live with this, and try to minimize the effects on NAG users by means of documentation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5086139275245117178?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5086139275245117178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/02/wandering-precision.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5086139275245117178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5086139275245117178'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/02/wandering-precision.html' title='Wandering Precision'/><author><name>Mick Pont</name><uri>http://www.blogger.com/profile/15149585002054415615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_dCVG_bqZucY/S3P_R_bC7xI/AAAAAAAAADc/weuU-FRfQRk/S220/MrPont.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2764800900024961390</id><published>2011-01-27T11:34:00.002Z</published><updated>2011-01-27T11:38:34.650Z</updated><title type='text'>The joy of creating new solvers...</title><content type='html'>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. &lt;p&gt;

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 benefits, in usability, accuracy and performance, to users of our routines. For example one of the new optimization routines provides a new approach to solving bound constrained problems without requiring derivatives – making this solver very efficient for a range of large dimensional problems. &lt;p&gt;

All these recent conversations have reminded me that we certainly have the expertise and the right attitude to help you. So do get in touch, at any time, if you want to discuss which of the hundreds of NAG routines you can use to solve your specific problem.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2764800900024961390?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2764800900024961390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/01/joy-of-creating-new-solvers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2764800900024961390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2764800900024961390'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/01/joy-of-creating-new-solvers.html' title='The joy of creating new solvers...'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-7797626571113844854</id><published>2011-01-21T11:45:00.001Z</published><updated>2011-01-21T11:51:57.930Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer engagement'/><category scheme='http://www.blogger.com/atom/ns#' term='social media'/><category scheme='http://www.blogger.com/atom/ns#' term='linkedin'/><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>True Customer Engagement (when social is not so social)</title><content type='html'>About a year ago NAG embarked on a new journey into the realms of social media as a&amp;nbsp;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. &lt;br /&gt;
&lt;br /&gt;
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 &lt;a href="http://www.twitter.com/NAGTalk"&gt;NAG on Twitter&lt;/a&gt; and a &lt;a href="http://www.linkedin.com/e/vgh/2707514/"&gt;group on Linkedin&lt;/a&gt;. 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. &lt;br /&gt;
&lt;br /&gt;
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&amp;nbsp;that it's probably&amp;nbsp;down to a host of reasons. Here are my thoughts:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;
&lt;a href="http://4.bp.blogspot.com/_i0peT_HmUfg/TTlsrYMJ3tI/AAAAAAAAAFU/XoR6KINt5vw/s1600/heads+in+circle+-+Copy.jpg" imageanchor="1" style="clear: right; cssfloat: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" s5="true" src="http://4.bp.blogspot.com/_i0peT_HmUfg/TTlsrYMJ3tI/AAAAAAAAAFU/XoR6KINt5vw/s1600/heads+in+circle+-+Copy.jpg" /&gt;&lt;/a&gt;1. Maybe our audience don’t have time or inclination to communicate with us through social media? &lt;/div&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;
2. Or, maybe we’re not asking the right questions of our audience, or in fact any questions?&lt;/div&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;
&lt;br /&gt;&lt;/div&gt;
3. Maybe our audience still prefer more traditional methods of communication?&lt;br /&gt;
&lt;br /&gt;
During 2011 we’ll be thinking of ways to further enhance dialogue with&amp;nbsp;our customers. We really do want to hear&amp;nbsp;how you’re using our software and learn about your successes and failures. This helps us grow and improve as an organisation, not only by making product offerings more customer centric, but improving our customer service. &lt;br /&gt;
&lt;br /&gt;
Please do get in touch if you have ideas or thoughts of your own on this. I’d love to hear from you. &lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-7797626571113844854?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/7797626571113844854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/01/true-customer-engagement-when-social-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7797626571113844854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7797626571113844854'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/01/true-customer-engagement-when-social-is.html' title='True Customer Engagement (when social is not so social)'/><author><name>Katie O'Hare</name><uri>http://www.blogger.com/profile/09366741271809330805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_i0peT_HmUfg/S1bVfzjngYI/AAAAAAAAACk/VCRfSRPJ7KQ/S220/ImageforGoogle.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_i0peT_HmUfg/TTlsrYMJ3tI/AAAAAAAAAFU/XoR6KINt5vw/s72-c/heads+in+circle+-+Copy.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4889225047416641253</id><published>2011-01-14T13:54:00.003Z</published><updated>2011-01-19T10:13:15.089Z</updated><title type='text'>NAG Life Service Recognition Award</title><content type='html'>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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4889225047416641253?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4889225047416641253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2011/01/you-dont-often-feel-like-singing-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4889225047416641253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4889225047416641253'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2011/01/you-dont-often-feel-like-singing-about.html' title='NAG Life Service Recognition Award'/><author><name>Susan Shayler</name><uri>http://www.blogger.com/profile/06733162223866845760</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://3.bp.blogspot.com/_x0V4ZFGKjPg/S1RaB7WFtwI/AAAAAAAAAAU/mR3tWuUVE0s/S220/lakka_from_balcony.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4637661616617331410</id><published>2010-12-22T10:32:00.012Z</published><updated>2010-12-22T15:30:00.091Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='ParaView'/><category scheme='http://www.blogger.com/atom/ns#' term='file formats'/><category scheme='http://www.blogger.com/atom/ns#' term='endianness'/><title type='text'>ParaView, VTK files and endianness</title><content type='html'>&lt;p&gt;Recently, I've been doing some work with &lt;a href="http://www.paraview.org/"&gt;ParaView&lt;/a&gt;, a rather nice open-source visualization application that's aimed at the display and analysis of large data sets. It has a wide range of &lt;a href="http://www.paraview.org/paraview/project/features.html#vis"&gt;visualization functionality&lt;/a&gt;, an interface that allows for interaction via its &lt;a href="http://www.paraview.org/paraview/project/features.html#user"&gt;graphical user interface&lt;/a&gt;, or through &lt;a href="http://www.paraview.org/paraview/project/features.html#scr"&gt;scripting&lt;/a&gt;, and a &lt;a href="http://www.paraview.org/paraview/project/features.html#dst"&gt;distributed architecture&lt;/a&gt;.  Executable versions are &lt;a href="http://www.paraview.org/paraview/resources/software.html"&gt;available&lt;/a&gt; for a variety of platforms, or you can download the source and compile it yourself.  I'm currently running the Windows 64bit distribution on my laptop, and have also been building the source on &lt;a href="http://www.hector.ac.uk/"&gt;HECToR&lt;/a&gt;, with a view to trying the application out on that machine, and using it for the analysis of some of the large data sets generated there.&lt;/p&gt;

&lt;p&gt;ParaView uses the open-source &lt;a href="http://www.vtk.org/"&gt;Visualization Toolkit&lt;/a&gt; (VTK) for data processing and rendering; this consists of a core C++ class library and interpreted interface layers for Tcl/Tk, Java and Python.  Much of VTK's &lt;a href="http://www.vtk.org/VTK/project/imagegallery.php"&gt;functionality&lt;/a&gt; - specifically, its visualization techniques and modelling methods - is available from within ParaView, and it's also possible to extend the application to support other VTK classes by (for example) &lt;a href="http://www.paraview.org/Wiki/Extending_ParaView_at_Compile_Time"&gt;providing an XML description of the interface&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The first thing the user of any visualization system wants to do is to read their own data into it (of course, this will also be the &lt;i&gt;last &lt;/i&gt;thing they ever do with the system, if it proves to be too recalcitrant).  Doing this requires some understanding of the type of data that the system can process, and the translation of the different components of the user's data into those types.  Generally speaking, it's usually most straightforward for the user to write their data to a file in a format which is supported by the system (the alternative approach - more useful when, for example, the  the user has a lot of data files in a particular format - is to extend the system to support the reading of that format).&lt;/p&gt;

&lt;p&gt;ParaView can read files in &lt;a href="http://paraview.org/OnlineHelpCurrent/ParaViewReaders.html"&gt;several formats&lt;/a&gt;, including so-called VTK Legacy files (so named because the format was introduced in an earlier version of VTK; since then, it's been supplemented by a more flexible &lt;a href="http://www.vtk.org/Wiki/VTK_XML_Formats"&gt;XML-based format&lt;/a&gt;).  Its structure is pretty straightforward, and &lt;a href="http://www.vtk.org/VTK/img/file-formats.pdf"&gt;well-documented&lt;/a&gt;.  Here's the first part of an example Legacy file, which contains scalar data values located on a regular 3D mesh:&lt;/p&gt;

&lt;pre class="nag"&gt;
# vtk DataFile Version 2.0
3D example
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 61 61 101
ORIGIN 0.0 0.0 0.0
SPACING 0.05 0.05 0.05
POINT_DATA 375821
SCALARS volume_scalars float 1
LOOKUP_TABLE default
&lt;/pre&gt;

&lt;p&gt;The coordinates of the nodes on this kind of mesh (which VTK calls a &lt;i&gt;Structured Point &lt;/i&gt;dataset) are fully specified by providing values for the parameters given by the keywords &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;DIMENSION&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;ORIGIN&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;SPACING&lt;/span&gt; on each axis; the other file keywords are described &lt;a href="http://www.vtk.org/VTK/img/file-formats.pdf"&gt;elsewhere&lt;/a&gt;, along with an account of the other types of mesh and the other data structures which VTK supports. More specifically here, the keyword &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;ASCII&lt;/span&gt; specifies that the data values (which come next in the file) are written in this format.  Selecting this option ensures that the entire file is human-readable and portable from one machine to another, but it might not be the best choice if the data file is very large (for the usual reasons of space and speed).  Switching to &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;BINARY&lt;/span&gt; makes the file more compact and allows it to be written and read more quickly.&lt;/p&gt;

&lt;p&gt;Here's where I ran into a (slight) problem: although ParaView read the the ASCII version of my file and displayed it correctly, this broke when I switched to the binary version (more accurately, ParaView read the file in happily but the values which it found there were wrong).  After some poking around in the documentation, I realised the problem was that VTK - and hence, ParaView - &lt;i&gt;always &lt;/i&gt;expects the binary data in the Legacy file to be stored with the most significant byte first - also known as the &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Endianness"&gt;big-endian&lt;/a&gt;&lt;/i&gt; representation.  (To be strictly honest, I couldn't find this point specified unambiguously in the otherwise-excellent &lt;a href="http://www.vtk.org/VTK/img/file-formats.pdf"&gt;VTK file formats guide&lt;/a&gt;, but it was emphasised more explicitly &lt;a href="http://www.vtk.org/Wiki/VTK/Writing_VTK_files_using_python#.22legacy.22"&gt;elsewhere&lt;/a&gt;).  However, my file had been output by a program in which the data was stored with the least significant byte first - i.e., in the so-called &lt;i&gt;little-endian&lt;/i&gt; fashion.  The representation used by the program to store the data depends on both the operating system and hardware architecture for which it's been compiled (for example, it's little-endian for Windows on x64 - which is what I'm currently using - but big-endian for Solaris on SPARC), and this representation is preserved when the data is output as a raw stream of bytes - as is done, for example, by the C &lt;a href="http://en.wikipedia.org/wiki/C_file_input/output#fwrite"&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 15px; white-space: pre; "&gt;fwrite()&lt;/span&gt;&lt;/a&gt; function.&lt;/p&gt;

&lt;p&gt;Having realised the problem, the solution was clear: swap the order of the bytes around in each data value before writing it out.  There are many ways to do this, but I found &lt;a href="http://www.gamedev.net/reference/articles/article2091.asp"&gt;this document&lt;/a&gt; helpful.  It proposes a framework for handling several data types which is intended to be portable across both little- and big-endian architectures (note also that the framework receives much attention &lt;a href="http://www.gamedev.net/community/forums/topic.asp?key=featart&amp;amp;uid=2091&amp;amp;forum_id=35&amp;amp;Topic_Title=Writing+Endian+Independent+Code+in+C%2B%2B"&gt;here&lt;/a&gt; as alternatives which are possibly more robust, general and/or portable are suggested). Since my data is stored as floats, I only needed a small part of the framework; here's the C function I used:&lt;/p&gt;

&lt;pre class="nag"&gt;
float FloatSwap( float f )
{    
   union
   {
      float f;
      byte b[4];
   } dat1, dat2;

   dat1.f = f;
   dat2.b[0] = dat1.b[3];
   dat2.b[1] = dat1.b[2];
   dat2.b[2] = dat1.b[1];
   dat2.b[3] = dat1.b[0];
   return dat2.f;
}
&lt;/pre&gt;

&lt;p&gt;and here's how I used it when writing out the data values:&lt;/p&gt;

&lt;pre class="nag"&gt;
float *data, val;
FILE *fp;

/* Generate the data values, open the file and write the header.  */
...

/* Output the data values.  */
index = 0;
for( k=0; k&amp;lt;nz; k++ )
   for( j=0; j&amp;lt;ny; j++ )
      for( i=0; i&amp;lt;nx; i++ ) {
         /* Swap the bytes in this data value, write it out.  */
         val = FloatSwap(data[index]);
         fwrite((void *)&amp;amp;val, sizeof(float), 1, fp);
         index++;
      }

fclose(fp);
&lt;/pre&gt;

&lt;p&gt;Finally, here's the visualization which I created in ParaView.  The dataset is the probability density function corresponding to the so-called 3d&lt;sub&gt;z&lt;sup&gt;2&lt;/sup&gt;&lt;/sub&gt; &lt;a href="http://en.wikipedia.org/wiki/Atomic_orbital"&gt;atomic orbital&lt;/a&gt;, and it's visualized using volume rendering and an isosurface, which highlights its characteristic shape: two lobes and a torus (I once heard the profile of rather overweight chemistry teacher being compared unflatteringly to this).&lt;/p&gt;


&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TQpDrOdv2TI/AAAAAAAAAD8/kTdBhJbDCTY/s1600/dz2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 313px; height: 400px;" src="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TQpDrOdv2TI/AAAAAAAAAD8/kTdBhJbDCTY/s400/dz2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5551323900583860530" /&gt;&lt;span style="font-size: 85%;"&gt;Using ParaView to visualize a 3D dataset&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4637661616617331410?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4637661616617331410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/12/paraview-vtk-files-and-endianness.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4637661616617331410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4637661616617331410'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/12/paraview-vtk-files-and-endianness.html' title='ParaView, VTK files and endianness'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NFq6A7hoc_Y/TQpDrOdv2TI/AAAAAAAAAD8/kTdBhJbDCTY/s72-c/dz2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-6012884047951142139</id><published>2010-12-16T10:55:00.005Z</published><updated>2010-12-16T13:02:30.759Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='HECToR'/><title type='text'>Half-way through HECToR</title><content type='html'>&lt;a href="http://www.hector.ac.uk/"&gt;HECToR&lt;/a&gt;, the UK national supercomputer service, had its third birthday in October.  NAG, as many readers will know, provides the &lt;a href="http://www.hector.ac.uk/cse/"&gt;Computational Science and Engineering (CSE)&lt;/a&gt; support for the service, helping users with application problems, and with porting and tuning their codes to make them as efficient as possible.  We also provide an extensive programme of &lt;a href="http://www.hector.ac.uk/cse/training/"&gt;training courses&lt;/a&gt; throughout the UK covering both basic and advanced topics.  To date we have had over 900 attendees on these courses and delivered them in 16 locations.  We are currently putting together our programme for next year, upgrading our course materials in response to the latest hardware upgrade (from a Cray XT6 to an XE6), and developing material for some new topics that we haven't addressed before.
&lt;p&gt;
A novel aspect of the HECToR service is the &lt;a href="http://www.hector.ac.uk/cse/distributedcse/"&gt;Distributed CSE Service (DCSE)&lt;/a&gt; which funds dedicated resources to work on specific codes.  Those resources can come from within the research community itself, or from specialist teams (including our own HPC team), and to date we have funded more than 46 years of effort for 48 projects.
&lt;p&gt;
DCSE projects have addressed a wide range of issues, but two themes recur frequently:
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Adopting shared-memory techniques.&lt;/span&gt;  This is necessary to share data between multiple cores on the same socket where there is not enough memory for each core to have its own copy, and also to make efficient use of the increased number of cores per node.&lt;/li&gt;
&lt;li&gt; &lt;span style="font-weight: bold;"&gt;More efficient I/O.&lt;/span&gt;  Reading and writing data is often a major bottleneck in applications and parallelising the I/O and using libraries that compress data efficiently can deliver impressive performance improvements.&lt;/li&gt;
&lt;/ol&gt;
In the last three years HECToR has gone from 2 cores per node to 24, and from a total of 11,328 cores (on the original XT4) to 44,544 (on the new XE6).  However memory per core has dropped from 3GB to 1.33G, and clock speed has dropped from 2.8GHz to 2.1GHz.  These changes mirror those that we are seeing more generally in our industry, namely more cores running more slowly and with less memory.  Our experiences on HECToR demonstrate that software needs to be adapted to make efficient use of newer hardware.  The good news is that this sort of software engineering work is often very cost-effective - many of the DCSE projects have saved more money in HECToR resources than they cost in labour.  Hopefully this will lead to more and better scientific outputs in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-6012884047951142139?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/6012884047951142139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/12/half-way-through-hector.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6012884047951142139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6012884047951142139'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/12/half-way-through-hector.html' title='Half-way through HECToR'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3605880232797358189</id><published>2010-11-25T14:01:00.001Z</published><updated>2010-12-01T09:28:43.866Z</updated><title type='text'>Christmas Comes Early</title><content type='html'>Christmas came early for one little girl at NAG Ltd. Being in charge of office services has its ups and downs (hands down a blocked loo or physically being up a ladder changing light bulbs) are part of my normal day. But a call from the local fire brigade certainly cheered me up. Since the fire service has stopped its annual building inspections we are now reliant on paying somebody to come in every year to carry out a risk assessment and for some reason these people are always rather bland and lacking in making their work (although serious) fun. Anyone who was here two years ago and was lucky enough to have training on the use of fire extinguishers would know this has to have been the best training course ever; it was a laugh from start to finish. The request was to familiarise themselves with the layout of the building so if there was ever a real emergency and they would have some background knowledge. They had promised to arrive in a full rig and I had expected one or two officers, but four was hitting the jackpot! We had a nice chat over a quick cuppa about fire exits (staff should use the designated fire exits and not the main entrance), number of hydrants on site, lighting etc and then we did a tour of the building. Being only 5ft 1 ½” (5ft 6” in heels) I felt really small as they were all over 6ft but they were a really nice bunch who do a fabulous job and hopefully will only ever be here is a more social capacity rather than a fully fledged work one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3605880232797358189?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3605880232797358189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/christmas-comes-early.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3605880232797358189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3605880232797358189'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/christmas-comes-early.html' title='Christmas Comes Early'/><author><name>Katrina Jenkins</name><uri>http://www.blogger.com/profile/00610733910976086444</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_xX_QjF15jAs/TO5xQQfR3rI/AAAAAAAAAAM/skZcy8ElZ2M/S220/Ascot%2B217.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2077926804168862074</id><published>2010-11-22T17:06:00.041Z</published><updated>2010-11-30T12:49:39.867Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='illusion'/><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='HECToR'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='colour'/><title type='text'>Now you see it...</title><content type='html'>&lt;p&gt;A few weeks ago, I presented the &lt;a href="http://www.hector.ac.uk/cse/training/sciviz/"&gt;HECToR scientific visualisation training course&lt;/a&gt; to a group of researchers at the &lt;a href="http://www.reading.ac.uk/"&gt;University of Reading&lt;/a&gt;.  This course looks at the use of visualisation as a tool for the improved understanding of numerical data (as produced, for example, by calculations or simulations run on &lt;a href="http://www.hector.ac.uk/"&gt;HECToR&lt;/a&gt;).  We started by exploring the different types of data - characterizing each according to its structure, dependencies and dimensionality - before reviewing the different visualisation techniques (such as contouring, particle tracing, volume rendering) that are applicable to each type.  Some examples of the techniques, used to display a variety of data types from several application areas, are given in the figures below.&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NFq6A7hoc_Y/TOuwQN4n6FI/AAAAAAAAACo/aQAvGZocax4/s1600/cylstream.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 301px;" src="http://1.bp.blogspot.com/_NFq6A7hoc_Y/TOuwQN4n6FI/AAAAAAAAACo/aQAvGZocax4/s400/cylstream.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5542717559061080146" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  Fluid flow around a cylinder&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TOu1N0o_wkI/AAAAAAAAAC4/dLruO7Xcf38/s1600/aneurism.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 380px; height: 400px;" src="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TOu1N0o_wkI/AAAAAAAAAC4/dLruO7Xcf38/s400/aneurism.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5542723015483048514" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 2.  Visualisation of MRI data, showing an aneurism&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TOqsyWrGCnI/AAAAAAAAACg/-xFVcp3BlGU/s1600/3lj.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 376px;" src="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TOqsyWrGCnI/AAAAAAAAACg/-xFVcp3BlGU/s400/3lj.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5542432272512584306" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 3.  Potential energy in the space between three atoms&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;Next, we briefly reviewed a few applications for performing visualisation, of which there are a plethora in both the public domain and commercial arenas.  Some of these have comparable functionalities - thus, for example, Figure 1 was produced using &lt;a href="http://www.nag.co.uk/Welcome_IEC.asp"&gt;IRIS Explorer&lt;/a&gt;, &lt;a href="http://www.nag.co.uk/advise/index.asp"&gt;ADVISE&lt;/a&gt; was used for Figure 2, and Figure 3 was created with &lt;a href="http://www.paraview.org/"&gt;ParaView&lt;/a&gt;.   The plot in Figure 4 (which illustrates the use of &lt;a href="http://www.nag.co.uk/numeric/MB/manual_22_1/pdf/D02/d02ke.pdf"&gt;a routine&lt;/a&gt; from the &lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;NAG Toolbox for MATLAB®&lt;/a&gt;) was made using &lt;a href="http://www.mathworks.com/products/matlab/"&gt;MATLAB&lt;/a&gt;.&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NFq6A7hoc_Y/TO0BX_Vne6I/AAAAAAAAADw/_JW4SqrN7gk/s1600/d02kef.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_NFq6A7hoc_Y/TO0BX_Vne6I/AAAAAAAAADw/_JW4SqrN7gk/s400/d02kef.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5543088228013669282" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 4.  Solution of a Sturm–Liouville equation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;Figure 4 can be used to demonstrate another aspect of the training course - namely, the highlighting of good and bad practice in visualisation.  Depending on the resolution of the display medium for the figure, it is usually apparent that the blue solid curve is easier to see than the dashed green one.  This may not necessarily be a significant effect, although you might be reminded of other instances you've seen in presentations where - for example - a yellow curve has been rendered more or less invisible by being displayed against a white background, or a blue curve against black.  In general, it can be surprising how little attention is apparently paid to issues such as clarity and reproducibility in visualisations by users who've spent a lot of time generating and checking their results, only to see their impact lost or impeded because of a poorly-designed display.&lt;/p&gt;

&lt;p&gt;As alluded to above, one of the things that should be taken into account when designing a visualisation is the use of colour.  Indeed, Figure 3 also illustrates how care should be taken when selecting colours: many viewers will find its juxtaposition of the red surface against a green background difficult to look at (try reading green text on a red field - or vice versa - for a further illustration of this).  The way in which we perceive colour is a complex subject, but one salient point is that, whilst our eyes see absolute colours, our brains perceive differences in colours - i.e., the appearance of a colour depends on its surroundings.   This apparently surprising fact underpins the workings of a whole range of optical illusions, of which my current favourite is the so-called &lt;a href="http://en.wikipedia.org/wiki/Same_color_illusion"&gt;same colour illusion&lt;/a&gt;:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NFq6A7hoc_Y/TOvySSBzKNI/AAAAAAAAADg/kFoX8DvWUpc/s1600/New%2BPicture%2B%25281%2529.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_NFq6A7hoc_Y/TOvySSBzKNI/AAAAAAAAADg/kFoX8DvWUpc/s400/New%2BPicture%2B%25281%2529.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5542790162300479698" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 5.  Are the two orange circles the same colour?&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;Looking at Figure 5, it can be difficult to see that the two orange circles are the same colour - although, bearing in mind the discussion above, most people would probably accept it.  But what's much harder to believe (although it's also true) is that &lt;i&gt;the squares which surround them are also the same colour as each other&lt;/i&gt;.  &lt;a href="http://web.mit.edu/persci/people/adelson/checkershadow_description.html"&gt;The reason&lt;/a&gt; we perceive them as different is that they have different surroundings (and also because of the way in which our brains try and compensate for the effect of shadows).&lt;/p&gt;

&lt;p&gt;Demonstrations of illusions such as this (and the examples of good and - mostly - bad practice in visualisation) made the training session quite a lively one.  In fact, I suspect that - notwithstanding the undoubted fascination that can be exerted by the study of visualisation techniques and applications - this was the part of the presentation that lingered longest in the minds of many of the attendees.  I could be wrong, though.  &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2077926804168862074?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2077926804168862074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/now-you-see-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2077926804168862074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2077926804168862074'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/now-you-see-it.html' title='Now you see it...'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NFq6A7hoc_Y/TOuwQN4n6FI/AAAAAAAAACo/aQAvGZocax4/s72-c/cylstream.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-510548904086248906</id><published>2010-11-17T16:19:00.007Z</published><updated>2010-11-17T17:30:58.819Z</updated><title type='text'>Fortran Fame</title><content type='html'>I was standing on the NAG booth here at SC10 yesterday, muttering to myself about the difficulty of maintaining an internet connection in the exhibition hall. The organisers claim that there's more bandwidth available at SC10 than is used by any but the five largest countries in the world - I think they're exaggerating because I can never get any of it.

&lt;p&gt;
Anyway, along came a dapper fellow wearing a baseball cap who started a converstaion about the way standards were being implemented in the NAG Fortran compiler. I asked whether he was interested in using Fortran. "Well, I used to be", he said. Belatedly I looked down at his name badge. It turned out to be Tom Lahey, founding father of the Lahey Fortran compiler. What could I do but shake his hand and bow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-510548904086248906?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/510548904086248906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/i-was-standing-on-nag-booth-here-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/510548904086248906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/510548904086248906'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/i-was-standing-on-nag-booth-here-at.html' title='Fortran Fame'/><author><name>Mick Pont</name><uri>http://www.blogger.com/profile/15149585002054415615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_dCVG_bqZucY/S3P_R_bC7xI/AAAAAAAAADc/weuU-FRfQRk/S220/MrPont.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-997904948573115980</id><published>2010-11-17T06:50:00.013Z</published><updated>2010-11-17T07:08:46.001Z</updated><title type='text'>It's a hard life.</title><content type='html'>Every year in November NAG staff attend SC, formerly known as SuperComputing, an annual showcase where computer hardware and software vendors can display their goods and services, along with a huge technical agenda covering all aspects of HPC and scientific computing.
&lt;p&gt;The show moves around different cities in the United States. This year &lt;a href="http://sc10.supercomputing.org/"&gt;SC10&lt;/a&gt; is in New Orleans, Louisiana, and running from 14th to 21st November, with around 10,000 registered attendees. It's the 23rd outing since the first one which took place in Orlando, Florida in 1988. NAG has attended every single one of these events, and is one of just a handful of outfits to do so.
&lt;/p&gt;&lt;p&gt;New Orleans was founded in 1718 by French speculators interested in making money from trade and finance, and named after the then French Regent, Philippe, Duke of Orléans. In the  mid-eighteenth century it was ceded to the Spanish. They're the ones who actually created most of the characteristic architecture in the heart of the city now known as the French Quarter. In 1801 it returned to French control, only to be sold to the United States a couple of years later as part of the "Louisiana Purchase". In more recent times New Orleans was badly hit by Hurricane Katrina, and there's a nice museum detailing all the sad events of that calamity next door to St. Louis' Church in downtown New Orleans.
&lt;/p&gt;&lt;p&gt;So, SC is always a great place to find out about the latest developments in computing technology,  talk to NAG customers, meet old friends and make new ones, and this year is no exception.  By the way, if it's not too late and you want to come to talk to us, the NAG booth is number 3131 in the exhibition hall.&lt;/p&gt;&lt;p&gt;The trouble is the parties. They start on the Sunday evening, with the "Exhibitors' Party". This is open to anyone with an X on their name badge, meaning that they're working one of the booths in the exhibition hall. The food is piled high, and there's enough drink to float the Queen Mary.
&lt;/p&gt;&lt;p&gt;
Monday evening is the "Opening Night Party", which is at the nearby Metropolitan Night Club. A jazz band plays the hits of Fats Domino, Louis Armstrong and other New Orleans greats. The food is piled high, and there's enough drink to float the Queen Mary.
&lt;/p&gt;&lt;p&gt;
Tuesday evening. Two big parties going on, one hosted by Cray and AMD which takes place in a ballroom at the Marriott Hotel, and one hosted by SGI and Intel, which is at Pat O'Brien's Bar on Bourbon Street in the French Quarter. In the interests of vendor neutrality, of course NAG staff must attend both parties. O'Brien's has another great jazz quartet playing, and is famous for "The Hurricane", a drink containing rum and a secret mix of fruits and spices. It's lethal, and guess what, there's enough of it to float the Queen Mary.
&lt;/p&gt;&lt;p&gt;
There are more parties to come. So, although we have the compensation of being able to learn more about what NAG users want in the way of fast numerical software, and finding out what our contemporaries are working on, the fact is, we've all got blisters on our feet from walking between the different parties.&lt;/p&gt;&lt;p&gt;It's a hard life. But someone's got to do it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-997904948573115980?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/997904948573115980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/its-hard-life.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/997904948573115980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/997904948573115980'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/its-hard-life.html' title='It&apos;s a hard life.'/><author><name>Mick Pont</name><uri>http://www.blogger.com/profile/15149585002054415615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_dCVG_bqZucY/S3P_R_bC7xI/AAAAAAAAADc/weuU-FRfQRk/S220/MrPont.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8187319155158457443</id><published>2010-11-11T10:59:00.003Z</published><updated>2010-11-11T11:09:15.735Z</updated><title type='text'>Looking forward to meeting people with new ideas at Supercomputing.</title><content type='html'>&lt;p&gt;
I’m someone who enjoys talking with people at exhibition booths and the International High Performance Computing event, which is being staged next week (&lt;a href="http://sc10.supercomputing.org/"&gt;http://sc10.supercomputing.org/&lt;/a&gt; ), will provide good opportunities.
&lt;p&gt;
Here is a chance to spend time with many current and future users of NAG products and services as well as with NAG collaborators. Attendees at this conference and exhibition work in such a variety of different areas that the conversations are always fascinating and informative.
&lt;p&gt;
Meeting with people face-to-face inevitably triggers more new ideas, and results in innovative solutions being created faster, than any electronic communication method.
&lt;p&gt;
I look forward to meeting some of you there (NAG have Booth #3131 – right at the heart of the main hall).
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8187319155158457443?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8187319155158457443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/looking-forward-to-meeting-people-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8187319155158457443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8187319155158457443'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/looking-forward-to-meeting-people-with.html' title='Looking forward to meeting people with new ideas at Supercomputing.'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2409240208707752202</id><published>2010-11-05T09:44:00.007Z</published><updated>2010-11-08T08:47:18.987Z</updated><title type='text'>Creative Programming</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm1.static.flickr.com/52/131160381_a355f43076.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 500px; height: 329px;" src="http://farm1.static.flickr.com/52/131160381_a355f43076.jpg" border="0" alt="" /&gt;&lt;/a&gt;

&lt;p&gt;
As I was being asked to write this blog post my brain awoke from
it's number crunching stupor and I realised that I couldn't think
of anything to write.  The past few hours of sitting, programming
in front of a computer seemed to have wiped out the artistic half
of my mind.
&lt;/p&gt;
&lt;p&gt;
I know at least for myself that staring at a monitor seems to
obliterate all of my thoughts until I've finished the click
clacking and click clicking of my current task and I can finally
put blessed ink to physical paper to plan my next step.
&lt;/p&gt;
&lt;p&gt;
So in order to re-enliven my thinking and my creativity, I sought a
nice picture of a stunning scene.  There's nothing like the beauty
of creation to awaken something deep in your heart.
&lt;/p&gt;
&lt;p&gt;
As I was quickly sketching the above picture to get the other half
of my brain warmed up to it's full creative potential, I started
wondering about creativity in programming.
&lt;/p&gt;
&lt;p&gt;
Firstly there is the beauty of the written code itself, the ideas
encapsulated within it and the intelligence of the design.
Secondly there is the created product of what the non-technical
viewer might see, such as a website, 3D artwork, mathematical art,
3D movies etc.
&lt;/p&gt;
&lt;p&gt;
There is creativity in all that we do, and no less in programming.
It is very satisfying to have finally cracked a problem
successfully, and even more so if you can look at the flow and
structure of your program and know that it is good and pleasing.
&lt;/p&gt;
&lt;p&gt;
But despite the beauty that can be found in computer generated
output or even in code (if you are able to comprehend it) I think I will always have to turn to a beautiful, fiery, ruby
red sunset, or the playful sound of a nearby splashing stream as a way of awakening my heart.
&lt;/p&gt;
(photo kindly contributed by Paul Wilson from his &lt;a href="http://www.flickr.com/photos/gonuke/131160381/#"&gt;flikr account&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2409240208707752202?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2409240208707752202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/11/creative-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2409240208707752202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2409240208707752202'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/11/creative-programming.html' title='Creative Programming'/><author><name>Nathaniel</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm1.static.flickr.com/52/131160381_a355f43076_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-6935518645691495801</id><published>2010-10-30T00:25:00.000+01:00</published><updated>2011-02-04T15:41:31.824Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><title type='text'>Comparing HPC across China, USA and Europe</title><content type='html'>In my &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/10/why-does-china-supercomputer-matter-to.html"&gt;earlier blog post today on China announcing the world's faster supercomputer&lt;/a&gt;, I said I'd be back with more later on the comparisons with the USA, Europe and others. In this morning's blog, I made the point that the world's fastest supercomputer, in itself, is not world changing. But leading supercomputers, &lt;i&gt;critically matched with appropriate expertise in programming and using them, togther with the vision to ensure use across basic research, industry and defence applications &lt;/i&gt;can indeed be strategically beneficial to a nation - including real economic impact.&lt;br /&gt;
&lt;br /&gt;
There are plenty of reports and studies describing the strategic impact of HPC within a given organisation or at national levels (some are &lt;a href="http://bit.ly/c6RC6J"&gt;catalogued by IDC here&lt;/a&gt;), so let's take it as a premise for the following thoughts.&lt;br /&gt;
&lt;br /&gt;
With this in mind, there are some comparisons to be made between the approaches to supercomputing across the USA, Europe and China.&lt;br /&gt;
&lt;br /&gt;
The USA has long enjoyed near total dominance of the hardware technology underlying the leading supercomputers. The USA has invested repeatedly in ensuring that American supercomputer manufacturers have the technology to deploy the world's largest supercomputers. The last time the USA lost the public leadership crown of fastest supercomputer, a huge investment in Amercian supercomputer technology followed. As well as national support for the development, the strong implicit requirement for USA organisations to "buy American" ensures a continued USA supercomputer manufacturing industry. As a result of the sheer size of the country, the USA has a large HPC R&amp;amp;D community. There is also significant usage of HPC in American industry and additional support for this through government initiatives like INCITE.&lt;br /&gt;
&lt;br /&gt;
Despite the recent growth of Bull, and their highly-rated supercomputers and in-house HPC expertise, Europe has not seen it essential to have a home-grown supercomputer manufacturing industry (beyond the component level R&amp;amp;D which is strong in Europe). Europe has always highlighted its expertise in applied HPC software development and in software-related HPC R&amp;amp;D as its distinguishing strength on the international stage. European organisations have always bought supercomputers from around the world - and since they are likely to continue to enjoy access to products from around the world, have no need to develop independent supply from wholly European sources.&lt;br /&gt;
&lt;br /&gt;
But the news of China's investment in hardware, software and people (and stated ambition of independence of supply) should make a &lt;b&gt;clear message to USA, Europe and others that they cannot rely on their continued leadership of HPC&lt;/b&gt;. And thus the economic benefits of &lt;i&gt;HPC might soon be driving Chinese growth rather than the European or American economies&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
There is one other potentially killer advantage that China might have. All the predictions of the path to the next levels of supercomputer performance (Exascale) involve major changes in the technology - much greater levels of parallelism (seeing this now with GPUs), memory performance challenegs, resilience, etc. As Dave Turek of IBM has said before, China is mostly not hindered by legacy code - they can start anew with the best HPC ideas and methods of today, looking to the future. In USA and Europe, our obsession with "protecting our investment" in established applications, means we first have to figure out how to get from yesterday's software technology to current methods, then to the future. &lt;b&gt;Is "protecting our investment" actually constraining our future?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;[More on legacy code and revolutions vs evolution in a blog coming here soon ...]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-6935518645691495801?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/6935518645691495801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/10/comparing-hpc-across-china-usa-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6935518645691495801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/6935518645691495801'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/10/comparing-hpc-across-china-usa-and.html' title='Comparing HPC across China, USA and Europe'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1835071680471343271</id><published>2010-10-29T12:16:00.002+01:00</published><updated>2011-02-04T15:41:31.826Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><title type='text'>Why does the China supercomputer matter to western governments?</title><content type='html'>There is a lot of fuss in the mainstream media (&lt;a href="http://bit.ly/diZGOX"&gt;BBC&lt;/a&gt;, &lt;a href="http://bit.ly/ddZz6o"&gt;FT&lt;/a&gt;, &lt;a href="http://bit.ly/dAkG5f"&gt;CNET&lt;/a&gt;, even the Daily Mail!) the last few days about the world's fastest supercomputer being in China for the first time. And much ado on &lt;a href="http://twitter.com/#search?q=%23supercomputer"&gt;Twitter &lt;/a&gt;(me too - &lt;a href="http://twitter.com/hpcnotes"&gt;@hpcnotes&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
But much of the mainstream reporting, twitter-fest, and blogging is missing the point I think. China deploying the world's fastest supercomputer &lt;i&gt;is &lt;/i&gt;news (the fastest supercomputer has almost always been American for decades, with the occasional Japanese crown). But the machine alone is not the big news.&lt;br /&gt;
&lt;br /&gt;
Imagine that China announced a new prototype passenger aircraft, half the cost of the latest Boeing or Airbus. It has 50% greater fuel efficiency too. And an order of magnitude greater predicted reliability statistics. That would be major news. Sure it uses a lot of US designed components too.&lt;br /&gt;
&lt;br /&gt;
But what if China announced this new aircraft wasn't just a prototype. It was a commercially available product now. And they have the capacity to make lots of them - faster than Boeing or Airbus. And they have a plan to train huge numbers of future aircraft maintenance engineers, aerodynamic designers, structural engineers, etc. In other words, China can not only build a world-beating passenger aircraft, but it is building the capability to do so without US designed components in the future. And it is building the expertise capacity to be a world leader in aircraft maintenance.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;That &lt;/i&gt;would be &lt;i&gt;very &lt;/i&gt;important.&lt;br /&gt;
&lt;br /&gt;
And, while we are not quite there yet, that is where this China supercomputer news is going. American scientists and HPC professionals have been calling for rounded investment in people and software not just hardware for years. Europe has been proud of it's relative HPC software expertise, but the recent&lt;a href="http://bit.ly/aOV27c"&gt; IDC led EU HPC strategic recommendations report&lt;/a&gt; shows that much more investment is needed.&lt;br /&gt;
&lt;br /&gt;
The mass commentary talks about the Chinese hardware milestone. But public material from Chinese experts also talks about a plan to deploy several top supercomputers, to train huge numbers of HPC programmers, to invest in applications development and commercial use of HPC and to develop end-to-end nationally independent supercomputing technology.&lt;br /&gt;
&lt;br /&gt;
If that happens, then China &lt;i&gt;will &lt;/i&gt;have the ability to develop that super aircraft industry. And automobile. And the many household products that are designed with supercomputers. And materials science. And ...&lt;br /&gt;
&lt;br /&gt;
Get the point? It's not the world's fastest supercomputer that matters most. It's not just national pride. &lt;b&gt;It's the ambition and comphrensive plan behind the world's leading supercomputer that matters.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;[More later today on the comparison with USA, EU and others]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1835071680471343271?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1835071680471343271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/10/why-does-china-supercomputer-matter-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1835071680471343271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1835071680471343271'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/10/why-does-china-supercomputer-matter-to.html' title='Why does the China supercomputer matter to western governments?'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-264718154301649836</id><published>2010-10-22T08:58:00.001+01:00</published><updated>2010-10-22T09:00:13.948+01:00</updated><title type='text'>Carbon Footprint</title><content type='html'>In these austere times I am always on the lookout for ways to reduce our expenditure without reducing our service to customers. NAG have just been awarded a matched funding grant from &lt;a href="http://www.sustainableroutes.co.uk/"&gt;http://www.sustainableroutes.co.uk/&lt;/a&gt; for £1000 to help us reduce our carbon footprint and we intend to use the grant (and some) to improve our video conferencing and cut down on some travelling costs and CO2 for meetings and training. Currently we are looking at some state of the art video conference equipment which we hope to start trialling with our Manchester office. There are some other useful tips and grants available on the Sustainable Routes website so I would recommend go taking a look.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-264718154301649836?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/264718154301649836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/10/in-these-austere-times-i-am-always-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/264718154301649836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/264718154301649836'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/10/in-these-austere-times-i-am-always-on.html' title='Carbon Footprint'/><author><name>Susan Shayler</name><uri>http://www.blogger.com/profile/06733162223866845760</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://3.bp.blogspot.com/_x0V4ZFGKjPg/S1RaB7WFtwI/AAAAAAAAAAU/mR3tWuUVE0s/S220/lakka_from_balcony.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5763534958460651589</id><published>2010-10-19T08:00:00.000+01:00</published><updated>2010-10-19T08:00:50.678+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Source-level debugging of Python in Emacs</title><content type='html'>To help me track problems in &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; code (yes, even sometimes in my own...) I usually rely on good-old print/trace debugging.
Owing to Python's speed of interpretation and execution, this is a pretty convenient approach. Python does have its own interactive debugger though—
&lt;a href="http://docs.python.org/library/pdb.html"&gt;pdb&lt;/a&gt;—for those odd occasions when it's desirable to poke about in a
program while it's running. The &lt;a href="http://www.emacswiki.org/emacs/GrandUnifiedDebugger"&gt;debugging mode in Emacs&lt;/a&gt; even supports &lt;tt&gt;pdb&lt;/tt&gt; by default, but
there's a little snag: you probably don't have a &lt;tt&gt;pdb&lt;/tt&gt; in your path, so &lt;tt&gt;M-x pdb&lt;/tt&gt; will just fail. Solution? Add a &lt;tt&gt;pdb&lt;/tt&gt; script to your path and make
it executable
&lt;br /&gt;
&lt;pre class="nag" style="font-size:75%"&gt;
&lt;font color="#ff0000"&gt;#&lt;/font&gt;&lt;font color="#ff0000"&gt;!/bin/&lt;/font&gt;&lt;font color="#a020f0"&gt;sh&lt;/font&gt;&lt;font color="#ff0000"&gt;
&lt;/font&gt;&lt;font color="#b8860b"&gt;pdb_path&lt;/font&gt;=&lt;font color="#ff00ff"&gt;`python -c "import pdb, sys; sys.stdout.write(pdb.__file__ + '\n')"`&lt;/font&gt;
&lt;font color="#a020f0"&gt;exec&lt;/font&gt; python ${&lt;font color="#b8860b"&gt;pdb_path&lt;/font&gt;} &lt;font color="#bc8f8f"&gt;"$@"&lt;/font&gt; 
&lt;/pre&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/_XkFBNMSZvw4/TL0_ZKd_mBI/AAAAAAAAABg/iSsrTDvyX_g/s1600/Screenshot-mathewc@glenlivet+-home-nag-tiree-mathewc-engine-tools-python-trac_reminder_report.py-1.png" imageanchor="1" style="margin-right: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="190" src="http://2.bp.blogspot.com/_XkFBNMSZvw4/TL0_ZKd_mBI/AAAAAAAAABg/iSsrTDvyX_g/s320/Screenshot-mathewc@glenlivet+-home-nag-tiree-mathewc-engine-tools-python-trac_reminder_report.py-1.png" width="320" /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5763534958460651589?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5763534958460651589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/10/source-level-debugging-of-python-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5763534958460651589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5763534958460651589'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/10/source-level-debugging-of-python-in.html' title='Source-level debugging of Python in Emacs'/><author><name>Mat Cross</name><uri>http://www.blogger.com/profile/08674286575878583286</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_XkFBNMSZvw4/S1QkCVO4sfI/AAAAAAAAAAM/TN9xiYVFZdU/S220/Mineress.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XkFBNMSZvw4/TL0_ZKd_mBI/AAAAAAAAABg/iSsrTDvyX_g/s72-c/Screenshot-mathewc@glenlivet+-home-nag-tiree-mathewc-engine-tools-python-trac_reminder_report.py-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5172904013310492873</id><published>2010-10-07T04:24:00.001+01:00</published><updated>2010-10-07T12:42:04.140+01:00</updated><title type='text'>2010: A Retail Store Odyssey</title><content type='html'>Stanley Kubrick’s film “2001: A Space Odyssey” was the epic 1968 science fiction film that explored human evolution, technology and artificial intelligence with both realism (and surrealism) and remains one of the top films of all time. In it, two astronauts battle the computer HAL for control of their spaceship and for their lives while investigating a series of strange monoliths left from an earlier civilization. For many years and for many people, the film has been symbolic of our struggle to master, and not be mastered by, computers. Kubrick and his co-author Sir Arthur C. Clark were both brilliant and far ahead of their time. In many respects, they still are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In 2010 we are certainly wrestling with computers that occasionally seem to get the better of us. In our world, computers are ubiquitous and the software behind them has a pervasive impact on our daily lives but hardly in the way Kubrick and Clark envisioned. Consider this absolutely mundane sequence of events, at least in the developed world. We hop into our car to go shopping for groceries. As we turn the key one or more microprocessors start, employing sophisticated software to optimize efficiency, performance and emissions. Our cars talk to us, connecting phone calls routed through a cellular network. They entertain us with hundreds of channels from a satellite radio connection and give us visual and voice directions to where we want to go. All of this amazing hardware comes to life through the software that makes it work. And, of course the software makes considerable use of mathematics to accomplish what it does for us. So, you may ask, what’s the reference to a “retail odyssey”? We haven’t even gotten to the grocery store yet.&lt;br /&gt;
&lt;br /&gt;
In my view, the most amazing thing at the Sainsbury I frequent in the UK or the Dominick’s near home isn’t the check out where they let me scan my items and coupons and pay with my credit card, all with a few taps of the touch-screen. It’s the realization that I’ve just walked through a store with literally thousands of unique items to meet my needs, each residing in a database linking the bar code on the package with a price, an inventory level, cost, supplier and even a “loyalty card” database that permits analysis of which shoppers bought which products and in which combinations. While you are pondering this miracle of modern technology, ponder this question: who set the price of the 2-pound package of Folgers coffee at the end of Aisle 2 and how did they do it?&lt;br /&gt;
&lt;br /&gt;
The answer, if it’s not already obvious, is sophisticated software from companies like NAG partner DemandTec (NASDAQ: DMAN) whose demand management software is helping retailers and manufacturers worldwide optimize revenues, prices and inventories. We’ve worked with DemandTec since 2004, providing them sophisticated mathematical and statistical software to enable their application to help retailers manage demand.&lt;br /&gt;
&lt;br /&gt;
One of the benefits of working with cutting edge companies like DemandTec is that we get to participate in events such as I have been involved with lately. NAG has partnered with DemandTec to sponsor the Chicago Regional scholarship competition in a national event called the DemandTec Retail Challenge. In it, high school seniors in teams of two get to apply their problem-solving and mathematical skills as pricing analysts managing an assortment of products in a grocery store. They set the price, order inventory and make decisions about promotions in a simulation-based competition with other teams in the Chicago area. The eventual winners will have maximized profitability and successfully communicated their approach to the problem to experts in the field. The winners earn a college scholarship and the right to compete in the national version of the contest at NASDAQ in New York City in January 2011. The national champions get a significant additional scholarship and the right to ring the closing bell for the trading day. For those of us at NAG it’s both a way of giving back to the community and helping the next generation apply their academic skills to real-world problems. From the conversations I’ve had with them thus far I suspect that the computer HAL would be no match for them.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5172904013310492873?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5172904013310492873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/10/2010-retail-store-odyssey.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5172904013310492873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5172904013310492873'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/10/2010-retail-store-odyssey.html' title='2010: A Retail Store Odyssey'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-252184980631449972</id><published>2010-09-30T12:02:00.000+01:00</published><updated>2010-09-30T12:02:52.732+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Matrix Exponential'/><category scheme='http://www.blogger.com/atom/ns#' term='Higham'/><category scheme='http://www.blogger.com/atom/ns#' term='differential equations'/><title type='text'>The Shoulders of Giants</title><content type='html'>Last week NAG held its 34th AGM and prior to the business part of the meeting we had the pleasure of hearing a lecture by &lt;a href="http://www.maths.manchester.ac.uk/~higham/"&gt;Professor Nick Higham&lt;/a&gt; of the University of Manchester on the subject &lt;em&gt;How and How Not to Compute the Exponential of a Matrix&lt;/em&gt;. The lecture was filmed and can be viewed &lt;a href="http://oxforddigital.tv/streaming/nag.php"&gt;here&lt;/a&gt;. Matrix functions are useful in a number of areas, in particular for describing the solutions of certain types of differential equations. NAG is working with Nick to include his algorithms in future marks of the Library. &lt;br /&gt;
&lt;br /&gt;
One of the things I particularly enjoyed about Nick's talk was the way that he set the subject in its proper historical context, starting with the work of 19th Century mathematicians such as Sylvester and Cayley. Working at the cutting edge of computing technology its easy to forget how much of what we do depends on work that goes back hundreds of years. It wasn't always this way: Fermat, having claimed to have found a proof of what became known as his last theorem, added the waspish comment "and perhaps, posterity will thank me for having shown it that the ancients did not know everything". &lt;br /&gt;
&lt;br /&gt;
A few years ago SIAM interviewed a number of prominent people who had been active in the early days of numerical analysis and scientific computing, including NAG's own Brian Ford. You can find transcripts of the interviews and related material on &lt;a href="http://history.siam.org/"&gt;SIAM's website&lt;/a&gt;. Reading these transcripts is illuminating, particularly to a (relative) youngster like me, especially given the number of references to NAG's early history that they contain. I hope that SIAM keeps up this activity, and continues to collect personal reminiscences from prominent people in the field.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-252184980631449972?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/252184980631449972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/09/shoulders-of-giants.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/252184980631449972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/252184980631449972'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/09/shoulders-of-giants.html' title='The Shoulders of Giants'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-535565048282742927</id><published>2010-09-23T10:06:00.002+01:00</published><updated>2011-05-28T19:15:22.999+01:00</updated><title type='text'>HTML5: Possible implications for technical documentation</title><content type='html'>&lt;h3&gt;A New Version of HTML&lt;/h3&gt;
&lt;p&gt;As you may have heard, HTML5, a new version of HTML, the main
markup language for the web is under development. This is the first
version for quite some time, &lt;a
href="http://www.w3.org/TR/html401/"&gt;HTML4.01&lt;/a&gt;, the current
version, was released in December, 1999. There was an XML version, &lt;a
href="http://www.w3.org/TR/xhtml1/"&gt;XHTML 1.0&lt;/a&gt;, XHTML (Released in January
2000 and revised August 2002), but it did not contain any new
features.&lt;/p&gt;
&lt;p&gt;Much of the buzz around HTML5 concentrates on new features such as
video (as an alternative to using flash plugins etc) and canvas (a
JavaScript API for 2 dimensional graphics), but in this article I want
to look at the features that impact on the kind of technical,
mathematical documents used by NAG.&lt;/p&gt;

&lt;h3&gt;SVG and MathML&lt;/h3&gt; &lt;p&gt;&lt;a href="http://www.w3.org/TR/SVG/"&gt;SVG&lt;/a&gt;
is an XML format for describing scalar graphics, using a similar
graphics model to PostScript or PDF, but using XML syntax and CSS for
styling, just as for HTML. It has been around for some years, but
HTML5, for the first time, specifies how it works in the context of
HTML (rather than XML). In a related move, Internet Explorer 9 will
support SVG. (Other common browsers have supported it for some
years.)&lt;/p&gt; &lt;p&gt;Many of the function plots in the NAG documentation are
generated from &lt;a href="http://www.gnuplot.info/"&gt;gnuplot&lt;/a&gt;. Gnuplot
can save to SVG as well as the EPS and PNG outputs that we currently
use. Also the remaining diagrams are currently stored as EPS (for use
in PDF versions of the document) and EPS can usually be converted
without any loss of information to SVG.&lt;/p&gt;

&lt;p&gt;There are many advantages to using a scalable format for plots,
especially documents that are read on smaller devices such as tablets (or
phones), but also printing at higher resolution; being able to
scale and zoom in as required without the loss of quality inherent in
scaling bitmap images is a big win.&lt;/p&gt;

&lt;p&gt;The other XML-derived language supported natively by the HTML5
parser is &lt;a href="http://www.w3.org/TR/MathML/"&gt;MathML&lt;/a&gt;.  MathML
should be familiar to most NAG users as it has been used in the XHTML
version of our documentation for years. However being able to use
MathML in HTML should hopefully simplify the installation of this
documentation, and also the prominence given to MathML by its
inclusion in HTML5 will also hopefully encourage the remaining browser
vendors, who do not natively support it, to implement mathematics
rendering in their browsers.&lt;/p&gt;

&lt;h3&gt;Current State of (Future) Browsers&lt;/h3&gt; &lt;p&gt;All the common desktop
browsers are moving towards supporting HTML5 in the near future. The
following sections list the state of SVG and MathML rendering in some
common cases.&lt;/p&gt;

&lt;h4&gt;Internet Explorer 9 Beta&lt;/h4&gt;

 &lt;p&gt;IE 9 finally adds SVG support to Microsoft's Internet Explorer
 browser. Design Science's &lt;a
 href="http://www.dessci.com/en/products/mathplayer/"&gt;MathPlayer&lt;/a&gt;
 may still be used to get very high quality rendering of MathML. There
 are currently some problems in interfacing MathPlayer and IE 9, and
 some of the markup that worked in IE 8 no longer works, however this
 may be fixed before the full product comes out, or a few lines of
 IE-specific javascript, as used in the example below, may be used to
 work around the main problems.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Warning: &lt;/b&gt;IE 9 Beta, unlike all the other test releases of
browsers mentioned here will &lt;em&gt;replace&lt;/em&gt; your existing Internet
Explorer installation. If you wish to test IE 9 rendering without
removing your IE 8 (or earlier) installation make sure that you install
the &lt;em&gt;Platform Preview&lt;/em&gt; rather than the &lt;em&gt;Beta&lt;/em&gt;. The
platform preview releases use the IE 9 rendering engine but without
all the normal browser menus and facilities, and it does not replace
your existing browser.&lt;/p&gt;
&lt;p&gt;IE 9 Beta 1 was tested.&lt;/p&gt;

&lt;h4&gt;Firefox 4.0 Beta&lt;/h4&gt;
&lt;p&gt;Firefox 4 uses the new HTML5 parser which automatically places MathML
elements in the MathML namespace and SVG elements in the SVG
namespace. The rendering of MathML and SVG in HTML 5 is then
essentially exactly as has been available in earlier Firefox releases
in XHTML documents, but now also available in HTML.&lt;/p&gt;
&lt;p&gt;Firefox 4 Beta 6 was tested.&lt;/p&gt;

&lt;h4&gt;WebKit Nightlies&lt;/h4&gt;
A &lt;em&gt;Nightly&lt;/em&gt; release is a public binary release that is essentially
just a snapshot of the current development build. As such it is
expected to have bugs and unimplemented features. However these
releases, which show the development state of the core rendering
engine used by both Chrome and Safari browsers show that it has a
reasonably well developed SVG renderer, and that MathML support, while
very new, is improving. (These WebKit browsers have very good CSS
support so until the native MathML is ready for use it will probably
be possible to use a CSS rendering of MathML in these cases, as is
done for the current NAG XHTML documentation).
&lt;p&gt;WebKit-r67637, from 16th September was tested.&lt;/p&gt;

&lt;h3&gt;An Example&lt;/h3&gt;
&lt;p&gt;We do not yet have any definite plans or dates to move towards
using HTML5, it depends a lot on the timing of the above test releases
becoming mainstream (which is likely to be very soon)  and how long it
takes for use of older browsers to die out. (This can take a long time,
many people only change their browser when they get a new machine,
Internet Explorer 6 (released in 2001 and replaced by IE 7 in 2006 and
IE 8 in 2009) is still in widespread use for example.)&lt;/p&gt;
&lt;p&gt;As an experiment we have converted one example routine document
into HTML5, using inline MathML and SVG. Note in the example all links
to external documents have been made to point back to the test
document so that it is self-standing. The document has 207 MathML
fragments, which are essentially unchanged from the existing
XHTML+MathML version of the document, the two plots shown in the
example section, which were previously only available as monochrome
scalable images in the PDF version of the document, or a coloured PNG
bitmaps in the XHTML version, are provided as scalable SVG which is
directly included into the HTML file, not referenced using
&lt;code&gt;&amp;lt;img src=...&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The document is reported as valid HTML5+SVGMathML by the
&lt;a href="http://validator.nu"&gt;validator.nu&lt;/a&gt; online validator.&lt;/p&gt;
&lt;p&gt;The document appears to be perfectly usable in Firefox 4 and
IE 9. The MathML support in WebKit is still very new, and there also
appear to be some problems with the SVG which get rendered with a
black background in the Windows nightly build of 16th September. Note
however that, as their name suggests nightly builds are unstable test
releases and should not be taken as indicative of the final product.
The fact that the SVG was fully rendered apart from some colour
problems, and that the MathML was recognized, albeit with some
rendering problems, is I think a good sign that WebKit based browsers
(Safari, Chrome, and many mobile phone browsers) will support these documents in the near future.&lt;/p&gt;


&lt;table border="1"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th colspan="3"&gt;Fortran Library Mark 22 Routine Document (D02AGF)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;XHML+PNG+MathML&lt;/th&gt;
&lt;td&gt;Mark 22 Documentation&lt;/td&gt;
&lt;td style="padding: 1em 1em 1em 1em"&gt;&lt;a
href="http://www.nag.co.uk/numeric/fl/nagdoc_fl22/XHTML/D02/d02agf.xml"&gt;d02agf.xml&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;PDF&lt;/th&gt;
&lt;td&gt;Mark 22 Documentation&lt;/td&gt;&lt;td  style="padding: 1em 1em 1em 1em"&gt;&lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl22/PDF/D02/d02agf.pdf"&gt;d02agf.pdf&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;HTML5+SVG+MathML&lt;/th&gt;
&lt;td&gt;Experimental&lt;/td&gt;
&lt;td  style="padding: 1em 1em 1em 1em"&gt;&lt;a href="http://monet.nag.co.uk/blog_files/d02agf.html"&gt;d02agf.html&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;Conclusions&lt;/h3&gt;
&lt;p&gt;HTML5 will be mainstream in currently popular browsers very soon,
it will take a few years before its use may be assumed, but it
promises to be a big improvement for technical documents.&lt;/p&gt;
&lt;p&gt;Both MathML and SVG allow the use of scalable formats freeing the
web from the use of inappropriate bitmap images. This simplifies
document distribution and should improve the quality both for printing
and for use on a wider range of devices, including greatly increased
accessibility.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-535565048282742927?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/535565048282742927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/09/html5-possible-implications-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/535565048282742927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/535565048282742927'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/09/html5-possible-implications-for.html' title='HTML5: Possible implications for technical documentation'/><author><name>David Carlisle</name><uri>https://profiles.google.com/107847268022850354754</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-5fp4icqY6kI/AAAAAAAAAAI/AAAAAAAAAAA/iRCXBm3Y1Fo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4794139514547381740</id><published>2010-09-13T13:41:00.000+01:00</published><updated>2011-02-04T15:41:31.828Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><title type='text'>Do you want ice with your supercomputer?</title><content type='html'>“&lt;i&gt;Would you like ice with your drink?&lt;/i&gt;” It’s a common question of course. One that divides people – few will think “&lt;i&gt;I don’t mind&lt;/i&gt;” – most have a firm preference one way or the other. There are people who hate ice with their drink and those who freak if there is none. National stereotypes have a role to play – in the USA the question is not always asked – it’s assumed you want ice with everything. In the UK, you often have to ask specifically to get ice.&lt;br /&gt;
&lt;br /&gt;
Yet the role of ice in making our drinks chilled is misleading. I once had a discussion with a leading American member of the international HPC community about this. “&lt;i&gt;No ice&lt;/i&gt;”, he was complaining as we headed out of a European country, “&lt;i&gt;they had no ice for the drink&lt;/i&gt;”.&lt;br /&gt;
&lt;br /&gt;
“&lt;i&gt;I don’t get this obsession with ice&lt;/i&gt;”, I chipped in. “&lt;i&gt;What?!&lt;/i&gt;” He looked at me as if I were mad. “&lt;i&gt;Why do you like your coke warm?&lt;/i&gt;”&lt;br /&gt;
&lt;br /&gt;
“&lt;i&gt;Ah, but that’s just it&lt;/i&gt;”, I replied. “&lt;i&gt;I hate warm drinks – I really like my coke chilled. But surely, in this modern world over a century after the invention of the refrigerator, it’s not unreasonable to expect the fluid to be chilled – without the need to drop lumps of solid water into it?&lt;/i&gt;”&lt;br /&gt;
&lt;br /&gt;
“&lt;i&gt;Ah, fair point&lt;/i&gt;”, he conceded.&lt;br /&gt;
&lt;br /&gt;
What has this got to do with supercomputing? Perhaps the common thread is that usually we just accept the habitual choices of ways to do things – and don’t often step back to think – “&lt;i&gt;are those the only choices?&lt;/i&gt;” &lt;br /&gt;
&lt;br /&gt;
Maybe we should step back a little more often and ask ourselves what we are trying to achieve with HPC – and are the usual choices the only ways forward? Or are there different ways to approach the problem that will deliver simpler, better or cheaper performance? &lt;br /&gt;
&lt;br /&gt;
Perhaps your business/research goals mean you need to conduct more complex modelling or you need faster performance. Maybe the drive of computing technology towards many-core processors rather than faster processors is limiting your ability to achieve this. (I have had several conversations recently, where companies are buying older technology because their software won’t run on multicore).&lt;br /&gt;
&lt;br /&gt;
The “ice or no ice” question might be whether or not to upgrade your HPC with the latest multicore processors. But what about the “just chill the fluid” option? Well, how about upgrading the software instead, or as well? &lt;br /&gt;
&lt;br /&gt;
NAG has plenty of case studies to show where enhancements to software have achieved huge gains in performance or capability (e.g., &lt;a href="http://www.hector.ac.uk/cse/reports"&gt;www.hector.ac.uk/cse/reports&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Sometimes buying more compute power is the right answer. Sometimes, extracting more efficient performance from what you have is the answer. Bringing them together - a balance of hardware upgrades and software innovations might well give you the best chance of optimising cost efficiency, performance and sustainability of performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4794139514547381740?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4794139514547381740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/09/do-you-want-ice-with-your-supercomputer.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4794139514547381740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4794139514547381740'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/09/do-you-want-ice-with-your-supercomputer.html' title='Do you want ice with your supercomputer?'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8018760405094312410</id><published>2010-09-08T16:37:00.034+01:00</published><updated>2010-11-24T16:32:15.033Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='research'/><category scheme='http://www.blogger.com/atom/ns#' term='web services'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Working on the ADVISE project</title><content type='html'>&lt;p&gt;For the past three and a half years, my colleagues and I have been working on &lt;a href="http://www.nag.co.uk/advise/"&gt;ADVISE&lt;/a&gt;, a &lt;a href="http://www.innovateuk.org/"&gt;TSB-funded&lt;/a&gt; collaborative research project which has been developing a new toolkit for visualization and analysis.  Besides &lt;a href="http://www.nag.co.uk/"&gt;NAG&lt;/a&gt;, the partners in the project were &lt;a href="http://www.vsni.co.uk/"&gt;VSNi &lt;/a&gt;and the &lt;a href="http://www.engineering.leeds.ac.uk/comp/"&gt;University of Leeds&lt;/a&gt;.  VSNi have expertise in statistics, as implemented in their &lt;a href="http://www.vsni.co.uk/software/genstat/"&gt;GenStat &lt;/a&gt;product, while Leeds have an international reputation for their &lt;a href="http://www.comp.leeds.ac.uk/vvr/"&gt;work in visualization research&lt;/a&gt;.  As for NAG, we've had some success with &lt;a href="http://www.nag.co.uk/welcome_iec.asp"&gt;IRIS Explorer&lt;/a&gt;, a popular visualization toolkit which allows users to construct applications by connecting modules together via a visual programming interface.&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TIkcxHKcQ6I/AAAAAAAAABo/z9Utvz2PYYs/s1600/pipeline.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5514970848753894306" src="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TIkcxHKcQ6I/AAAAAAAAABo/z9Utvz2PYYs/s400/pipeline.jpg" style="cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 1.  The ADVISE pipeline builder&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;We retained that interface in ADVISE (see Figure 1) because it has proved to be a rather intuitive way to create, modify and interact with applications.  Thus, in this figure, the user selects modules from the repository on the right and connects them together in the area on the left.  The widgets for controlling one of the modules are in the pane on the right at the bottom, whilst messages from the system are displayed in the area at top right.&lt;/p&gt;

&lt;p&gt;In a similar spirit of &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/03/extending-imitating-and-collaborating_18.html"&gt;re-use&lt;/a&gt;, the visualization and analysis functionality encapsulated within the ADVISE modules has come from porting just about all of the modules from IRIS Explorer into the new environment, and creating new modules that generate and process scripts of GenStat commands.  We've used ADVISE to visualize and analyze a variety of data - see, for example, Figure 2, which is a display of some of the results from &lt;a href="http://www.comp.leeds.ac.uk/ceg/"&gt;Christoper Goodyer&lt;/a&gt;'s simulations of diffusion through skin.&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_NFq6A7hoc_Y/TIpP8tm-AbI/AAAAAAAAABw/wH35sWfFCtE/s1600/tissue.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5515308598122381746" src="http://1.bp.blogspot.com/_NFq6A7hoc_Y/TIpP8tm-AbI/AAAAAAAAABw/wH35sWfFCtE/s400/tissue.jpg" style="cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 2.  Visualization produced by the final module in the pipeline of Figure 1&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;So much for the re-use of old technology, but what's new in ADVISE?  Well, its architecture makes use of recent technology developments in web services and distributed computing. This has several advantages, including the fact that it's easier to integrate applications built using ADVISE with the web (for example, running inside a browser), and that it's possible to connect ADVISE applications to other services (which could, for example, act as data sources).&lt;/p&gt;

&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TIpb-V6inyI/AAAAAAAAAB4/eYPoKZcr19k/s1600/webinterface.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5515321820261293858" src="http://4.bp.blogspot.com/_NFq6A7hoc_Y/TIpb-V6inyI/AAAAAAAAAB4/eYPoKZcr19k/s400/webinterface.jpg" style="cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 300px;" /&gt;&lt;span style="font-size: 85%;"&gt;Figure 3.  Using ADVISE to create a browser-based visualization of air quality data&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;p&gt;To illustrate this ease of integration, Figure 3 shows a web-based application that's been created in ADVISE for the visualization of air-quality data.  The window at the back shows the interface for selecting the location and duration of the data to be visualized, the next window shows that data displayed as a coloured elevated surface and the window in front shows the same data displayed as a 3D histogram.  Widgets in the web page (linked to ADVISE modules) give the user a simple interface to the application - for example, allowing control over the type of display (surface or histogram), other parameters associated with the visualization, and selection of the next dataset to be displayed.&lt;/p&gt;

&lt;p&gt;If you want to know more about the ADVISE project, or the system we produced, head over to our &lt;a href="http://www.nag.co.uk/advise/"&gt;web page&lt;/a&gt;, which contains more pictures of visualizations created with the toolkit together with papers, posters and talk slides from throughout the life of the project.  One picture you won't find over there, however, is the one below, which shows the whole ADVISE team (with the exception of Jungwook Seo and Colin Myers from Leeds) in all their glory at the end of the final project review meeting last month.  There were (a lot of) other pictures taken at the same event, but this is the only one in which the project members aren't holding glasses.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/numericalalgorithmsgroup/4926596396/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 240px; height: 180px;" src="http://farm5.static.flickr.com/4098/4926596396_56859832b9_m.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8018760405094312410?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8018760405094312410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/09/working-on-advise-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8018760405094312410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8018760405094312410'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/09/working-on-advise-project.html' title='Working on the ADVISE project'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NFq6A7hoc_Y/TIkcxHKcQ6I/AAAAAAAAABo/z9Utvz2PYYs/s72-c/pipeline.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1961103886327348175</id><published>2010-08-27T15:10:00.011+01:00</published><updated>2010-08-31T14:48:47.277+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematical Finance'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='new york'/><category scheme='http://www.blogger.com/atom/ns#' term='quant congress'/><title type='text'>NAG at Quant Congress, New York</title><content type='html'>&lt;a href="http://www.flickr.com/photos/numericalalgorithmsgroup/4922942633/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://farm5.static.flickr.com/4095/4922942633_ff91b68371_m.jpg" style="cursor: hand; float: right; height: 240px; margin: 0px 0px 10px 10px; width: 180px;" /&gt;&lt;/a&gt;&lt;p&gt;Last month I was in New York with my sales colleagues Mike Modica and Rick Guido from NAG's US office, attending &lt;a href="http://web.incisive-events.com/rma/2009/07/quant-congress-usa/index.html"&gt;Quant Congress USA&lt;/a&gt;. This is a meeting which is devoted to the latest developments in financial derivatives, risk management and the associated use of numerical techniques; NAG has been associated with it for the past five years because our software has found extensive use in the quantitative analysis community. Each day of the conference program opened with a plenary session of two presentations, followed by around twenty talks divided across two streams. The meeting had nearly a hundred attendees, not all of whom attended both days (perhaps it's worth noting that, whilst the technical program undoubtedly had its own attractions and merits, the attendance might have been enhanced still further by the fact that the two days of the meeting saw heavy rain fall on the city - in the middle of an otherwise-sweltering week). NAG was one of five exhibitors at the meeting, and we found that the relatively small size of the event meant that everyone who wanted to view our stand - almost exclusively during the breaks from the talks - was able to.&lt;/p&gt;

&lt;p&gt;We were kept busy by a steady stream of stand visitors throughout the event, which made for an interesting couple of days. Most of the queries and comments we received were focussed on technical queries about the &lt;a href="http://www.nag.co.uk/numeric/CL/nagdoc_cl09/html/FRONTMATTER/manconts.html"&gt;functionality of the NAG libraries&lt;/a&gt;, with a particular interest, of course, in those routines which have &lt;a href="http://www.nag.co.uk/main_finance.asp"&gt;proved valuable in the finance industry&lt;/a&gt;. There was also a lot of interest in the work that NAG has been doing on &lt;a href="http://www.nag.co.uk/numeric/gpus/"&gt;numerical routines for GPUs&lt;/a&gt;, partly because of the speedup that has been observed by customers when running Monte Carlo simulations on GPUs - as compared to running on a single CPU - using NAG routines (see &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/07/nag-is-company-that-likes-to-be-present.html"&gt;this post&lt;/a&gt; for more details).&lt;/p&gt;


&lt;p&gt;We also had a lot of questions about the &lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;NAG Toolbox &lt;i&gt;for MATLAB&lt;/i&gt;&lt;/a&gt;&lt;sup&gt;&lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;®&lt;/a&gt;&lt;/sup&gt;, while some users - or prospective users - were interested in being able to call NAG routines &lt;a href="http://www.nag.co.uk/python.asp"&gt;from within Python&lt;/a&gt;. I had an interesting discussion on this latter topic with &lt;a href="http://www.stanford.edu/~allison/"&gt;Professor Dennis Allison&lt;/a&gt; (who is famous for, amongst other things, being one of the founders of &lt;a href="http://en.wikipedia.org/wiki/Dr._Dobb's_Journal"&gt;Dr Dobb's Journal&lt;/a&gt;).  I found that providing answers to a few of the most technical queries about numerics in quantitative finance was somewhat beyond my abilities, notwithstanding the recent education I'd received in some aspects of this field from my colleague &lt;a href="http://www.blogger.com/profile/18261558624689201066"&gt;Marcin Krzysztofik&lt;/a&gt; (and our &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/03/extending-imitating-and-collaborating_18.html"&gt;collaborations&lt;/a&gt; involving the NAG option pricing routines), but we were able to deal with all outstanding issues by email within a few days of the conference's end.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/numericalalgorithmsgroup/4922943407/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://farm5.static.flickr.com/4077/4922943407_4e8f638a53_m.jpg" style="text-align: left;cursor: pointer; display: block; height: 180px; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; width: 240px; " /&gt;&lt;/a&gt;

&lt;p&gt;Whilst in New York, we also made a series of site visits, mainly in the financial sector. During one of these, I was told by the customer that they thought the technical support which they received from NAG was excellent - in fact, they said it was often better than what they received from their own in-house team. Since the support service is one of the things that NAG prides itself on (and which the customer pays for), this was good to hear, particularly as I felt it made up for some less gratifying - but still memorable - experiences I'd had earlier in the trip. These included celebrating my arrival in the city by falling off a barstool - apparently without any provocation at all (apart from the fact that the barroom singer was playing a cover of &lt;a href="http://en.wikipedia.org/wiki/Tom_Petty"&gt;Tom Petty&lt;/a&gt;'s "&lt;a href="http://open.spotify.com/track/5GicVH0OTGMTR5bwYoXDwo"&gt;Free Fallin'&lt;/a&gt;" at the time). Any damage that my self-esteem may have suffered was, however, assuaged by the (re)discovery of &lt;a href="http://www.jeremysalehouse.com/"&gt;this bar&lt;/a&gt;. Always nice to be &lt;a href="http://en.wikipedia.org/wiki/Theme_from_Cheers_(Where_Everybody_Knows_Your_Name)"&gt;where everybody knows your name&lt;/a&gt;, I think.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1961103886327348175?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1961103886327348175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/08/nag-at-quant-congress-new-york.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1961103886327348175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1961103886327348175'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/08/nag-at-quant-congress-new-york.html' title='NAG at Quant Congress, New York'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm5.static.flickr.com/4095/4922942633_ff91b68371_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3514014297642110803</id><published>2010-08-26T14:50:00.003+01:00</published><updated>2010-08-26T15:48:01.954+01:00</updated><title type='text'>Why quality has always been essential for NAG’s own internal process (and a holiday).</title><content type='html'>Quality is one of the things that matters a lot to our users. &lt;br /&gt;
&lt;br /&gt;
That is certainly true, but another reality is that the NAG Library could not exist at all without the checks and tests that result in the best quality software. The NAG Library is particularly complex and involves many different people doing very different types of task and activities. The Library is created from intricate actions including:&lt;br /&gt;
&lt;br /&gt;
- Investigating lots of numerical problems and potential approaches and solutions&lt;br /&gt;
- Designing hundreds of methods for the various chapters&lt;br /&gt;
- Producing example code, data and plots&lt;br /&gt;
- Creating installer and user notes&lt;br /&gt;
- Writing the detailed documentation and descriptions of routines&lt;br /&gt;
- Building the multiple different processor and compiler implementations of the Library&lt;br /&gt;
- etc…&lt;br /&gt;
&lt;br /&gt;
The best approach to quality is essential, in making the NAG Library, precisely because it is this multifaceted combination of numerical mathematics, software engineering and evolved process. If it were not for the quality checks, at all points through the product organization, it would be impossible to get all the bits to mesh and work together.&lt;br /&gt;
&lt;em&gt;NAG learnt this fact many, many years ago!&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
NAG quality methods are continuously scrutinised because of this internal need, as much as for users. Levels of peer review of documentation are increased, as new expert knowledge come to the fore. The frequency of automated implementation testing carried out during the development process is escalated, as the availability of test platforms increases. And so on.&lt;br /&gt;
&lt;br /&gt;
The results are self-evident. The quality and reliability of the Library never falters, even as new content is added and further software environments are supported. The NAG quality process benefits all parties.&lt;br /&gt;
On a much lighter note I’ve just returned from our family holiday. I, my wife and our three young children flew to Athens, stayed for 3 days to revise the history, and then moved, about 100 nautical miles by ferry, to an island to explore and relax on beautiful beaches... &lt;br /&gt;
&lt;br /&gt;
…in summary the vacation was made up of different sections, and was enjoyed by all five of us, because of the quality and detail that went into the planning and booking. Perhaps it was also made easier since we are all hardened travellers.&lt;br /&gt;
&lt;br /&gt;
This leaves me with a question, both for people and organisations&lt;br /&gt;
– ‘Can we all manage just as well with a top quality process but only limited experience?’&lt;br /&gt;
&lt;br /&gt;
I’d be interested to hear your view…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3514014297642110803?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3514014297642110803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/08/why-quality-has-always-been-essential.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3514014297642110803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3514014297642110803'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/08/why-quality-has-always-been-essential.html' title='Why quality has always been essential for NAG’s own internal process (and a holiday).'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1307236255854679821</id><published>2010-08-20T11:07:00.000+01:00</published><updated>2010-08-20T11:07:04.438+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='descriptions'/><category scheme='http://www.blogger.com/atom/ns#' term='c library'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran'/><category scheme='http://www.blogger.com/atom/ns#' term='routine names'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithm Design'/><category scheme='http://www.blogger.com/atom/ns#' term='algol 60'/><title type='text'>What's in a Name?</title><content type='html'>Newcomers to NAG often ask about the names of NAG routines. Certainly the names appear strange and unfamiliar at first, but to many NAG users the name encapsulates the heritage of quality and precision offered by NAG. &lt;br /&gt;
&lt;br /&gt;
Originally the NAG Libraries were created by contributors from U.K. academia. Some of these wrote in Algol 60 and others in Fortran. It was agreed to have two libraries of identical content, so that every contribution in one language had a counterpart in the other. Thus both communities were appeased. Early printed documentation included both language versions. &lt;br /&gt;
&lt;br /&gt;
It was clearly desirable to be able to distinguish one language version of an algorithm from the same algorithm implemented in the alternate language and in general this is still desirable if a single program needs to call both instances of the algorithm. &lt;br /&gt;
&lt;br /&gt;
Equally the early developers saw that, as new algorithms were developed, replacement routines would be required with perhaps different calling sequences, so that any naming scheme chosen needed to accommodate the ongoing development of the libraries. Another desirable feature would be to naturally group by name routines that lay in the same field of numerical computation. &lt;br /&gt;
&lt;br /&gt;
With these goals in mind the founders of NAG considered two lines of approach. &lt;br /&gt;
&lt;br /&gt;
The first idea looked at the concept of 'meaningful' names, names which might convey the algorithm being used or the problem addressed. Even today this is difficult, but in the early 1970s standard Fortran did not permit more than 6 characters for any routine name. And NAG certainly did not want to have Fortran and Algol names so radically different from each other that the algorithmic connection was obscured. The problem of updating also needed to be solved. &lt;br /&gt;
&lt;br /&gt;
The alternative looked much more appealing. At that time a &lt;a href="http://portal.acm.org/citation.cfm?id=1053198"&gt;modified SHARE classification system had been published&lt;/a&gt;&amp;nbsp;and NAG decided to base its routine names on that. This gave rise to the names we now see. Each name is 6 characters long, the final letter denoting the language of implementation. In those days 'F' denoted Fortran and 'A' denoted Algol 60. Subsequently this would be extended as NAG produced both single and double precision libraries in Fortran and as NAG produced other language versions such as C. The first characters, generally the first 3, indicated the broad subject ( or chapter) area to which the algorithm belonged. (Characters in positions 2 and 3 are always digits.) Thus E04WDF is a routine in the FORTRAN Library that lies in the E04 chapter. This chapter deals with 'Minimizing or Maximizing a Function'. The letters 'WD' uniquely identify the algorithm. &lt;br /&gt;
&lt;br /&gt;
Of course modern Fortran no longer has a restriction of only 6 characters for routine names and so it is perhaps worthwhile to consider whether the NAG naming scheme can usefully take advantage of this relaxation. &lt;br /&gt;
&lt;br /&gt;
The debate rages within NAG. Certainly the old problems remain if we wish to have 'meaningful' names, since routines will change with time. Do we describe the problem to be tackled or the algorithm used? If the former then NAG may wish to offer several techniques. In the C06 chapter we offer both Weeks' and Crump's method for Inverse Laplace transforms for example. Problem addressed is evidently not enough to uniquely identify an algorithm. Description of the routine by algorithm alone falls down heavily in the optimisation chapter where 'Sequential Quadratic Programming' and 'Quasi-Newton' and 'Modified-Newton' account for the vast majority of routines. We are thus led towards a combination of the two. &lt;br /&gt;
&lt;br /&gt;
Looking in detail at the effect of combining problem and method into a meaningful name we rapidly encounter the very powerful and flexible routines of the NAG optimisation chapter. Here one routine often addresses several related, but different, problems and has both sparse and dense counterparts. Long names might indeed become very long if they are to convey any useful meaning and not deceive. &lt;br /&gt;
&lt;br /&gt;
We see an early attempt by NAG to provide long, meaningful, names in its C Library. Users will be familiar with nag_opt_lin_lsq to denote the C routine e04ncc. This routine also solves convex qp problems, something the reader would not deduce from this name, yet this is probably its most important role. &lt;br /&gt;
&lt;br /&gt;
Proponents of meaningful long names argue that the solution to this is to have separate routines with only a single purpose. Their opponents argue that it is easy for users to effectively choose their own names for routines, given the variety of options open to them: pre-processors, wrappers and aliasing for example. &lt;br /&gt;
&lt;br /&gt;
What do you think? How many characters in a long name would you tolerate and how would you name NAG routines?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1307236255854679821?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1307236255854679821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/08/whats-in-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1307236255854679821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1307236255854679821'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/08/whats-in-name.html' title='What&apos;s in a Name?'/><author><name>David Sayers</name><uri>http://www.blogger.com/profile/11446316089087178932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3899531556464749881</id><published>2010-08-18T09:48:00.005+01:00</published><updated>2010-08-18T10:40:28.291+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life numerical analyst'/><title type='text'>A day in the life of...</title><content type='html'>... a Numerical Analyst:
&lt;p&gt;
Wow, this could be fairly boring, but here goes...
&lt;/p&gt;
&lt;p&gt;
I arrive at my desk, slightly dishevelled from my daily cycle to
work, whip my laptop out of the draw and unhibernate my old
faithful friend.  He and I have had some ups and downs over the
past year but I am happy to say that we are still on good terms.
&lt;/p&gt;
&lt;p&gt;
Having gone through the usual email checking routine, I ssh
(remotely logon) onto one of the local linux work servers, to pick
up from where I finished the day before.
&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X2mE_OFuKSA/TGumXyWGXzI/AAAAAAAAAAw/XPsNrwoeJLo/s1600/working_small.png"&gt;&lt;img style="display: block; margin: 0px; text-align: center; cursor: pointer; width: 480px; height: 300px;" src="http://3.bp.blogspot.com/_X2mE_OFuKSA/TGumXyWGXzI/AAAAAAAAAAw/XPsNrwoeJLo/s1600/working_small.png" alt="" border="0" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
And then it's on to slogging at the current routine, improving it's
accuracy or speed, checking it works properly, documenting the
code, screaming (under my breath) in frustration at the latest
problem, or quickly writing a blog post to give my mind a break
from the overflows and &lt;a href="http://baetzler.de/humor/tenne-c.html"&gt;NaN's&lt;/a&gt; (think they are grandmas? Think
again) of the numererical analyst's life.
&lt;/p&gt;
&lt;p&gt;
But it's not all slog. One of the highlights for me, is in the
cracking of problems. The simple answers, and the not so simple
answers that when found, bring a smile of victory to the lips.
Another highlight is in automating repetetive tasks, and
creating/finding useful tools to speed up the work cycle.  As I
read in a magazine a while back, that if you do something a few times,
it's worth making a quick tool to do the job for you.
&lt;/p&gt;
&lt;p&gt;
At the end of the day, it's back home to my lovely wife, and to
feed and bath my young son, only a Numerical Analyst in the back
of my mind.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3899531556464749881?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3899531556464749881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/08/day-in-life-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3899531556464749881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3899531556464749881'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/08/day-in-life-of.html' title='A day in the life of...'/><author><name>Nathaniel</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_X2mE_OFuKSA/TGumXyWGXzI/AAAAAAAAAAw/XPsNrwoeJLo/s72-c/working_small.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-7374557076099347187</id><published>2010-07-30T09:25:00.000+01:00</published><updated>2010-07-30T09:25:29.493+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fortran 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><title type='text'>Hey, you sass that hoopy Fortran?</title><content type='html'>We have to work with lots of different Fortran compilers at NAG. So far at
&lt;a href="http://www.nag.co.uk/doc/inun/fl22.html"&gt;Mark 22 of our Fortran Library&lt;/a&gt;
we have built using products from six distinct sources
(&lt;uc&gt;GNU&lt;/uc&gt;,
 &lt;uc&gt;IBM&lt;/uc&gt;,
 Intel®,
 &lt;uc&gt;NAG&lt;/uc&gt;,
 &lt;uc&gt;PGI&lt;/uc&gt; and Sun).
The list of what we build with naturally changes from Mark to Mark as 
different vendors fall by the wayside or as commercial considerations preclude
us from creating a particular Library implementation.&lt;br /&gt;
&lt;br /&gt;
With the six vendors listed above we are blessed that the base Fortran
coverage is Fortran 95. At previous Marks we
still supported compilers covering only Fortran 77 (&lt;tt&gt;g77&lt;/tt&gt; and
&lt;tt&gt;pgf77&lt;/tt&gt; for example). This forced us to jump through all manner of hoops so that we could
do some of the really useful stuff from Fortran 90—like, woah, dynamically
allocating memory—in a Fortran 77 way.&lt;br /&gt;
&lt;br /&gt;
Some hoops still exist though, even with Fortran 90 code.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_XkFBNMSZvw4/TFKI5vs2jSI/AAAAAAAAABI/1cScigm9o6A/s1600/dingus.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_XkFBNMSZvw4/TFKI5vs2jSI/AAAAAAAAABI/1cScigm9o6A/s320/dingus.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
For example, we recently ran into the following:
&lt;br /&gt;
&lt;pre class="nag"&gt;    &lt;span style="color: #a020f0;"&gt;PROGRAM&lt;/span&gt; &lt;span style="color: blue;"&gt;str_read&lt;/span&gt;
&lt;span style="color: red;"&gt;!      &lt;/span&gt;&lt;span style="color: red;"&gt;.. Implicit None Statement ..
&lt;/span&gt;       &lt;span style="color: #a020f0;"&gt;IMPLICIT&lt;/span&gt; &lt;span style="color: forestgreen;"&gt;NONE&lt;/span&gt;
&lt;span style="color: red;"&gt;!      &lt;/span&gt;&lt;span style="color: red;"&gt;.. Parameters ..
&lt;/span&gt;       &lt;span style="color: forestgreen;"&gt;INTEGER&lt;/span&gt;, &lt;span style="color: #a020f0;"&gt;PARAMETER&lt;/span&gt;              ::&lt;span style="color: darkgoldenrod;"&gt; wp = KIND(0.0D0)&lt;/span&gt;
&lt;span style="color: red;"&gt;!      &lt;/span&gt;&lt;span style="color: red;"&gt;.. Local Scalars ..
&lt;/span&gt;       &lt;span style="color: forestgreen;"&gt;REAL&lt;/span&gt; (kind=wp)                  ::&lt;span style="color: darkgoldenrod;"&gt; rval&lt;/span&gt;
       &lt;span style="color: forestgreen;"&gt;INTEGER&lt;/span&gt;                         ::&lt;span style="color: darkgoldenrod;"&gt; ioerr&lt;/span&gt;
       &lt;span style="color: forestgreen;"&gt;CHARACTER&lt;/span&gt; (200)                 ::&lt;span style="color: darkgoldenrod;"&gt; my_str&lt;/span&gt;
&lt;span style="color: red;"&gt;!      &lt;/span&gt;&lt;span style="color: red;"&gt;.. Executable Statements ..
&lt;/span&gt;       my_str = &lt;span style="color: rosybrown;"&gt;'1.0D400'&lt;/span&gt;
       &lt;span style="color: #a020f0;"&gt;READ&lt;/span&gt; (my_str,&lt;span style="color: rosybrown;"&gt;'(E16.0)'&lt;/span&gt;,iostat=ioerr) rval
       &lt;span style="color: #a020f0;"&gt;PRINT&lt;/span&gt; *, &lt;span style="color: rosybrown;"&gt;'IOERR = '&lt;/span&gt;, ioerr
    &lt;span style="color: #a020f0;"&gt;END PROGRAM&lt;/span&gt; &lt;span style="color: blue;"&gt;str_read&lt;/span&gt;
&lt;/pre&gt;
Ignoring the fact that the code fragment is a little contextless, just imagine
that we're trying to trap overflowing real values being read from a
&lt;tt&gt;CHARACTER&lt;/tt&gt;. On five of the six compilers given above, two return a
nonzero &lt;tt&gt;ioerr&lt;/tt&gt; from the &lt;tt&gt;READ&lt;/tt&gt;, two carry on happily and set
&lt;tt&gt;rval&lt;/tt&gt; to &lt;tt&gt;Infinity&lt;/tt&gt;, and one core dumps! (At the time of writing,
I didn't have access to all six compilers.)&lt;br /&gt;
&lt;br /&gt;
Conferring with the Fortran
standard (e.g., the
&lt;a href="http://www.j3-fortran.org/doc/year/97/97-007r2/pdf/97-007r2.pdf"&gt;draft Fortran 95&lt;/a&gt;)
we see the dreaded phrase
&lt;q&gt;The set of input/output error conditions is &lt;i&gt;processor dependent&lt;/i&gt;.&lt;/q&gt;
(my italics), so we can't even complain to the compiler vendors about this
behaviour! We have good relationships with the vendors, so when
our building process reveals a compiler bug we'll report it. But as you can
imagine, sometimes it can be a battle to achieve what we want across many
Fortran platforms in as simple and maintainable a way as possible.&lt;br /&gt;
&lt;br /&gt;
The next level of complication comes from ensuring that what we do in Fortran
is callable from non-Fortran environments. We usually take Microsoft Excel as
a sufficiently-far-removed example. I won't go into details of the usual issues
raised by cross-language programming; however, now we're at a base level of Fortran 95 we've been looking at
pushing our envelope more and trying out some Fortran 2003 features,
specifically C Interoperability.&lt;br /&gt;
&lt;br /&gt;
M'colleague &lt;a href="http://uk.linkedin.com/in/nesteves"&gt;Nicolas&lt;/a&gt; has
been working on a suite of image processing routines. In pure Fortran a
&lt;tt&gt;NAG_IMAGE&lt;/tt&gt; &lt;tt&gt;TYPE&lt;/tt&gt; exists to hold the pixel values and other
metadata for the image. To make this passable from outside Fortran we're
using Fortran 2003. It's understandable with new features in the language that
there should be a settling-in period, but it's no exaggeration to say that every
compiler we tried did, at some point, fall over on our new code. Thanks to
the hard work of the compiler developers on the various teams we're now at a
stable state, but there are still some vendors who are lagging behind with
Fortran 2003 and for which we have to exclude the image-processing code from
our testing.&lt;br /&gt;
&lt;br /&gt;
Looking forward (!) to
&lt;a href="ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1830.pdf"&gt;Fortran 2008&lt;/a&gt;,
I'm interested to see how the new
special-function &lt;tt&gt;INTRINSIC&lt;/tt&gt;s (&lt;tt&gt;BESSEL_J*&lt;/tt&gt;, &lt;tt&gt;BESSEL_Y*&lt;/tt&gt;, &lt;tt&gt;ERF*&lt;/tt&gt; and &lt;tt&gt;*GAMMA&lt;/tt&gt;) will behave across different compilers.
In theory these new &lt;tt&gt;INTRINSIC&lt;/tt&gt;s mean we'd be able to withdraw a sizeable
chunk of our &lt;a href="http://www.nag.co.uk/numeric/fl/nagdoc_fl22/html/S/sconts.html#S"&gt;S Chapter&lt;/a&gt;.
But I wonder how easy that will be?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_XkFBNMSZvw4/TFKI_uVZXWI/AAAAAAAAABQ/E_UL9e7xW9M/s1600/dingus-factory.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_XkFBNMSZvw4/TFKI_uVZXWI/AAAAAAAAABQ/E_UL9e7xW9M/s320/dingus-factory.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;(The images in this post are from
&lt;a href="http://www.sailthouforth.com/"&gt;now voyager&lt;/a&gt;,
but are probably copyright PolyGram Filmed Entertainment.)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-7374557076099347187?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/7374557076099347187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/07/hey-you-sass-that-hoopy-fortran.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7374557076099347187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7374557076099347187'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/07/hey-you-sass-that-hoopy-fortran.html' title='Hey, you sass that hoopy Fortran?'/><author><name>Mat Cross</name><uri>http://www.blogger.com/profile/08674286575878583286</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_XkFBNMSZvw4/S1QkCVO4sfI/AAAAAAAAAAM/TN9xiYVFZdU/S220/Mineress.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_XkFBNMSZvw4/TFKI5vs2jSI/AAAAAAAAABI/1cScigm9o6A/s72-c/dingus.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4371480090617494961</id><published>2010-07-23T04:37:00.005+01:00</published><updated>2010-07-23T22:23:15.038+01:00</updated><title type='text'>A Life Well-Lived: Erwin Ruppenthal (1958 – 2010)</title><content type='html'>&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;There’s probably some unwritten rule that blogs are off-limits to memorials. If so, I’m happy to break it for our colleague Erwin (or Erv as he was known at home). He died early this week after a long struggle with brain cancer, at home, surrounded by his wife Heidi and sons Alex and Kurt. If we take a closer look at his life we can learn a lot about the value of work and about having a purpose in life greater than earning a paycheck.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Erwin taught me a number of lessons about work and I’ll tell you about some of them so that things he valued might live on in each of us, but first let me tell you a little about him. He came to NAG in early August 1990 to work in IT at our US office. What I’m told was that he was an earnest, hardworking German citizen in his early 30’s who most would describe as shy and self-effacing. It was nine years later that I encountered him on my first day as his boss. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;He was a man of two countries and two cultures who embraced both. Following sports was a passion: American baseball, American football and European football featured prominently. In his office you could find emblems of the Chicago Bears and Chicago Cubs along with a Bayern Munich FC flag. I read in his obituary that he almost never missed a Naperville Central high school football game over many years. If you knew him, none of this loyalty and dedication would surprise you because he brought the same qualities to work every day,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;I’ve worked with few people who could equal his dedication to his work, our mission as a company and the customers we serve. His loyalty to serving our customers showed in the countless problems he solved late at night and early in the morning from home while monitoring our helpdesk inbox or remote web site. He had no hesitation in coming to me if he felt we weren’t being fair to a customer or living up to our promises. He confirmed in me that our first principle had to be to do the right thing by a customer and trust that they would return the same for us.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;He taught me some powerful management lessons though I doubt he ever spent a day in business school. Early on, I would see something we were doing that needed change, blindingly obvious (at least to me). Erwin would sit patiently as I explained, asking questions and listening. At first I thought he was just humoring his boss so I’d go back a week later and repeat the process and come away with the same impression. At some point later I would notice that a change had been made with no fanfare. Erwin would take my idea, however half-baked, improve it and implement it. Therein I learned the value of patience, trust and that overused cliché, empowerment. With Erwin, I mostly needed to plant a seed and get out of the way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Erwin didn’t spend money frivolously in his personal life, as far as I could tell, but when he did advocate spending it at work, he pursued quality, durability and things which made for better customer service. We have (still) a truly ancient UNIX server that serves as an archive of customer data. Through two office moves and occasional disk failures Erwin kept it going reliably. His care for such things could be summed up by a short story of the first of those moves. The move was from one building to another in an office park in suburban Chicago separated by perhaps two football fields of lawn and street. It was late on a cold, moonlit Friday night in early January 2002. The movers had finished earlier in the evening and all of the staff had gone home. All that was left to do was to power down the servers, move them across the street and re-start them. They were already ancient and Erwin wasn’t about to trust them to the movers so he and I methodically shut everything down and loaded it all on a 4-wheel cart. A few minutes later we were pushing the cart gently down the middle of the deserted street when I jokingly wondered what would happen if a police car came by. He had prepared for everything but that. Even in the small things, he planned carefully and followed through. That server is still running.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;I could tell you more but these things tell us the enduring values Erwin brought to work: loyalty to people and a purpose bigger than himself, patience, persistence and reliability. He was more than a co-worker for everyone he touched. He was a true colleague and a trusted friend. Erwin may be gone but his memory and his values live on in each of us.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4371480090617494961?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4371480090617494961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/07/life-well-lived-erwin-ruppenthal-1958.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4371480090617494961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4371480090617494961'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/07/life-well-lived-erwin-ruppenthal-1958.html' title='A Life Well-Lived: Erwin Ruppenthal (1958 – 2010)'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5918359031899591941</id><published>2010-07-19T15:17:00.003+01:00</published><updated>2011-02-04T15:41:55.289Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><title type='text'>Time Machines and Supercomputers</title><content type='html'>I found a Linpack App for the iPhone last week. Nothing special, just a bit of five minute fun. It seems a 3G model achieves about 20 MFLOPS. [&lt;i&gt;&lt;b&gt;Note 1&lt;/b&gt;&lt;/i&gt;]&lt;br /&gt;
&lt;br /&gt;
What's that got to do with time machines? Well it got me thinking "&lt;i&gt;I wonder when 20 MFLOPS was the performance of a leading edge supercomputer?&lt;/i&gt;" Actually, it was before the start of &lt;a href="http://www.top500.org/"&gt;the Top500 list&lt;/a&gt; (1993), so finding out was beyond the research I was prepared to do for this blog.&lt;br /&gt;
&lt;br /&gt;
So I thought instead about the first supercomputer I used in anger. As soon as I name it,  if anyone is still reading this waffle, you will immediately fall into two camps - those who think I'm too young to be nostalgic about old supercomputers yet - and those who think I'm too old to be talking about modern supercomoputers :-).&lt;br /&gt;
&lt;br /&gt;
It was a &lt;a href="http://en.wikipedia.org/wiki/Cray_T3D"&gt;Cray T3D&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;You're still waiting for the time machine bit ... hang on in there.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
My application on that T3D sustained about 25 GFLOPS. Which is about the same as a high end PC of recent years. What this means to me is that anyone who cares to apply the effort today with a high end PC, could get comparable results to that work of 15-20 years ago that needed the supercomputer.&lt;br /&gt;
&lt;br /&gt;
Or, in other words, that supercomputer gave us a 15-20 years time advantage over everyone who didn't have supercomputers - or a few years over others with smaller supercomputers. [&lt;i&gt;&lt;b&gt;Note 2&lt;/b&gt;&lt;/i&gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;That is one of the key benefits of High Performance Computing - the ability to get a result before a competitor - you could say HPC is a time machine for simulation and modelling.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Now for the [Notes] - which actually contain the real story!&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note 1 :&lt;/b&gt; It's not really true to say the iPhone 3G can do 20 MFLOPs - all we can say is that particular App achieved 20 MFLOPs on that iPhone 3G. The result is a factor of both the software and the hardware. Better performance can come from optimising the application as much as from buying a more powerful phone.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note 2 :&lt;/b&gt; If fact, even with the same supercomputer, it would be hard for most people to replicate the results - simply because there was as much value in the software (physics, algorithms, performance engineering, implementation, etc) and the associated validation and verification program as there was in the supercomputer.&lt;br /&gt;
&lt;br /&gt;
The supercomputer offered us a time machine. But the attention to performance and scalability in the application enabled us to actually use that time machine to get results faster than others - even if those others used the same supercomputer. And the validation and verification effort meant that we could trust what our time machine was telling us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5918359031899591941?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5918359031899591941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/07/time-machines-and-supercomputers.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5918359031899591941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5918359031899591941'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/07/time-machines-and-supercomputers.html' title='Time Machines and Supercomputers'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4023750794887610340</id><published>2010-07-08T09:24:00.007+01:00</published><updated>2011-06-14T12:23:49.966+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='portfolio optimisation'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='football'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='fantasy football'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>Fantasy Football – a classic Portfolio Optimisation problem</title><content type='html'>&lt;div class="WordSection1"&gt;
&lt;div class="MsoNormal"&gt;
England out the World Cup, German colleagues, customers, collaborators (actually not just Germans, Americans, Scots,…) and so called friends all sending me mocking e-mails and texts.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;“I hear &lt;a href="http://en.wikipedia.org/wiki/Oxo_%28food%29"&gt;OXO&lt;/a&gt; are making a new product. The packaging is white with a red cross and they're calling it the laughing stock&lt;/span&gt;.” &lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
How could I channel my frustration? NAG Blog to the rescue.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
In my last blog I promised to reflect on my early career at NAG which isn’t that long ago compared with some of colleagues.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
My commute to the NAG office is longer than I’d like, but there is a positive side…&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Valuable thinking time&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Audio books - I recently enjoyed “&lt;a href="http://www.audible.co.uk/aduk/site/product.jsp?BV_SessionID=@@@@0593480371.1278015712@@@@&amp;amp;BV_EngineID=cccdadekklidhhgcefecekjdfikdffj.0&amp;amp;source_code=OGCS0001SH122309UK&amp;amp;p=BK_ADBL_001959UK&amp;amp;source_code=OGCS0001SH122309UK"&gt;No One Would Listen&lt;/a&gt;” by Harry Markopolos. The exclusive story of the Harry Markopolos–lead investigation into Bernie Madoff and his $65 billion &lt;a href="http://simple.wikipedia.org/wiki/Ponzi_scheme"&gt;Ponzi scheme&lt;/a&gt;.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Back to “thinking time,” on one commute into Oxford I’d been pondering the previous day’s internal training course. I was recalling my senior technical colleague’s wise words. That wise colleague was David (some of you will have met him). He had given an internal training course to the Sales and Marketing group. His presentation was a simple introduction to the topic of Optimisation and he had touched on &lt;a href="http://en.wikipedia.org/wiki/Modern_portfolio_theory"&gt;modern portfolio theory&lt;/a&gt; even explaining the efficient frontier.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Some of you may be lucky enough to have heard this talk before…. &lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Imagine an English ice cream manufacturer. He might run a very profitable business, but recognise that his business is very dependant on long sunny, dry summers. Wishing to diversify and minimise his risk he chooses to start another business thus protecting himself against a cold, rainy summer with an umbrella company.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Subsequently he went on to talk about stocks and shares and the benefits of diversification. This struck a chord with me. I learnt early on in my adult life the importance of diversification. Remember GEC that became Marconi. &lt;a href="http://news.bbc.co.uk/1/hi/business/1423642.stm"&gt;Where did Marconi go wrong?&lt;/a&gt; As a result of shares options I had a portfolio dominated by Marconi and consequently suffered a very large paper loss. Oh, why didn’t I meet David earlier? He went on to speak about how diversification can be achieved by holding a selection of stocks from a spread of geographic regions, industry sectors etc.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Of course this whole training course was aimed at helping us understand &lt;a href="http://www.nag.co.uk/optimization/availnaglib.asp"&gt;NAG’s Optimisation Routines&lt;/a&gt; . For those of you wishing to learn more about NAG’s optimisation routines you should refer to the NAG Library Manual and the appropriate &lt;a href="http://www.nag.co.uk/numeric/CL/nagdoc_cl09/pdf/E04/e04intro.pdf"&gt;chapter introduction&lt;/a&gt;.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Anyway, as I drove back into work that morning I had that light bulb moment. &lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Fantasy_football_%28Association%29"&gt;Fantasy football &lt;/a&gt;is like portfolio optimisation! &lt;/b&gt;Well, you can imagine how I sprinted into the office from the work car park eager to share my discovery with David.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Me: “Remember your lecture about optimisation and portfolio optimisation? Fantasy football is like this, isn’t it?”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
David: “What is Fantasy Football?”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Me: “Well &lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;/span&gt;You have a set of &lt;a href="http://fantasy.premierleague.com/M/rules.mc"&gt;rules&lt;/a&gt;.&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;You have a limited pot of money that you can spend to pick a squad of 15 football players.&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;/span&gt;You then have to pick X Goal Keepers, Y defenders, …&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;You can only pick Z players from any one team&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Players win points by &lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Keeping a clean sheet&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Scoring a goal&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;o&lt;/span&gt;Assisting a goal&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;Players lose points by &lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;o&lt;/span&gt;Conceding goals&lt;br /&gt;
o Getting red or yellow cards.”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Pause for thought.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Me: “These are constraints aren’t they?”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Patronising nod from David&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Me: “And this is an Integer problem, isn’t it?”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Laughter. David: “Well, at least you were listening last week. Now, go and get on with your work.”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Me: “No, you don’t get it. You’re going to help me program this up and we’ll see how the &lt;a href="http://www.nag.co.uk/numeric/CL/nagdoc_cl09/html/E04/e04conts.html#e04"&gt;NAG Optimisers&lt;/a&gt; perform! I bet they won’t beat me. I’ve won the office fantasy football competition two years in a row. I would be interested to see how it performs though.”&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Two or three days pass. I find a way of getting all the historic data from “&lt;a href="http://fantasy.premierleague.com/"&gt;The Official Fantasy Game Of The Premier League&lt;/a&gt;” into an Excel spreadsheet.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
A week later I manage to persuade David to code up one of NAG’s optimisation routines to optimise my portfolio of football players. What does this mean? Well one is supplied with a list of players. Each player has a value and their previous season’s points total is listed. So one might choose a strategy which optimises a squad of 15 players based on a maximum spend of £100 million. A more risky approach might be to assume you will always have 11 fit players so you pick the 4 cheapest players and then look to maximise your return from an optimal 11.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Fortunately NAG supplies Visual Basic Declaration Statements and C Types with its DLLs. This makes these libraries easy to use for VB programmers who could easily code up one of NAG’s Optimisers to pick a Fantasy Football side. Yes, NAG’s Libraries are easy to &lt;a href="http://www.nag.co.uk/numeric/nagandexcel.asp"&gt;link to Excel&lt;/a&gt; and we include a simple Portfolio Optimisation example on our website. &lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href="http://2.bp.blogspot.com/_F4pWYcpsEU8/TDTjWarq5yI/AAAAAAAAABQ/inCRGGLp1E4/s1600/image001.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5491263819930593058" src="http://2.bp.blogspot.com/_F4pWYcpsEU8/TDTjWarq5yI/AAAAAAAAABQ/inCRGGLp1E4/s400/image001.jpg" style="display: block; height: 432px; margin: 0px auto 10px; text-align: center; width: 544px;" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
Let me explain this screen shot.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
The two teams that were picked entirely by NAG’s Solvers were David’s “Too Hot” and Sven’s “Old NAG’s Best 15.”&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;“Too Hot” was based on picking the four cheapest players (with the highest return) and then the “Optimised 11” &lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;
&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;/span&gt;“Old NAG’s Best 15” was based on optimising the entire 15 i.e. taking no account that only 11 players can be picked and used in each match.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;
&lt;i&gt;In my next blog I’ll share with you how “Too Hot” and “Old NAG’s Best 15” finished the season.&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4023750794887610340?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4023750794887610340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/07/fantasy-football-classic-portfolio.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4023750794887610340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4023750794887610340'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/07/fantasy-football-classic-portfolio.html' title='Fantasy Football – a classic Portfolio Optimisation problem'/><author><name>John</name><uri>http://www.blogger.com/profile/09521247782713845625</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_F4pWYcpsEU8/S3PZIqwAuZI/AAAAAAAAAAM/jPRRBw6gSE8/S220/JohnPic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_F4pWYcpsEU8/TDTjWarq5yI/AAAAAAAAABQ/inCRGGLp1E4/s72-c/image001.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2644754410999620087</id><published>2010-07-02T08:44:00.012+01:00</published><updated>2010-07-02T10:14:29.180+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='random numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='collaboration'/><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo'/><category scheme='http://www.blogger.com/atom/ns#' term='GPGPU'/><title type='text'>The power within graphics cards</title><content type='html'>NAG is a company that likes to be present at scientific events all around the world. One of the main reasons for this is we get face-to-face time with NAG users and this gives us the chance to listen to their needs and reiterate that 40 years on, NAG is still a not-for-profit company for which collaboration is essential. &lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_6PyYVdaBhFw/TC2a1XlgnUI/AAAAAAAAACM/1_VNIctpDT0/s1600/P6215868.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5489213762489589058" src="http://1.bp.blogspot.com/_6PyYVdaBhFw/TC2a1XlgnUI/AAAAAAAAACM/1_VNIctpDT0/s400/P6215868.JPG" style="cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;NAG at the GPGPU Developer Briefing in New York City&lt;/span&gt;&lt;/a&gt; &lt;/div&gt;
&lt;br /&gt;
Last week I had the pleasure of representing NAG at two events in North America: GPGPU Developer Briefing in New York City and the 6th World Congress of Bachelier Finance Society in Toronto. While manning the NAG stand together with my colleagues we had many interesting conversations with those attending and made them aware of one of NAG’s most recent developments – the &lt;a href="http://www.nag.co.uk/numeric/gpus/"&gt;NAG Library for GPUs&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/_6PyYVdaBhFw/TC2Z14ZYlAI/AAAAAAAAAB8/KN3lu1-rXCw/s1600/P6235887.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5489212671785473026" src="http://3.bp.blogspot.com/_6PyYVdaBhFw/TC2Z14ZYlAI/AAAAAAAAAB8/KN3lu1-rXCw/s400/P6235887.JPG" style="cursor: pointer; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;span style="font-size: 85%;"&gt;6th World Congress of Bachelier Finance Society in Toronto&lt;/span&gt;&lt;/a&gt; &lt;/div&gt;
&lt;br /&gt;
We expected lots of interest in GPUs at the briefing in NYC, and were all happy to describe our successes with Monte Carlo simulations on GPUs. Currently the &lt;a href="http://www.nag.co.uk/numeric/gpus/"&gt;NAG Library for GPUs&lt;/a&gt; consists of two random number generators: pseudorandom L’Ecuyer MRG and quasirandom Sobol, a generator of sample paths for a Brownian bridge, and statistical distributions. Other features, such as PDE methods or optimization will follow soon. It was really good to see the high level of interest in the Library and how to call it from Excel and other environments. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_6PyYVdaBhFw/TC2aDaNJeTI/AAAAAAAAACE/9D3NUQSOWq8/s1600/graph_gpu.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5489212904199256370" src="http://2.bp.blogspot.com/_6PyYVdaBhFw/TC2aDaNJeTI/AAAAAAAAACE/9D3NUQSOWq8/s400/graph_gpu.png" style="cursor: pointer; display: block; height: 219px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
The Bachelier Society Congress in Toronto attracted an audience primarily from financial academia. We spoke to various NAG users who talked about their use of NAG routines for optimization, wavelet transforms, and RNG to name a few, but this audience also expressed keen interest in our GPU work, in particular the work with a major bank where the &lt;a href="http://www.nag.co.uk/numeric/gpus/"&gt;NAG Library for GPUs&lt;/a&gt; performed a Monte Carlo simulation over 200 faster than on a single-core CPU! Of course, this level of speed up cannot always be achieved, but it is an indicator of the power of GPUs combined with the robust, efficient and stable implementation of random number generators in the &lt;a href="http://www.nag.co.uk/numeric/gpus/"&gt;NAG Library for GPUs&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2644754410999620087?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2644754410999620087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/07/nag-is-company-that-likes-to-be-present.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2644754410999620087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2644754410999620087'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/07/nag-is-company-that-likes-to-be-present.html' title='The power within graphics cards'/><author><name>Marcin Krzysztofik</name><uri>http://www.blogger.com/profile/18261558624689201066</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_6PyYVdaBhFw/S1RmqpcRTCI/AAAAAAAAAAM/e0nyrnucwPU/S220/pic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_6PyYVdaBhFw/TC2a1XlgnUI/AAAAAAAAACM/1_VNIctpDT0/s72-c/P6215868.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-9104640001538687346</id><published>2010-06-23T14:00:00.010+01:00</published><updated>2010-06-30T09:56:44.485+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SMP'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>My first experiences calling the NAG Library for SMP and Multicore</title><content type='html'>A quick introduction: I work for NAG as a Technical Support Engineer in Germany. I look after clients in Germany, Switzerland and Austria and am interested in approximation and interpolation methods as well as .NET languages. Naturally, I’m big fan of the &lt;a href="http://www.nag.co.uk/numeric/DT/DTdescription.asp"&gt;NAG library for .NET&lt;/a&gt; as well as the &lt;a href="http://www.nag.co.uk/numeric/fl/FSdescription.asp"&gt;NAG Library for SMP and Multicore&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As a non FORTRAN programmer to be able to run some tests with the new &lt;a href="http://www.nag.co.uk/numeric/fl/FSdescription.asp"&gt;NAG Library for SMP and Multicore&lt;/a&gt; I decided to choose a few simple tests that I could run using both CPUs of my laptop. I created some .NET console applications, wrappers around the FORTRAN routines that were able to pass all the arguments to the routines in a .NET fashion and implemented a time counting function. There are many parts of the Library parallelized, including quadrature, partial differential equations, interpolation, curve and surface fitting, linear algebra, correlation and regression analysis, multivariate methods, random number generators, time series analysis, sorting and special functions. I chose routines from the correlation, curve and surface fitting and random number generation chapters.&lt;br /&gt;
&lt;br /&gt;
The results were calculated on a Intel® Core™2 Duo Prozessor P8700 (2.53GHz,1066MHz,3MB) machine with Windows Vista as operating system and Microsoft Visual Studio 2008 (32‐bit project) as compiler. Each function was used to solve a large enough problem to allow for parallelism. Each test case was run with one or two threads. The number of threads was set using the system variable ‘OMP_NUM_THREADS’ in the Visual Studio console window.&lt;br /&gt;
&lt;br /&gt;
A ‘QueryPerformanceCounter’ function, was implemented in all the examples to calculate the time which the routines needed for calculating the result. Below is the class implemented for each of the examples which can be used by first creating the constructor HiPerfTimer and then using the methods Start, Stop and Duration:&lt;br /&gt;
&lt;pre class="nag"&gt;HiPerfTimer pt = new HiPerfTimer();
pt.Start();
//routine
pt.Stop();
pt.Duration();

internal class HiPerfTimer
    {
        [DllImport("Kernel32.dll")]
        private static extern bool QueryPerformanceCounter(
            out long lpPerformanceCount);

        [DllImport("Kernel32.dll")]
        private static extern bool QueryPerformanceFrequency(
            out long lpFrequency);

        private long startTime, stopTime;
        private long freq;

        // Constructor

        public HiPerfTimer()
        {
            startTime = 0;
            stopTime = 0;

            if (QueryPerformanceFrequency(out freq) == false)
            {
                throw new Win32Exception();
            }
        }


        // Start the timer

        public void Start()
        {

            Thread.Sleep(0);

            QueryPerformanceCounter(out startTime);
        }


        // Stop the timer

        public void Stop()
        {
            QueryPerformanceCounter(out stopTime);
        }


        // Returns the duration of the timer (in seconds)

        public double Duration
        {
            get
            {
                return (double)(stopTime - startTime) / (double)freq;
            }
        }
    }
&lt;/pre&gt;
After compiling the examples with the C# compiler option ‘csc’, the number of threads is first set to the value 1 and then set to the value 2. The only result which is printed is the time which the routine needs for calculating the result.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Correlation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
NAG routine C06PKF calculates the circular convolution or correlation of two complex vectors of period n.&lt;br /&gt;
In this example to complex vectors are build up with a period of n (n=5000000) and the correlation and the circular convolution are calculated.&lt;br /&gt;
&lt;pre class="nag"&gt;C: \C06PKF\C06PKF&amp;gt;csc c06pkf.cs

C:\ C06PKF\C06PKF&amp;gt; set OMP_NUM_THREADS=1
C:\C06PKF\C06PKF&amp;gt;c06pkf
Duration: 5.74 sec

C: \C06PKF\C06PKF&amp;gt;set OMP_NUM_THREADS=2
C: \C06PKF\C06PKF&amp;gt;c06pkf
Duration: 2.98 sec
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Random Number Generation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
NAG routine G05YKF generates a quasi-random sequence from a log-normal distribution. It must be preceded by a call to one of the initialization routines G05YLF or G05YNF. The number N (N = 10000000) of quasi-random numbers of dimension IDIM (IDIM = 4) are passed and also the mean (IDIM) of the underlying Normal distribution for each dimension and the std (IDIM) standard deviation of the underlying Normal distribution.&lt;br /&gt;
&lt;pre class="nag"&gt;C: \ G05YKF\G05YKF&amp;gt;csc c06pkf.cs

C: \G05YKF\G05YKF&amp;gt;set OMP_NUM_THREADS=1
C: \G05YKF\G05YKF&amp;gt;g05ykf
Duration: 3.52 sec

C: \G05YKF\G05YKF&amp;gt;set OMP_NUM_THREADS=2
C:\ G05YKF\G05YKF&amp;gt;g05ykf
Duration: 2.06 sec
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Approximation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
NAG Routine E02CAF forms an approximation to the weighted, least-squares Chebyshev series surface fit to data arbitrarily distributed on lines parallel to one independent coordinate axis. It determines a bivariate polynomial approximation of degree k in x and l in y to the set of data points , with weights , for and . That is, the data points are on lines , but the x values may be different on each line. The polynomial is represented in double Chebyshev series form.&lt;br /&gt;
N, the number of lines on which data points are given, was set to 1000&lt;br /&gt;K, the required degree of x was set to 100 and&lt;br /&gt;L, the required degree of y was set also to 100.&lt;br /&gt;
Also the fitting polynomial was evaluated at the data points using the routine E02CBF.&lt;br /&gt;
&lt;pre class="nag"&gt;C:\E02CAF\E02CAF &amp;gt;csc e02caf.cs

C:\ E02CAF\E02CAF &amp;gt;set OMP_NUM_THREADS=1
C:\ E02CAF\E02CAF &amp;gt;e02caf
Duration: 4.77 sec

C:\ E02CAF\E02CAF &amp;gt;set OMP_NUM_THREADS=2
C:\ E02CAF\E02CAF &amp;gt;e02caf
Duration: 2.48 sec
&lt;/pre&gt;
&lt;a href="http://4.bp.blogspot.com/_0typpiUM8uE/TCIFmHi76iI/AAAAAAAAAAg/MNbIg5BWCL4/s1600/test.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5485953448509434402" src="http://4.bp.blogspot.com/_0typpiUM8uE/TCIFmHi76iI/AAAAAAAAAAg/MNbIg5BWCL4/s320/test.png" style="cursor: hand; height: 250px; width: 500px;" /&gt;&lt;/a&gt; &lt;br /&gt;
Fig 1: Timings for the SMP enabled NAG routines with one or two threads&lt;br /&gt;
My experience with presenting these examples at different clients has been very positive, but also interesting! “Warum verwenden Sie diese Bibliothek in .NET? Das ergibt doch keinen Sinn, da wir nur in Fortran programmieren!” “Why are you using the Library in .NET and not directly in Fortran? This doesn’t make any sense, we are coding only in Fortran!”&lt;br /&gt;
Others were excited to learn and understand they might use their second processor!&lt;br /&gt;
My conclusions are as follows&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Never show a C# program to HPC Computer Programmers who love Fortran and think languages such as C are radical!&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.nag.co.uk/numeric/fl/FSdescription.asp"&gt;NAG Library for SMP and Multicore&lt;/a&gt; really is easy to use and for those who are current NAG Fortran Library users the transition really is painless. Users just need to take care of the number of threads used.&lt;/li&gt;
&lt;/ul&gt;
I should admit a bias as a NAG employee, but perhaps more importantly I’d like to use this blog to talk to users / prospective users and offer help. As I said in my introduction I am interesting in this, but also hearing from those who have interests in approximation and interpolation. I plan to work with some of my developer colleagues to expand some of NAG’s interpolation solvers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-9104640001538687346?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/9104640001538687346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/my-first-experiences-calling-nag.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9104640001538687346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9104640001538687346'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/my-first-experiences-calling-nag.html' title='My first experiences calling the NAG Library for SMP and Multicore'/><author><name>Sorin</name><uri>http://www.blogger.com/profile/14742632015056333247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_0typpiUM8uE/TCIFmHi76iI/AAAAAAAAAAg/MNbIg5BWCL4/s72-c/test.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2590970814469909625</id><published>2010-06-22T17:31:00.001+01:00</published><updated>2011-06-08T09:53:21.668+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='manycore'/><title type='text'>Technical computing futures part 2: GPU and manycore success</title><content type='html'>In &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/06/revealing-future-of-technical-computing.html"&gt;my previous blog&lt;/a&gt;, I suggested that the HPC revolution towards GPUs (or similar many-core technologies) as the primary processor has a lot in common with the move from RISC to commodity x86 processors a few years ago. A new technology appears to offer cheaper (or better) performance than the incumbent, for some porting and tuning pain. Of course, I’m not the first HPC blogger to have made this observation, but I hope to follow it a little further.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
In particular, my previous blog suggested the outcome might be: “&lt;i&gt;at first the uptake is tentative ... but in a few years time, we might well look back with nostalgia to when GPU’s were not the dominant processor for HPC systems&lt;/i&gt;” – in other words, hard going initially, but GPU/many-core will “win” eventually. I even ended up with an ambitious promise for my next blog (i.e. this one): “&lt;i&gt;an idea of what/who will emerge as the dominant solution ...&lt;/i&gt;”&lt;br /&gt;
&lt;br /&gt;
Continuing the basis of using the past to guess the future, my prediction is that the next steady state of HPC processors will be GPU-like/manycore technologies (for most of the FLOPS at least) and, just like the current steady state (x86), those few companies with the strongest financial muscle will eventually own the dominant market share. However, other companies will have pioneered many of the technologies that make that dominant market share possible, enjoying good market share surges in the process.&lt;br /&gt;
&lt;br /&gt;
I can even have a go at predicting some of the path that might get us to the next steady state of HPC architecture. NVIDIA has already shown us that GPUs for HPC are sometimes a good solution – and importantly, that a good programming ecosystem (CUDA) really helps adoption. Over the last year or so, I’d say the HPC community has moved from “&lt;i&gt;if GPUs can work in this case ...&lt;/i&gt;” to “&lt;i&gt;how do I make GPUs work across my workload?&lt;/i&gt;”&lt;br /&gt;
&lt;br /&gt;
As Intel’s Knights processors bring us many-core but with a familiar x86 instruction set, we might learn that getting good performance across a broad range of applications is possible, but critically dependent on software tools and hard work by skilled parallel programmers. AMD’s Fusion with tighter links between CPU &amp;amp; GPU, could show that the nature of the integration between the many-core/GPU unit and the rest of the system (be it CPU, network, main memory etc) will affect not only maximum performance on specific applications, but maybe more importantly the ease of getting “good enough” performance across a range of applications.&lt;br /&gt;
&lt;br /&gt;
I don't know of any GPU/many-core/accelerator announcements from IBM, but it’s always possible IBM will throw in another useful contribution before the dust settles. They were one of the first into many-core processors for HPC acceleration with Cell and they cannot be easily counted out of top end HPC solutions - e.g. the forthcoming Blue Waters (POWER7) and Sequoia (BG/Q) chart-toppers.&lt;br /&gt;
But back to my “winner” prediction. When the revolution settles into a new steady state of mostly GPU/many-core for HPC processors, there won’t be (can’t be) critical distinctions between the various products anymore for most applications. Whichever product we consider (whether GPU or x86-based or whatever), many-core is sufficiently different from few-core (e.g. 1-8 cores) to mean that the early winners have been those users who are easily able to move their key applications across to get step changes in cost and performance.&lt;br /&gt;
&lt;br /&gt;
The big winners in the next stages of the GPU/manycore emergence will be those users who can move the bulk of their high-value-generating HPC usage to many-core processors with the most attractive transition (economy and speed) compared to their competitors.&lt;br /&gt;
&lt;br /&gt;
So what about the dominant solution I promised? For the technology to be pervasive, first there must be greater commonality between offerings (I stop short of standardization) so that programmers have at least a hope of portability. Secondly, users need to be able to extract the available performance. Ideally these would mean a software method that makes many-core programming “good enough easily enough” is discovered – and if so, &lt;b&gt;that software method will be the dominant solution&lt;/b&gt;, across all hardware.&lt;br /&gt;
&lt;br /&gt;
Or, if the magic bullet is still not market ready, &lt;b&gt;skilled parallel programmers will be the dominant solution for achieving competitive performance and cost benefits&lt;/b&gt; - just like it is for HPC using commodity x86 processors today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2590970814469909625?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2590970814469909625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/technical-computing-futures-part-2-gpu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2590970814469909625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2590970814469909625'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/technical-computing-futures-part-2-gpu.html' title='Technical computing futures part 2: GPU and manycore success'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/05974964640620611504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-o7Kjn67Fc70/TXjH1ec-POI/AAAAAAAAAA0/scs5hiepv-o/s220/hpcnotes_logo5_bigger.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3246806075847451130</id><published>2010-06-16T13:41:00.003+01:00</published><updated>2010-11-24T16:33:30.994Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><title type='text'>The meaning of recognition</title><content type='html'>A few years ago, NAG decided to brush up its public image and issued its staff with The Company Shirt (actually, it turned out that there was so much money in the marketing budget that each of us was able to &lt;span style="font-style: italic;"&gt;have our own shirt&lt;/span&gt;, as opposed to being obliged to take it in turns to sport a single item of clothing). It's a rather splendid garment (you can see my colleague &lt;a href="http://www.nag.co.uk/about/mdewar.asp"&gt;Mike Dewar&lt;/a&gt; elegantly modelling his below) that proudly but discreetly displays the company logo and, for good measure, the full name of the company (lest the abbreviation be misinterpreted as an exhortation to complain endlessly). &lt;a href="http://www.flickr.com/photos/numericalalgorithmsgroup/4606601680/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://farm2.static.flickr.com/1240/4606601680_caee9268d5.jpg" style="cursor: hand; float: right; height: 187px; margin: 10px; width: 250px;" /&gt;&lt;/a&gt;The idea - which, I'd imagine, is common to just about every organization in the world - is that the shirt can be worn on exhibition stands, when giving commercial presentations or making customer visits so that a (somewhat loosely) unified image of the company is presented to the outside world. Members of staff have acceded to this idea with varying degrees of alacrity; speaking for myself - following an initial period of uneasiness where I suspected (quite without foundation) that the next step on the road to an improved image would be The Company Song - I've been happy to wear The Shirt on every appropriate occasion.&lt;p&gt;&lt;/p&gt;&lt;p&gt;

And on some less appropriate ones as well. For example, last night I was taking part in a choir rehearsal as part of the preparation for a well-known religious leader's visit to the UK later this year. Not having had time to get changed after work, I was wearing The Shirt as we collectively negotiated the joys of counting bars, leaping fourths, subdividing triplets and other more applied forms of numerical analysis. Approaching the conductor - who'd been brought in from another parish in order to adeptly marshal our enthusiastic but slightly unfocussed efforts - with a technical question at the end of the rehearsal, I was a little surprised when he asked if I worked for NAG. Wondering if he was about to quiz me about - say - our &lt;a href="http://www.nag.co.uk/numeric/FL/nagdoc_fl22/xhtml/E04/e04conts.xml#E04"&gt;optimization routines&lt;/a&gt;, I replied - somewhat cautiously - in the affirmative. "&lt;span style="font-style: italic;"&gt;Great stuff,&lt;/span&gt;" he responded. "&lt;span style="font-style: italic;"&gt;I used the NAG Library all the time at university when I was programming in Fortran - it was really, really good.&lt;/span&gt;" Owing to the context, the generous and unlooked-for compliment was so surprising that I forgot to say that &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/03/extending-imitating-and-collaborating_18.html"&gt;these days, the Library wasn't only available to Fortran programmers&lt;/a&gt; (on reflection, perhaps that was just as well on this occasion) but I was also reminded that this kind of encounter isn't at all uncommon. Given the &lt;a href="http://issuu.com/numericalalgorithmsgroup/docs/40_years_of_nag_scrapbook"&gt;remarkable age of the company&lt;/a&gt;, perhaps it's only to be expected that you frequently bump into users - or ex-users - of your products, but it's still gratifying when they're able to share positive experiences - or happy memories - of it. Maybe I should start work on that Company Song after all.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3246806075847451130?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3246806075847451130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/meaning-of-recognition.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3246806075847451130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3246806075847451130'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/meaning-of-recognition.html' title='The meaning of recognition'/><author><name>Jeremy Walton</name><uri>http://www.blogger.com/profile/10917026591452126254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://3.bp.blogspot.com/_NFq6A7hoc_Y/S2wJQVWjVyI/AAAAAAAAAAM/kSS1WEjyAm8/s1600-R/image_preview'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm2.static.flickr.com/1240/4606601680_caee9268d5_t.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4629000435869310020</id><published>2010-06-08T16:47:00.011+01:00</published><updated>2011-06-08T09:54:09.785+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='manycore'/><title type='text'>Revealing the future of technical computing: part 1</title><content type='html'>I recall some years ago porting an application code I worked with, which was developed and used almost exclusively on a high end supercomputer, to my PC. Naively (I was young), I was shocked to find that, per-processor, the code ran (much) faster on my PC than on the supercomputer. With very little &lt;a href="http://nag.com/hpc/software_engineering.asp"&gt;optimization&lt;/a&gt; effort.&lt;br /&gt;
&lt;br /&gt;
How could this be – this desktop machine costing only a few hundred pounds was matching the performance of a four processor HPC node costing many times that? Since I was also starting to get involved in HPC procurements, I naturally asked why we spend millions on special supercomputers, when for a twentieth of the price, we’d get the same throughput from a bunch of high-spec PCs?&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;
The answer then (and now) was that I was extrapolating from only one application, and that application could be run as lots of separate test cases with no reduction in capability (i.e. we didn’t need large memory etc, just lots of parameter space). However, the other major workload (which I also ported and also ran fast on the PC) would not have been able to do the size of problem we wanted on a PC – we needed the larger memory and extra grunt from parallel processing. (We did look at the newfangled Network Of Workstations emerging at the time but decided it might &lt;a href="http://www.beowulf.org/"&gt;be a wolf&lt;/a&gt; in sheep’s clothing. Sorry.)&lt;br /&gt;
&lt;br /&gt;
In the end, we had to find a balance between (a) speed at lowest cost for the one application; (b) the best capability for the other application (i.e. fastest solution time for the largest problems); (c) ease of programming – to get a good enough (fast-enough) code developed with the limited developer effort and funding we had; and (d) whole life affordability.&lt;br /&gt;
&lt;br /&gt;
Why do I foist this reminiscence on you? Because the current &lt;a href="http://www.gpucomputing.net/"&gt;GPU&lt;/a&gt; &lt;a href="http://www.google.com/#hl=en&amp;amp;q=%2Bgpu+%2Bisc10+site%3Atwitter.com"&gt;crisis&lt;/a&gt; (maybe “crisis” is a bit strong – "&lt;a href="http://insidehpc.com/2010/05/31/qlogic-to-optimize-for-nvidia-gpudirect/"&gt;PR&lt;/a&gt; &lt;a href="http://insidehpc.com/2010/06/01/sgi-announces-hybrid-petaflop-architecture/"&gt;storm&lt;/a&gt;" perhaps?) looks very much the same to me. The desktop HPC surprise of my youth has evolved into the dominant HPC processor and so for some years now, we have been developing and running our applications on clusters of general purpose processors – and a new upstart is trying to muscle in with the same tactic – “look how fast and how cheap” – the GPU (or similar technologies – e.g. Larrabee, sorry &lt;a href="http://insidehpc.com/2010/05/31/intel-lifts-curtain-on-hpc-plans/"&gt;Knights&lt;/a&gt;-&lt;a href="http://www.hpcwire.com/specialfeatures/isc10/features/Intel-Unveils-Plans-for-HPC-Coprocessor-95334544.html"&gt;thingy&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
The issues are the same: (a) for some applications, GPUs offer substantial performance improvements for considerably less cost than a “normal” HPC processor; (b) for other applications, the limits such as off-card bandwidth etc mean that GPU’s cannot deliver the required capability; (c) the underlying concern is ease of programming for GPUs; (d) affordability – sure GPU’s are cheap to buy, but what about power costs when in bulk, or code porting costs, etc?&lt;br /&gt;
&lt;br /&gt;
Maybe the result will be the same as when commodity processors and clusters eventually exploded to leave custom supercomputer hardware as the minority solution. At first the uptake (now) is tentative - and painful. Some will have great success stories, many will get burnt. But in a few years time, we might well look back with nostalgia to when GPU’s were not the dominant processor for HPC systems.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;I’ll continue on the future of HPC in my next blog in a few days, including an idea of what/who will emerge as the dominant solution ...&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4629000435869310020?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4629000435869310020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/revealing-future-of-technical-computing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4629000435869310020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4629000435869310020'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/revealing-future-of-technical-computing.html' title='Revealing the future of technical computing: part 1'/><author><name>Andrew</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-2386399495165176763</id><published>2010-06-07T17:01:00.011+01:00</published><updated>2010-06-11T10:30:50.259+01:00</updated><title type='text'>Why is writing good numerical software so hard?</title><content type='html'>People sometimes say to us "Why does NAG continue to exist? Surely all the good numerical algorithms have already been devised and implemented?". Well, this question ignores the fact that people keep finding new kinds of problem to solve. It also forgets that we need to make our current software continue to work robustly and efficiently as new hardware and software infrastructures develop - we need our code to run on all the platforms and in all the environments that our customers use.
&lt;p&gt;
Making the NAG library work with a new compiler is always a non-trivial task (and sometimes it can seem more like a nightmare - just ask some of my colleagues!) It may be because we've got some code that's not yet been tested in a wide enough variety of environments. Or it may be because compiler optimization switches can reorder our code in ways that make the floating-point arithmetic behave in a way that we hadn't anticipated (which could be the compiler's fault or could be our fault, depending). But whoever is to blame, we have to fix it.
&lt;p&gt;
When you are dealing with complicated numerical codes, tracking down a problem might take a lot of hard work with a debugger (or with print statements if you're unlucky enough to be in an environment where a debugger just won't work). And, what look like even the simplest operations might turn out to be a lot more complicated than you'd expect.
&lt;p&gt;
As an example, take the method of dividing one complex number by another. Languages like Fortran have in-built support for complex numbers and complex arithmetic, but not all do, and so the NAG Library does contain some routines to help.
&lt;p&gt;
Performing a complex division is simple in principle. If the numbers are called X and Y, in general they are composed of real and imaginary parts, let's call them X.re and X.im, Y.re and Y.im. Then to compute the value Z = X / Y, just multiply both the top and bottom halves of the quotient by the complex conjugate of Y (i.e. the complex number you get when you negate the imaginary part of Y). Since we're multiplying the top and bottom by the same thing, there's no net effect on the answer, but the clever part is that when you multiply a complex number by its own conjugate, the answer is real. That means that Y * conjugate(Y) is real, and the complex division operation is reduced to an (easier) complex multiplication followed by a few real divisions. The complex multiplication is done by cross multiplying (in real arithmetic) the real and imaginary parts of X and Y, then adding and subtracting appropriate pieces to form the real and imaginary parts of the result. Counting all the floating-point operations up, this turns out to be 6 multiplies, 3 additions or subtractions, and 2 divides - a total of 11 operations - quite significant compared to a single real division, but still not a lot of work.
&lt;p&gt;
So - it can't be all that hard to get it right can it?
&lt;p&gt;
Wrong. We need to take some care here. For example, if the complex numbers X and Y are very large (and I'm talking about larger than you might ordinarily meet - say about the size of or bigger than the square root of the largest number you have on your computer), there's a chance that although the number Z = X / Y is a perfectly reasonable number, some of those intermediate 11 computations could cause arithmetic overflow. You'll get garbage as a result - not good. People are not happy if they divide a large number by itself and get something not equal to 1!
&lt;p&gt;
The implementation of complex division that had been in the NAG Library since the early 1970s took care to avoid unnecessary overflow and underflow by doing some cunning scaling and rearranging into 4 multiplies, 4 adds or subtracts, and 3 divides. The algorithm is documented here in the Mark 22 NAG Library Manual
&lt;a href="http://www.nag.co.uk/numeric/FL/nagdoc_fl22/pdf/A02/a02acf.pdf"&gt;&lt;p&gt;
nagdoc_fl22/pdf/A02/a02acf.pdf&lt;/a&gt;
&lt;p&gt;
and I'd never given it much thought - I always assumed this algorithm was fine.
&lt;p&gt;
Well, we recently discovered that the method used by routine A02AC was not as perfect as I'd thought! The reason? Old age, really. The algorithm was based on a method by Robert Smith, published in &lt;em&gt;Communications of the ACM&lt;/em&gt; way back in August 1962, and this had been developed in the dark days before the IEEE standard for floating-point arithmetic was designed in the 1980s (&lt;em&gt;Standard for Binary Floating-Point Arithmetic (IEEE 754-1985)&lt;/em&gt;).
&lt;p&gt;
The IEEE standard introduced the concept of &lt;em&gt;denormalized&lt;/em&gt; numbers - tiny but non-zero numbers which have less precision than regular numbers. It turned out that if you fed these into the NAG routine, you might still end up with garbage. For example, dividing the number X which has real and imaginary parts equal to the same denormalized number would return not the expected value 1, but a complex number composed of real part &lt;em&gt;infinity&lt;/em&gt; and imaginary part &lt;em&gt;NaN&lt;/em&gt; (NaN stands for "Not a Number"). Yuk.
&lt;p&gt;
Does it matter? Probably not much - not many people would call a NAG routine for something as "simple" as complex division (they'd rely on their compiler) and even if they did the chances are they would not be using denormalized numbers. But, a curse of working at NAG is that as soon as you find out about a problem like this you feel obliged to do something about it, and that's what my colleague Mat did. He located newer published methods which &lt;em&gt;did&lt;/em&gt; take account of denormalized numbers, by introducing extra scaling operations, and based a revised version of the NAG routine on one of those. I won't bore you with the details of it here - suffice it to say that the newer method is a bit more complicated, but deals with the problem nicely, and it will debut in the next version of the NAG Library.
&lt;p&gt;
This simple case illustrates that even for the most basic numerical software things can go wrong if you don't take care. Imagine what it's like for something complicated like the quadratic formula! (I'm only half joking - safely finding the roots of a quadratic equation takes a frighteningly large number of lines of code).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-2386399495165176763?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/2386399495165176763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/why-is-writing-good-numerical-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2386399495165176763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/2386399495165176763'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/why-is-writing-good-numerical-software.html' title='Why is writing good numerical software so hard?'/><author><name>Mick Pont</name><uri>http://www.blogger.com/profile/15149585002054415615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_dCVG_bqZucY/S3P_R_bC7xI/AAAAAAAAADc/weuU-FRfQRk/S220/MrPont.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-7152684603802323288</id><published>2010-06-03T13:43:00.012+01:00</published><updated>2010-06-03T16:34:19.454+01:00</updated><title type='text'>To people who provide technical support</title><content type='html'>After feedback from very satisfied NAG users, it seems to be high time to publicly appreciate the folks who work in front line technical support teams. To point out what great value they provide to customers, not just for NAG but across many software organisations worldwide. It is a very important job that involves much more than answering questions. It is about asking the right return questions and about careful communications. &lt;br /&gt;
&lt;br /&gt;
The idea of a TV detective springs to mind; working the crime scene at an upmarket golf club near Hollywood, with a smart party in the background&lt;em&gt;… image Detective Lt Colombo, in the clubhouse, picking his words with oh-so-much care, and asking questions in the most &lt;span class="goog-spellcheck-word"&gt;un&lt;/span&gt;-intimidating way. At the same time, he has four suspects lined up at the back of his mind and is waiting to discount each one as the facts of the case (&lt;/em&gt;or support problem&lt;em&gt;) are drawn out into the light.&lt;/em&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_YLOgWAR5pgU/TAej3VF_GMI/AAAAAAAAAAw/vTHsi96V1Ng/s1600/201005191423_225.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5478527642669881538" src="http://2.bp.blogspot.com/_YLOgWAR5pgU/TAej3VF_GMI/AAAAAAAAAAw/vTHsi96V1Ng/s200/201005191423_225.jpg" style="cursor: hand; height: 96px; width: 105px;" /&gt;&lt;/a&gt;Who at NAG? &lt;br /&gt;
------------ &lt;a href="http://3.bp.blogspot.com/_YLOgWAR5pgU/TAekNLwps_I/AAAAAAAAAA4/wMCTqKShmhc/s1600/columbob5%5B1%5D.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5478528018121602034" src="http://3.bp.blogspot.com/_YLOgWAR5pgU/TAekNLwps_I/AAAAAAAAAA4/wMCTqKShmhc/s320/columbob5%5B1%5D.jpg" style="cursor: hand; height: 90px; width: 103px;" /&gt;&lt;/a&gt; What! Not a doctor? &lt;br /&gt;
&lt;br /&gt;
The support job sounds easy to start with: When someone gets in touch with a support desk it is because they need help. But it needs special skills to uncover all the important details that provide the clues as to what is going wrong. The support role needs an ability to understand what the user is trying to achieve and the mechanisms he or she wants to use. It needs enough knowledge to be able to challenge the user’s ideas of how their own system or application should behave and it needs the balance of authority and diplomacy to work through the possible solutions. &lt;br /&gt;
&lt;br /&gt;
A little like the down at heel TV detective investigating the crime at the exclusive golf club, it is common for the person handling a support request to have no &lt;span class="goog-spellcheck-word"&gt;pre&lt;/span&gt;-knowledge about the user’s application or environment. So it can be a steep learning curve in support. But the rapid self-education in the user’s field can be critical to make for clear technical conversations. This is particularly so when communicating with NAG Library users, since they work in very many different industries and subject specialties. &lt;br /&gt;
&lt;br /&gt;
The final twist in the detective plot is often the most important. Here, unlike the TV detective who has to expose the evil perpetrator, the very best support people don’t really say that the user may have made any mistakes. Instead they leave the user with new and valuable knowledge and often a favoured contact that they are happy to turn to if they need real help again in the years to come. &lt;br /&gt;
&lt;br /&gt;
To end I need to be clear that this is not meant to suggest that support people are dishevelled, or that they dress badly (I am in no position to comment these subjects). And support teams actually do have an in-depth knowledge of many fields - at NAG these are the same type of people who develop the NAG library and provide all the detail support information &lt;a href="http://www.nag.co.uk/Forms/support.asp"&gt;http://www.nag.co.&lt;span class="goog-spellcheck-word"&gt;uk&lt;/span&gt;/Forms/support.asp&lt;/a&gt; and the diverse technical papers &lt;a href="http://www.nag.co.uk/doc/techrep/index.asp"&gt;http://www.nag.co.&lt;span class="goog-spellcheck-word"&gt;uk&lt;/span&gt;/doc/&lt;span class="goog-spellcheck-word"&gt;techrep&lt;/span&gt;/index.asp&lt;/a&gt; that help users make the best use of the NAG library every day. &lt;br /&gt;
&lt;br /&gt;
The analogy is intended to show how, like good detective work, the job is skilled, subtle and is critical. Many organisations are built on great support teams who provide astoundingly good help. Just listen to the users of NAG software saying – 'keep up the good work'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-7152684603802323288?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/7152684603802323288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/to-people-who-provide-technical-support.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7152684603802323288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/7152684603802323288'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/to-people-who-provide-technical-support.html' title='To people who provide technical support'/><author><name>David Cassell</name><uri>http://www.blogger.com/profile/17441197310547210157</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YLOgWAR5pgU/S44zlMqaGUI/AAAAAAAAAAM/uPwGnNagXkQ/S220/dcpic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_YLOgWAR5pgU/TAej3VF_GMI/AAAAAAAAAAw/vTHsi96V1Ng/s72-c/201005191423_225.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-5268273739467704280</id><published>2010-06-01T13:59:00.007+01:00</published><updated>2010-06-02T09:23:45.415+01:00</updated><title type='text'>NAG at ISC 2010</title><content type='html'>NAG is attending &lt;a href="http://www.supercomp.de/"&gt;International Supercomputing 2010&lt;/a&gt; in Hamburg, Europe's largest Supercomputing conference. Attendence is apparently at its highest ever and many of the sessions have been standing-room only. During Thomas Sterling's talk yesterday, on "Parallel Computing in the Years to Come", there were people sitting in the aisles and listening from outside in the corridor. &lt;a href="http://2.bp.blogspot.com/_usLO6eyAetE/TAUOgnv0kFI/AAAAAAAAAAw/9oRwWMOq4ac/s1600/ISC2010+003.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5477800475354239058" src="http://2.bp.blogspot.com/_usLO6eyAetE/TAUOgnv0kFI/AAAAAAAAAAw/9oRwWMOq4ac/s320/ISC2010+003.JPG" style="cursor: hand; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 480px;" /&gt;&lt;/a&gt; The conference starts with the announcement of the latest &lt;a href="http://www.top500.org/"&gt;Top 500 List&lt;/a&gt;, and the big news was that a Chinese system, Nebulae, was now number 2, behind Jaguar at Oak Ridge National Laboratory in the US. This is the second Chinese system to get into the top 10 and, like Tianhe-1, currently at number 7 in the list, it gets its performance from GPUs. In fact its theoretical peak performance is higher than Jaguar's, but it is hard to achieve that performance with existing software development tools. &lt;a href="http://2.bp.blogspot.com/_usLO6eyAetE/TAUPHV0t1xI/AAAAAAAAAA4/pOY0a3dsmYg/s1600/ISC2010+009.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5477801140557829906" src="http://2.bp.blogspot.com/_usLO6eyAetE/TAUPHV0t1xI/AAAAAAAAAA4/pOY0a3dsmYg/s320/ISC2010+009.JPG" style="cursor: hand; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 480px;" /&gt;&lt;/a&gt; GPUs are very much the flavour of the moment. There are some interesting new products for GPU programming, in particular both Allinea and TotalView have versions of their parallel debuggers for CUDA code. The NAG booth has been very busy and it seems that at least half the people who drop by are interested in our own &lt;a href="http://www.nag.co.uk/numeric/GPUs/"&gt;software for GPUs&lt;/a&gt;, currently available for beta testing. The feedbacks and suggestions for additional functionality will be a great help to us in bringing this product to market. The other interesting development in this area is that we're seeing increasing interest in software for OpenCL, largely due to the adoption of ATI cards. We'd love to hear from people who are using OpenCL and would like to make use of numerical components such as ours.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-5268273739467704280?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/5268273739467704280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/06/nag-at-isc-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5268273739467704280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/5268273739467704280'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/06/nag-at-isc-2010.html' title='NAG at ISC 2010'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_usLO6eyAetE/TAUOgnv0kFI/AAAAAAAAAAw/9oRwWMOq4ac/s72-c/ISC2010+003.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4167867560677707747</id><published>2010-05-27T13:54:00.000+01:00</published><updated>2010-05-27T13:54:28.699+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Documentation'/><title type='text'>NAG Toolbox for MATLAB Documentation: Features in Development</title><content type='html'>&lt;p&gt;The documentation for the &lt;a href="http://www.nag.co.uk/mb"&gt;NAG
Toolbox for MATLAB&lt;/a&gt; aims to integrate as far as possible with the
host MATAB environment and provide the same integrated documentation
experience as found with built in MATLAB functions.&lt;/p&gt;&lt;p&gt;MATLAB is itself in continuous development with a 6-month release
cycle. New features appear in the MATLAB GUI, and as far as possible
we try to use these features if it is possible to keep the
documentation working on all the versions of MATLAB that we support.&lt;/p&gt;
&lt;h2 id="funcbrowser"&gt;The Function Browser&lt;/h2&gt;
&lt;p&gt;One relatively new feature, &lt;a href="http://blogs.mathworks.com/desktop/2008/10/27/the-function-browser/"&gt;added at MATLAB release 2008b&lt;/a&gt; is the function browser. This is available in the help menu, or by pressing Shift-F1 (or equivalent keyboard shortcut, depending on platform and local customisation). It is
essentially a modified table of contents to (just) the function
reference pages, with built in search box and popup windows showing
abbreviated summary documentation.&lt;/p&gt;&lt;p&gt;
Currently the functions of the NAG Toolbox do not show up in this
function browser, however this has now been enabled in the development
builds and should, subject to final testing, be appearing in newer
releases of the toolbox scheduled for later in the year. the following
screenshot shows how it should look:&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_atYtnL7KtBk/S_5pW5EE3yI/AAAAAAAABqY/3NYpn2Vtz-E/s1600/matlab-function-browser2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atYtnL7KtBk/S_5pW5EE3yI/AAAAAAAABqY/3NYpn2Vtz-E/s320/matlab-function-browser2.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The screenshot shows the drop down function menu showing the
hierarchical table of contents for the NAG Toolbox functions, and a
popup help box showing a summary for c05aj that appears if the mouse 
hovers over that entry. These tooltips may be “torn off” the  function
browser in which case they stay in the GUI and can be positioned as
desired, this is shown by the summary for c05ad that is still
visible.&lt;/p&gt;&lt;p&gt;In order to make this work the function browser (apparently) looks
for certain named sections on the function's reference page, and so I
have had to change the section titles from being numbered to
unnumbered, &lt;b&gt;Purpose&lt;/b&gt;, &lt;b&gt;Syntax&lt;/b&gt;, &lt;b&gt;Description&lt;/b&gt; rather
than &lt;b&gt;1&amp;nbsp;Purpose&lt;/b&gt;, &lt;b&gt;2&amp;nbsp;Syntax&lt;/b&gt;, &lt;b&gt;3&amp;nbsp;Description&lt;/b&gt; as in the current documentation. The tooltip essentially shows the
&lt;b&gt;Description&lt;/b&gt; section. I should also note that while versions of
the function browser appeared in MATLAB 2008b, the internal details
were apparently different and at the time of writing, with the
development build, the NAG functions appear in  Function Browsers in MATLAB
versions starting from 2009b. (The screenshot is of MATLAB 2010a).&lt;/p&gt;
&lt;h2 id="docsearch"&gt;
&lt;p&gt;Improving the doc function&lt;/h2&gt;
One way of accessing the function reference page (html
documentation) is to open the help browser and then navigate the table
of contents or search to obtain the documentation for the function
required. This of course works for the NAG Toolbox as well as for
built in MATLAB functions. However when working on a function in the
command window, an alternative method of accessing documentation is
to use the &lt;b&gt;doc&lt;/b&gt; function. Unfortunately (for several MATLAB
releases) &lt;b&gt;doc&lt;/b&gt; is now documented as only working for MATLAB functions
built into MATLAB, or supplied in MathWorks Toolboxes. A command such
as &lt;code&gt;doc s18ad&lt;/code&gt; does not bring up the full html reference
page, but opens the help browser with a summary information derived
from the ASCII comments in the &lt;code&gt;s18ad.m&lt;/code&gt; file, which is the
information produced by the command &lt;code&gt;help
s18ad&lt;/code&gt;. Fortunately the &lt;b&gt;docsearch&lt;/b&gt; function does work, and
one useful by-product of NAG's function naming scheme is that
searching for the function name reliably returns the reference page as
the most relevant result, and the reference page is displayed in the
help browser. To make the &lt;b&gt;doc&lt;/b&gt; and &lt;b&gt;help&lt;/b&gt; information more
useful, an HTML link invoking MATLAB's &lt;b&gt;docsearch&lt;/b&gt; function has been
placed into the comments and so, as shown in the following screenshot,
in future, while  &lt;code&gt;doc s18ad&lt;/code&gt;  does not bring up the full
reference page, there is a hypertext link on the summary page that is
displayed that will invoke  &lt;code&gt;docsearch s18ad&lt;/code&gt; and so the
full reference page will be accessible with a single click.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/_atYtnL7KtBk/S_5phV9MVJI/AAAAAAAABqg/gvzDVKF8S5c/s1600/matlab-docsearch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atYtnL7KtBk/S_5phV9MVJI/AAAAAAAABqg/gvzDVKF8S5c/s320/matlab-docsearch.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Note that the phrase “NAG Toolbox Help Files” is now a
hyperlink, with the status bar showing that clicking on it will
activate the MATLAB command docsearch.&lt;/p&gt;
&lt;h2 id="future"&gt;Future Improvements&lt;/h2&gt;
&lt;p&gt;If you have any further ideas for improving the documentation or
integrating with currently unused features in the MATLAB GUI, please
do let us know!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-4167867560677707747?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/4167867560677707747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/05/nag-toolbox-for-matlab-documentation.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4167867560677707747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/4167867560677707747'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/05/nag-toolbox-for-matlab-documentation.html' title='NAG Toolbox for MATLAB Documentation: Features in Development'/><author><name>David Carlisle</name><uri>https://profiles.google.com/107847268022850354754</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-5fp4icqY6kI/AAAAAAAAAAI/AAAAAAAAAAA/iRCXBm3Y1Fo/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_atYtnL7KtBk/S_5pW5EE3yI/AAAAAAAABqY/3NYpn2Vtz-E/s72-c/matlab-function-browser2.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8577123754307835856</id><published>2010-05-18T21:14:00.006+01:00</published><updated>2010-05-26T16:06:41.333+01:00</updated><title type='text'>Reflecting on 40 years of software development</title><content type='html'>As regular readers of this blog will know, NAG celebrated its fortieth anniversary on May 13th with a series of informal talks during the day and a dinner party in the evening. Over 200 people - members, collaborators, current and ex-staff - took part in what was a thoroughly enjoyable day. Katie, our Marketing Communications Manager and Queen of the Blogosphere, put together an amazing &lt;a href="http://issuu.com/numericalalgorithmsgroup/docs/40_years_of_nag_scrapbook"&gt;scrapbook&lt;/a&gt; with photographs going back to the early days. Somebody commented to me that a healthy proportion of the pictures involve food and drink - I guess thats just the sort of Company that we are ☺. &lt;br /&gt;
&lt;br /&gt;
Talking to some of the older participants it was clear that - while computing has changed completely in the last four decades - many of the issues which faced the early NAG pioneers are still with us today. Portability remains a key concern, particularly since after a long period of relative stability we are seeing a great divergence in hardware and a smorgasbord of proprietary, non-standard mechanisms for parallel computing. How to satisfy users of different language has always been another issue. Its a little-known fact that the original aim of the NAG project was to produce an Algol 60 library and that the Fortran library that persists to this day was a secondary activity. Over the years we've produced libraries in Ada, Pascal, Fortran 90 and C, with only the latter still under active development. Alongside that work we've produced many bindings for other languages - the first work that I did for NAG was to produce C header files for the Fortran Library while a PhD student at the University of Bath. &lt;br /&gt;
&lt;br /&gt;
Another area where NAG has always been at the forefront is computer-generated documentation. When I first visited NAG more than twenty years ago most of the routine documents were produced on a golfball typewriter, although there were computer-readable versions maintained by Mike O'Donohoe at Cambridge University. His ingenuity at laying out complex mathematical formulae using only ASCII characters was quite astonishing! From there we adopted TSSD (a UK-developed contemporary of TeX), LaTeX, SGML and now XML from which we produce both pdf and HTML variants. &lt;br /&gt;
&lt;br /&gt;
I have a sneaking suspicion that when NAG hosts its fiftieth birthday in ten years time, some of these issues will still be causing us headaches. For every problem that is solved, another will arise. Last Thursday we reminisced about the days when RAM was measured in kilobytes and IEEE arithmetic had yet to be invented. In ten years we might find the idea of having only a single CPU on a computer quite quaint, and a new generation of functional programmers will struggle to understand what object-oriented languages are all about. Its hard to predict the future but, whatever the issues, I'm sure that NAG will be working hard to address them and to continue to deliver high-quality software to our customers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8577123754307835856?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8577123754307835856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/05/reflecting-on-40-years-of-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8577123754307835856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8577123754307835856'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/05/reflecting-on-40-years-of-software.html' title='Reflecting on 40 years of software development'/><author><name>Mike Dewar</name><uri>http://www.blogger.com/profile/03540770038835769036</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://4.bp.blogspot.com/_usLO6eyAetE/S1B-Q2nGcCI/AAAAAAAAAAM/vO7ucyRkgUs/S220/mcd.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-9067184953446147853</id><published>2010-05-13T10:51:00.005+01:00</published><updated>2010-05-13T11:23:47.407+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Impact of Architecture and Technology for Extreme Scale on Software and Algorithm Design'/><title type='text'>NAG's 40th Anniversary</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;
NAG might be 40 years old today but the office feels like we are having a 21st birthday party with a real buzz about the place. Absolutely amazed that Jack Dongarra is in the building and about to give a seminar on the Impact of Architecture and Technology for Extreme Scale on Software and Algorithm Design having travelled from the States just to attend our Anniversary celebrations. Hopefully the weather will hold till later when we have afternoon tea and Pimms after hearing from our founding Directors Brian Ford and Steve Hague on how they created NAG and made it the success it is today.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_i0peT_HmUfg/S-vSv_PgfWI/AAAAAAAAAEM/Etux_t8Yw68/s1600/Jack+Dongarra's+Presentation+2.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/_i0peT_HmUfg/S-vSv_PgfWI/AAAAAAAAAEM/Etux_t8Yw68/s400/Jack+Dongarra's+Presentation+2.JPG" width="400" wt="true" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Jack Dongarra Presenting at NAG's 40th Anniversary Open Day&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-9067184953446147853?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/9067184953446147853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/05/nags-40th-anniversary.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9067184953446147853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/9067184953446147853'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/05/nags-40th-anniversary.html' title='NAG&apos;s 40th Anniversary'/><author><name>Susan Shayler</name><uri>http://www.blogger.com/profile/06733162223866845760</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://3.bp.blogspot.com/_x0V4ZFGKjPg/S1RaB7WFtwI/AAAAAAAAAAU/mR3tWuUVE0s/S220/lakka_from_balcony.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_i0peT_HmUfg/S-vSv_PgfWI/AAAAAAAAAEM/Etux_t8Yw68/s72-c/Jack+Dongarra&apos;s+Presentation+2.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-3940476332875790713</id><published>2010-05-03T10:05:00.035+01:00</published><updated>2010-05-05T09:21:18.878+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='prize'/><category scheme='http://www.blogger.com/atom/ns#' term='University'/><category scheme='http://www.blogger.com/atom/ns#' term='student'/><category scheme='http://www.blogger.com/atom/ns#' term='Manchester'/><category scheme='http://www.blogger.com/atom/ns#' term='SIAM'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematical Finance'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Science'/><title type='text'>Congratulations NAG Prize 2010 Winners!</title><content type='html'>Last&amp;nbsp;week some of my colleagues attended the first &lt;a href="http://manchestersiamchapter.blogspot.com/2010/04/first-manchester-siam-student-chapter.html"&gt;Manchester SIAM Student Chapter conference&lt;/a&gt; at the University of Manchester. Going by the feedback it was a really good day with some great presentations by &lt;a href="http://www.nag.co.uk/about/shammarling.asp"&gt;Professor Sven Hammarling (NAG),&lt;/a&gt; Professor Bill Lionheart and Dr Oliver Dorn (both of the School of Mathematics, University of Manchester) as well as many student presentations - so well done to those who organised the event.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_i0peT_HmUfg/S9roEUky7YI/AAAAAAAAAEI/VA9peOXOlQA/s1600/Holden_Lucas_SIAM.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="208" src="http://2.bp.blogspot.com/_i0peT_HmUfg/S9roEUky7YI/AAAAAAAAAEI/VA9peOXOlQA/s320/Holden_Lucas_SIAM.jpg" tt="true" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;John Holden (centre) and Craig Lucas (right) chat to an attendee of&amp;nbsp;at the Manchester SIAM Student Conference&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
The NAG Student Prize was established in 2006 to recognise the long standing relationship NAG has with Manchester and reward the highest achieving students in maths and computation related courses. Mike Dewar, NAG Chief Technology Officer awarded this years&amp;nbsp;prizes at a ceremony later in the day.We’re delighted that this&amp;nbsp;years prizes go to Xiaolu Han and Michael Crabb for their outstanding work in the Mathematical Finance and Mathematics and Computational&amp;nbsp;Science MSc courses respectively. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_i0peT_HmUfg/S9rngYIOxdI/AAAAAAAAAEE/gePwI_LcWpY/s1600/NAG+Prize+Winners+2010.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="231" src="http://4.bp.blogspot.com/_i0peT_HmUfg/S9rngYIOxdI/AAAAAAAAAEE/gePwI_LcWpY/s400/NAG+Prize+Winners+2010.jpg" tt="true" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;NAG Prize 2010 Winners Xiaolu Han and Michael Crabb with Mike Dewar, NAG Cheif Technical Officer (centre)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Congratulations and well done to both Xiaolu and Michael.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-3940476332875790713?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/3940476332875790713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/05/congratulations-nag-prize-2010-winners.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3940476332875790713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/3940476332875790713'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/05/congratulations-nag-prize-2010-winners.html' title='Congratulations NAG Prize 2010 Winners!'/><author><name>Katie O'Hare</name><uri>http://www.blogger.com/profile/09366741271809330805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_i0peT_HmUfg/S1bVfzjngYI/AAAAAAAAACk/VCRfSRPJ7KQ/S220/ImageforGoogle.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_i0peT_HmUfg/S9roEUky7YI/AAAAAAAAAEI/VA9peOXOlQA/s72-c/Holden_Lucas_SIAM.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8970538095350937368</id><published>2010-04-29T13:32:00.006+01:00</published><updated>2010-04-29T14:42:19.112+01:00</updated><title type='text'>Waiting for software and school children</title><content type='html'>I spent a few hours with colleagues at a major national laboratory earlier this week talking about national security, the role of software and school children. On the surface, they would seem to have little connection but as I drove back to the office the connections started to form. I invite you to follow along.

In North America, Europe and other major economies throughout the world we spend huge sums of money in an attempt to detect and prevent national border intrusions and terrorist activities. In the process we've created a massive industry to x-ray, scan and monitor everything that moves in airports and elsewhere. In the process, we've put hundreds of thousand of people into jobs that apparently weren't needed 40 years ago, spent billions in taxes and worst of all, thrown sand into the gears of both business productivity and leisure time by a process ostensibly designed to keep us safe. We've created a huge "tax" in time and money when the real problem is to predict, detect and prevent a few "outlier" events from occurring.

My question: where's the software? Isn't the promise of software to be able to predict and detect things on which we have mind-numbing amounts of data? In some respects, the situation in security is much like the situation in HPC: the hardware is constantly evolving and relatively easy to buy and software is difficult and time-consuming to write, validate and document.

You were wondering where the children came in? Ah yes. While I had lunch in the lab's common dining area, two bus loads of primary school children on a field trip to the lab arrived to eat their lunch. No doubt they had spent the morning oohing and ahhing over particle accelerators and superconducting magnets. I couldn't help but think how we could get them interested in working on the software that is part of the fabric of modern society. Every time I go through the "remove coat, shoes, laptop, liquids, mobile phone and walk slowly through the scanner dance" I wonder if we in software will find a solution or if we'll have to wait for them to do it for us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8970538095350937368?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8970538095350937368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/04/waiting-for-software-and-school.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8970538095350937368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8970538095350937368'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/04/waiting-for-software-and-school.html' title='Waiting for software and school children'/><author><name>Rob Meyer</name><uri>http://www.blogger.com/profile/11112589116041169719</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Uqd-233klwg/S1NBTTWFRJI/AAAAAAAAAQc/8n8VjdYRnkA/S220/DCP_1606.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-674733330277046873</id><published>2010-04-22T12:21:00.007+01:00</published><updated>2010-04-24T17:30:27.168+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mex'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Plotting Lambert's W Function</title><content type='html'>For this post I wanted to come up with something a little easier on the eye than my previous offerings (&lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/02/loading-dtds-using-dom-in-python.html"&gt;Loading DTDs using DOM in Python&lt;/a&gt;, &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/02/colorised-svn-diffs.html"&gt;Colorised svn diffs&lt;/a&gt; and &lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/01/how-do-you-like-your-fortran-95.html"&gt;How do you like your Fortran 95 interfaces?&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Here you go:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XkFBNMSZvw4/S876aQzuJjI/AAAAAAAAABA/bh3l0bQ9enY/s1600/real.png" imageanchor="1" style="float: center; margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_XkFBNMSZvw4/S876aQzuJjI/AAAAAAAAABA/bh3l0bQ9enY/s320/real.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XkFBNMSZvw4/S876SwPEoUI/AAAAAAAAAA4/aMfnh-bfUUQ/s1600/imag.png" imageanchor="1" style="float: center; margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_XkFBNMSZvw4/S876SwPEoUI/AAAAAAAAAA4/aMfnh-bfUUQ/s320/imag.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XkFBNMSZvw4/S876NWrJAqI/AAAAAAAAAAw/O_okbatbhuo/s1600/abs.png" imageanchor="1" style="float: center; margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_XkFBNMSZvw4/S876NWrJAqI/AAAAAAAAAAw/O_okbatbhuo/s320/abs.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;I've been developing code for computing complex values of &lt;a href="http://en.wikipedia.org/wiki/Lambert_W_function"&gt;Lambert's W function&lt;/a&gt;, and I thought I'd share the Riemann-surface plots above, which are, from top to bottom, Re(W), Im(W) and abs(W) for the branches -1 (Blues), 0 (Greens) and 1 (Oranges). The route I've taken to get the plots has been a good learning experience for me.&lt;br /&gt;
&lt;h2&gt;First approach&lt;/h2&gt;My initial idea was to write a mex wrapper to my algorithmic Fortran code, along the lines of what happens for the &lt;a href="http://www.nag.co.uk/numeric/MB/start.asp"&gt;NAG Toolbox for MATLAB&lt;/a&gt;. I also wanted to see if I could provide a vectorized interface, as native MATLAB functions have.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whew, it's not much fun debugging mex files, is it?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main thing I learned from this experience was to use &lt;tt&gt;mxCreateNumericMatrix&lt;/tt&gt; to create my function's return values: in this case the W value, the residual error and the fail flag.&lt;br /&gt;
&lt;pre class="nag"&gt;&lt;span style="color: red;"&gt;/* prhs[2] is the array of input zs */&lt;/span&gt;
&lt;span style="color: forestgreen;"&gt;dims&lt;/span&gt; = mxGetDimensions(prhs[2]);
&lt;span style="color: forestgreen;"&gt;plhs&lt;/span&gt;[0] = mxCreateNumericMatrix(dims[0], dims[1], 
                                mxDOUBLE_CLASS,
                                mxCOMPLEX);

&lt;span style="color: blue;"&gt;if&lt;/span&gt; (nlhs &amp;gt;= 2)
{
  plhs[1] = mxCreateNumericMatrix(dims[0], dims[1],
                                  mxDOUBLE_CLASS,
                                  mxREAL);
  
  &lt;span style="color: #a020f0;"&gt;if&lt;/span&gt; (nlhs &amp;gt;= 3)
    {
      plhs[2] = mxCreateNumericMatrix(dims[0], dims[1],
                                      mxINT_CLASS,
                                      mxREAL);
    }

}
&lt;/pre&gt;Other approaches I had tried, such as populating local &lt;tt&gt;mxArray *&lt;/tt&gt;s which were only assigned back to the &lt;tt&gt;plhs&lt;/tt&gt; arrays at the end (and if required) caused all sorts of upset to MATLAB when it exited my mex routine.&lt;br /&gt;
&lt;br /&gt;
With the working code, I managed to get some good plots in a MATLABy way. I felt a little discontent though, and then I remembered the advice of my old (and sadly departed) A-level statistics teacher, about how it's better to be able to solve a problem two ways than one.&lt;br /&gt;
&lt;h2&gt;Second approach&lt;/h2&gt;I thought back to Mike Croucher's &lt;a href="http://www.walkingrandomly.com/?page_id=1662"&gt;PyNAG&lt;/a&gt; tutorials on calling the &lt;a href="http://www.nag.co.uk/numeric/CL/CLdescription.asp"&gt;NAG C Library&lt;/a&gt; from Python, and decided it might be fun to call my algorithmic Fortran code from Python and use &lt;a href="http://matplotlib.sourceforge.net/"&gt;matplotlib&lt;/a&gt; to do the plotting. While I was at it I decided I'd see if I could get Fortran 2003's C Interoperability to help me make the call to Fortran from Python more straightforward; in the 'unassisted' case, calling Fortran from Python is very similar to calling Fortran from C, with the usual headaches that entails.&lt;br /&gt;
&lt;br /&gt;
The primary hoop I had to jump through to allow C interoperability was to map Fortran character strings to arrays:&lt;br /&gt;
&lt;pre class="nag"&gt;...
   &lt;span style="color: #a020f0;"&gt;USE&lt;/span&gt;, &lt;span style="color: #a020f0;"&gt;INTRINSIC&lt;/span&gt; :: iso_c_binding, &lt;span style="color: #a020f0;"&gt;ONLY&lt;/span&gt; : c_char
   ...
   &lt;span style="color: forestgreen;"&gt;CHARACTER&lt;/span&gt; (kind=c_char), &lt;span style="color: #a020f0;"&gt;DIMENSION&lt;/span&gt; (6), &amp;
      &lt;span style="color: #a020f0;"&gt;INTENT&lt;/span&gt; (IN) ::&lt;span style="color: darkgoldenrod;"&gt; in_str&lt;/span&gt;
   &lt;span style="color: forestgreen;"&gt;CHARACTER&lt;/span&gt; (kind=c_char), &lt;span style="color: #a020f0;"&gt;DIMENSION&lt;/span&gt; (10), &amp;
      &lt;span style="color: #a020f0;"&gt;INTENT&lt;/span&gt; (OUT) ::&lt;span style="color: darkgoldenrod;"&gt; out_str&lt;/span&gt;
   &lt;span style="color: forestgreen;"&gt;CHARACTER&lt;/span&gt; (len=&lt;span style="color: #a020f0;"&gt;SIZE&lt;/span&gt;(in_str)) ::&lt;span style="color: darkgoldenrod;"&gt; local_in_str&lt;/span&gt;
   &lt;span style="color: forestgreen;"&gt;CHARACTER&lt;/span&gt; (len=&lt;span style="color: #a020f0;"&gt;SIZE&lt;/span&gt;(out_str)) ::&lt;span style="color: darkgoldenrod;"&gt; local_out_str&lt;/span&gt;
   &lt;span style="color: forestgreen;"&gt;INTEGER&lt;/span&gt; ::&lt;span style="color: darkgoldenrod;"&gt; i&lt;/span&gt;
   ...
   &lt;span style="color: #a020f0;"&gt;DO&lt;/span&gt; i = 1, &lt;span style="color: #a020f0;"&gt;SIZE&lt;/span&gt;(in_str)
      local_in_str(i:i) = in_str(i)
   &lt;span style="color: #a020f0;"&gt;END DO&lt;/span&gt;
   ...
&lt;span style="color: red;"&gt;!  Here's where all the real stuff happens. Operate on
!  local_in_str and local_out_str.&lt;/span&gt;
   ...
   &lt;span style="color: #a020f0;"&gt;DO&lt;/span&gt; i = 1, &lt;span style="color: #a020f0;"&gt;SIZE&lt;/span&gt;(out_str)
      out_str(i) = local_out_str(i:i)
   &lt;span style="color: #a020f0;"&gt;END DO&lt;/span&gt;

&lt;span style="color: #a020f0;"&gt;END&lt;/span&gt;
&lt;/pre&gt;Then with a similarly-vectorized and Pythonic wrapper around my Fortran call I generated the plots above using&lt;br /&gt;
&lt;pre class="nag"&gt;&lt;span style="color: #a020f0;"&gt;from&lt;/span&gt; mpl_toolkits.mplot3d &lt;span style="color: #a020f0;"&gt;import&lt;/span&gt; \
     Axes3D
&lt;span style="color: #a020f0;"&gt;from&lt;/span&gt; matplotlib &lt;span style="color: #a020f0;"&gt;import&lt;/span&gt; \
     cm
&lt;span style="color: #a020f0;"&gt;import&lt;/span&gt; matplotlib.pyplot &lt;span style="color: #a020f0;"&gt;as&lt;/span&gt; plt
&lt;span style="color: #a020f0;"&gt;import&lt;/span&gt; numpy &lt;span style="color: #a020f0;"&gt;as&lt;/span&gt; np

fig = plt.figure()
ax = Axes3D(fig)
n = 100
lower = -1
upper = -lower
threshold = 0.001
X1, Y1 = np.meshgrid(np.linspace(lower, upper, n),
                     np.linspace(lower, -threshold, n))
X2, Y2 = np.meshgrid(np.linspace(lower, upper, n),
                     np.linspace(threshold, upper, n))
cmaps = {-1: cm.Blues,
         0: cm.Greens,
         1: cm.Oranges}

&lt;span style="color: red;"&gt;# Loop over some branches
&lt;/span&gt;&lt;span style="color: #a020f0;"&gt;for&lt;/span&gt; b &lt;span style="color: #a020f0;"&gt;in&lt;/span&gt; [-1, 0, 1]:
    w = nag_LambertW(X1 + 1j*Y1, b=b, fail=1)[0]
    ax.plot_surface(X1, Y1, w.imag,
                    rstride=1, cstride=1, cmap=cmaps[b])
    w = nag_LambertW(X2 + 1j*Y2, b=b, fail=1)[0]
    ax.plot_surface(X2, Y2, w.imag,
                    rstride=1, cstride=1, cmap=cmaps[b])

plt.show()
&lt;/pre&gt;I had to do two separate subplots for each branch to avoid &lt;tt&gt;matplotlib&lt;/tt&gt; interpolating across the discontinuity at the branch cuts. Being a bit of a &lt;tt&gt;matplotlib&lt;/tt&gt; newb, I'm now wondering&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;is there a better way of telling &lt;tt&gt;matplotlib&lt;/tt&gt; to avoid discontinuities?&lt;/li&gt;
&lt;li&gt;is it possible to apply a colour map continuously across two subplots?&lt;/li&gt;
&lt;li&gt;doesn't &lt;tt&gt;plt.title('Title')&lt;/tt&gt; work with surface plots?&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-674733330277046873?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/674733330277046873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/04/plotting-lamberts-w-function.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/674733330277046873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/674733330277046873'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/04/plotting-lamberts-w-function.html' title='Plotting Lambert&apos;s W Function'/><author><name>Mat Cross</name><uri>http://www.blogger.com/profile/08674286575878583286</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_XkFBNMSZvw4/S1QkCVO4sfI/AAAAAAAAAAM/TN9xiYVFZdU/S220/Mineress.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XkFBNMSZvw4/S876aQzuJjI/AAAAAAAAABA/bh3l0bQ9enY/s72-c/real.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8659996498513876</id><published>2010-04-15T10:44:00.000+01:00</published><updated>2010-04-15T10:44:11.943+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='quality'/><category scheme='http://www.blogger.com/atom/ns#' term='SMP'/><category scheme='http://www.blogger.com/atom/ns#' term='multicore'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><title type='text'>New product launch = busy, but happy marketing department!</title><content type='html'>&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Today is an exciting day for NAG. The launch of the latest release of the &lt;/span&gt;&lt;a href="http://www.nag.co.uk/numeric/fl/FSdescription.asp"&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;NAG Library for SMP &amp;amp; multicore&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;, Mark 22.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;A new product launch (or release)&amp;nbsp;is always a busy time for any marketing department. Months of planning and preparing new literature, presentations, collating benchmark data, new advertising campaigns, exhibition stands etc, and then comes the fun part - announcing to the outside world.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;As with all marketing activities, there's a plethora of best practice guides in achieving&amp;nbsp;a successful product launch. Our goal in the marketing department at NAG&amp;nbsp;is to ensure that our news reaches every single&amp;nbsp;user, potential user and&amp;nbsp;specific media.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;How do we&amp;nbsp;achieve this goal?&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;The relatively recent emergence of&amp;nbsp;new communication&amp;nbsp;methods,&amp;nbsp;blogging, &lt;/span&gt;&lt;a href="http://www.twitter.com/NAGTalk"&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;microblogging&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt; and &lt;/span&gt;&lt;a href="http://www.linkedin.com/e/vgh/2707514/"&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;social media&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt; have transformed how we communicate with our audience and has made this launch different from those previous to it. What's so great about these new channels to market is that we can communicate and engage directly and instantaneously with those most important to us as an organisation. This is priceless.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Using these new methods in conjunction with more traditional marketing such as press releases and email blasts will serve to create some of the "buzz" that's needed to achieve early mindshare. However, even with the slickest of launch operations, if the product itself falls short of expectation and fails to impress then all the marketing effort is wasted.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Thankfully at NAG, our products reflect our reputation for quality and correctness. All new numerical routines have to undergo stringent quality checks. This vital testing process results in a portfolio of world-class products that simply wouldn't reach launch if they&amp;nbsp;weren't something we could&amp;nbsp;be proud of. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;The &lt;/span&gt;&lt;a href="http://www.nag.co.uk/numeric/fl/FSdescription.asp"&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;NAG Library for SMP &amp;amp; multicore&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt; launched on 15th April 2010. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8659996498513876?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8659996498513876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/04/new-product-launch-busy-but-happy.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8659996498513876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8659996498513876'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/04/new-product-launch-busy-but-happy.html' title='New product launch = busy, but happy marketing department!'/><author><name>Katie O'Hare</name><uri>http://www.blogger.com/profile/09366741271809330805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_i0peT_HmUfg/S1bVfzjngYI/AAAAAAAAACk/VCRfSRPJ7KQ/S220/ImageforGoogle.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-8561878022529247806</id><published>2010-04-09T17:20:00.004+01:00</published><updated>2010-04-10T11:55:39.023+01:00</updated><title type='text'>Scratch</title><content type='html'>&lt;p&gt;
How early can you be taught to program?  A thought that has struck me since my wife gave birth to our first born son a month ago.  There is no denying that the thought processes that have to be learnt in order to program are invaluable and transferrable abilities. Skills such as logical thinking, reasoning, planning, modularity, that are applicable in all forms of jobs not just ones involving programming.
&lt;/p&gt;
&lt;p&gt;
Having only learnt to program three years ago, I wish I had had more of a chance to program in my early years. So if ever my son is interested in programming I might start him off with a kids programming language called &lt;a href="http://scratch.mit.edu/"&gt;scratch&lt;/a&gt; that I heard about in a magazine.
&lt;/p&gt;
&lt;p&gt;
Scratch is a pictorial drag and drop language that feels a bit like lego in style.  Different types of variables are different shapes and only fit in the right shaped holes. It's not a very powerful language, but a good educational tool for the youngsters as it is easy to use, understand, and they can create a lot of fun interactive programs very easily.
&lt;/p&gt;
&lt;p&gt;
I’m all for encouraging young ones to learn useful skills, and who knows, these new prodigy scratchers may well be updating and maintaining the NAG library in years to come.
&lt;/p&gt;
&lt;p&gt;
&lt;object height="321" width="400"&gt;&lt;param name="movie" value="http://www.youtube.com/v/yPfkdzE0V34&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/yPfkdzE0V34&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="321" width="400"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-8561878022529247806?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/8561878022529247806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/04/scratch.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8561878022529247806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/8561878022529247806'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/04/scratch.html' title='Scratch'/><author><name>Nathaniel</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-1994241734843955736</id><published>2010-04-01T17:47:00.014+01:00</published><updated>2010-04-07T10:58:53.457+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='quasirandom'/><category scheme='http://www.blogger.com/atom/ns#' term='random numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='pseudorandom'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo'/><category scheme='http://www.blogger.com/atom/ns#' term='option pricing'/><title type='text'>Easter egg or not?</title><content type='html'>&lt;meta content="text/html; charset=utf-8" equiv="Content-Type"&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;meta content="Microsoft Word 12" name="Generator"&gt;&lt;meta content="Microsoft Word 12" name="Originator"&gt;&lt;link href="file:///C:%5CUsers%5CMarcin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;style&gt;
 &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink 	{mso-style-priority:99; 	color:blue; 	mso-themecolor:hyperlink; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:612.0pt 792.0pt; 	margin:72.0pt 72.0pt 72.0pt 72.0pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; 
&lt;/style&gt;Hi, I'm Marcin, technical support engineer here at NAG and I've recently encountered an interesting problem. I coauthored a recent paper on option pricing with the NAG Library (&lt;a href="http://www.nag.co.uk/IndustryArticles/NAGOptionPricingExcel.pdf"&gt;Option pricing in Excel&lt;/a&gt;). My coauthor Jeremy&amp;nbsp;subsequently blogged about it (&lt;a href="http://thenumericalalgorithmsgroup.blogspot.com/2010/03/extending-imitating-and-collaborating_18.html"&gt;Extending, imitating and collaborating&lt;/a&gt;). Now it’s time for the next step. &lt;br /&gt;
&lt;br /&gt;
While working on a demonstration of NAG random number generators in Excel and their application in option pricing using the Monte Carlo method I noticed a considerable discrepancy in results while using unscrambled Sobol quasirandom numbers. Well, to start with, how do you price a European option when the underlying asset follows geometric Brownian motion? Basically for each random number you simulate what the price of the asset will be in, say T=1 year, moving in one step from the starting time point t=0 to the end point t=T, calculate the payoff, and the average value of all payoffs will be our desired option price (&lt;a href="http://en.wikipedia.org/wiki/Monte_Carlo_methods_for_option_pricing"&gt;Monte Carlo methods for option pricing&lt;/a&gt;). I’m not going to get into the details of Monte Carlo method, that will be covered&amp;nbsp;in a paper I'm currently working on. The idea is that this simulation works very well and gives good convergence to the result obtained using the close-form formula, no surprises here. The stock prices have log-normal distribution, as expected. This is illustrated in the figure below. This histogram groups the stock prices from 20000 simulations.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_6PyYVdaBhFw/S7TP2efLK0I/AAAAAAAAABU/mc8z84-vdTw/s1600/hist1.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5455213583456217922" src="http://3.bp.blogspot.com/_6PyYVdaBhFw/S7TP2efLK0I/AAAAAAAAABU/mc8z84-vdTw/s400/hist1.bmp" style="cursor: pointer; display: block; height: 283px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
One could however want to price Asian options, which are path-dependent. The payoff of such options depends not on the final price of the asset (as in European options), but on the average price of the asset throughout the life of the option. We therefore need to generate a path of stock prices, so we’ll move from t=0 to t=T not in one step as previously, but in many steps, say 252 (this is the average number of trading days per year). In practice we generate 252 random numbers, generate a path of the asset price and for the final step we calculate the payoff. This is done for every Monte Carlo simulation, so as you’ve probably noticed we need 252 times more random numbers than in case of the European option. The quantity is not an issue, the Sobol sequence is long enough. What happens is that in case of such pathwise Monte Carlo simulation the distribution is not log-normal, it doesn’t actually resemble any distribution, as can be seen below.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_6PyYVdaBhFw/S7TQXNm-ZyI/AAAAAAAAABc/6iy8EHl9CLQ/s1600/hist2.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5455214145861216034" src="http://1.bp.blogspot.com/_6PyYVdaBhFw/S7TQXNm-ZyI/AAAAAAAAABc/6iy8EHl9CLQ/s400/hist2.bmp" style="cursor: pointer; display: block; height: 284px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Why is that? Why do the quasirandom numbers fail? The simulation using the same data, but pseudorandom numbers instead of quasirandom, does return stock prices that are log-normally distributed (below). &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_6PyYVdaBhFw/S7TSfUkyCMI/AAAAAAAAABs/B1I7upQSgtQ/s1600/hist3.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5455216484193274050" src="http://2.bp.blogspot.com/_6PyYVdaBhFw/S7TSfUkyCMI/AAAAAAAAABs/B1I7upQSgtQ/s400/hist3.bmp" style="cursor: pointer; display: block; height: 272px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
What is going on here? Well, I know the answer, it took me some time to realise, and it would have taken more time if not the help of my colleagues Jacques and Robert. Do you, dear reader of this blog, know why it is like this? Is this just an easter egg, or an interesting property of quasirandom numbers? Happy Easter! &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-1994241734843955736?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/1994241734843955736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/04/easter-egg-or-not.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1994241734843955736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/1994241734843955736'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/04/easter-egg-or-not.html' title='Easter egg or not?'/><author><name>Marcin Krzysztofik</name><uri>http://www.blogger.com/profile/18261558624689201066</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_6PyYVdaBhFw/S1RmqpcRTCI/AAAAAAAAAAM/e0nyrnucwPU/S220/pic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_6PyYVdaBhFw/S7TP2efLK0I/AAAAAAAAABU/mc8z84-vdTw/s72-c/hist1.bmp' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-177308344146798686</id><published>2010-03-24T10:41:00.003Z</published><updated>2010-03-25T09:17:12.853Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran Standards'/><category scheme='http://www.blogger.com/atom/ns#' term='Compiler'/><category scheme='http://www.blogger.com/atom/ns#' term='NAG'/><category scheme='http://www.blogger.com/atom/ns#' term='Malcolm Cohen'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Pascal'/><category scheme='http://www.blogger.com/atom/ns#' term='Numerical'/><category scheme='http://www.blogger.com/atom/ns#' term='Fortran'/><title type='text'>My early career at NAG…</title><content type='html'>&lt;div&gt;
“Don’t worry you’ve done a mathematics and finance degree and have an engineering masters and you’ve programmed in &lt;a href="http://en.wikipedia.org/wiki/Pascal_(programming_language)"&gt;Pascal&lt;/a&gt; and can write &lt;a href="http://en.wikipedia.org/wiki/Visual_basic"&gt;VB&lt;/a&gt; macros you’ll be just fine.” &lt;br /&gt;
&lt;br /&gt;
“You’ve far more technical experience than any previous sales persons (the last manager used to sell used cars!). If you’re not careful you’ll end up in the technical division.” &lt;br /&gt;
&lt;br /&gt;
Well with such resounding support and confidence from my manager how could I fail? Buoyed by a good track record at previous companies I now felt less daunted by this technology shift… industrial and electronic weighing scales to telecoms to numerical software… what could be more natural? &lt;br /&gt;
&lt;br /&gt;
Thinking about my days selling weighing scales, I can recall a previous manager, &lt;a href="http://en.wikipedia.org/wiki/John_Ruskin"&gt;John Ruskin Utley&lt;/a&gt;’s wise words (that isn’t quite his real name, in fact I suspect his middle name didn’t even begin with R). &lt;br /&gt;
&lt;br /&gt;
“Listen to your customers, listen to your distributors/resellers and ensure those in technical development get the market feedback. Rest assured laddy if you don’t hit your sales target and you blame the product those in development will be asking why you didn’t communicate what you wanted when you had the chance.” &lt;br /&gt;
&lt;br /&gt;
What’s so complicated about weighing scales I hear you ask? Let me give you a simple example… in 1998 £1 = 380,000 Turkish lira… clearly an electronic supermarket scale in Turkey is going to have the capability to display a few more digits than an electronic weighing scale in England! &lt;br /&gt;
&lt;br /&gt;
How does this all relate to NAG? Well it’s all about listening to customers and distributors and feeding back market needs or not as you will see! &lt;br /&gt;
&lt;br /&gt;
One of my first overseas trips for NAG was to one of our European distributors (who have now changed ownership and sales staff). Giving the distributor’s sales manager a hard time about lack of sales we chatted through the NAG product portfolio. “Give me your &lt;a href="http://en.wikipedia.org/wiki/SWOT_analysis"&gt;SWOT&lt;/a&gt; analysis on our products” I prompted. Distributor said “Well I can’t sell the &lt;a href="file:///C:/Users/johnh.NAGNTD/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/OLKB904/1562_001.pdf"&gt;compiler&lt;/a&gt; as the users complain that it throws up too many error messages and won’t allow them to compile their code.” &lt;br /&gt;
&lt;br /&gt;
“I’ll get to the bottom of this”, I said firmly. “Let me feed this back to technical management. I’m sure they’ll want to fix this especially if it is impacting the reputation of our product and limiting sales.” &lt;br /&gt;
&lt;br /&gt;
Tee hee, ha ha. Well you can imagine the reaction of my technical colleagues. Oh how they must have laughed. &lt;br /&gt;
&lt;br /&gt;
The &lt;a href="http://www.nag.co.uk/nagware/NP.asp"&gt;NAG Fortran Compiler&lt;/a&gt; is the world’s best checking compiler. Clearly my distributor’s client was an inexperienced programmer probably used to programming with a compiler that had limited error checking capabilities. Of course the distributor (and enthusiastic salesmen = me) were subsequently given training about compilers generally and in particular the NAG Fortran Compiler. &lt;br /&gt;
&lt;br /&gt;
“How fast do you want the wrong answer?” Well I get it now… fast code is only any good if the answer is correct. &lt;a href="http://www.nag.co.uk/numeric/numerical_libraries.asp"&gt;NAG's Numerical Libraries&lt;/a&gt; are very much based on the philosophy… Accuracy first Performance second Of course many of you will know and be grateful that NAG generally achieve both. &lt;br /&gt;
&lt;br /&gt;
A few more anecdotes about compilers. Ian Chivers, &lt;a href="http://www.rhymneyconsulting.co.uk/index.html"&gt;Rhymney Consulting&lt;/a&gt; and &lt;a href="http://www.fortranplus.co.uk/"&gt;Fortranplus&lt;/a&gt; (known Fortran specialist) once told me “of course any decent programmer has at least two compilers. The NAG Fortran Compiler for checking and perhaps another for comparison or perhaps speed.” &lt;br /&gt;
&lt;br /&gt;
Finally some background behind the NAG Fortran Compiler, NAG developed this in its early days of Numerical Library development not because NAG wanted to become a compiler company, but because the compilers available were inadequate to build accurate, robust numerical libraries and by producing our own we were able to advance the Fortan language. In fact NAG produced the world’s first Fortran 90 compiler and still keeps pace with the latest &lt;a href="http://www.nag.co.uk/SC22WG5/"&gt;Fortran Standards&lt;/a&gt; with lead developer &lt;a href="http://www.nag.co.uk/about/mcohen.asp"&gt;Malcolm Cohen&lt;/a&gt; playing an active role in the Fortran Standards committee. &lt;br /&gt;
&lt;br /&gt;
Well that’s quite enough from me in my first blog. More stories from an enthusiastic salesmen next time ;-) &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1352688022620133175-177308344146798686?l=blog.nag.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.nag.com/feeds/177308344146798686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.nag.com/2010/03/my-early-career-at-nag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/177308344146798686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1352688022620133175/posts/default/177308344146798686'/><link rel='alternate' type='text/html' href='http://blog.nag.com/2010/03/my-early-career-at-nag.html' title='My early career at NAG…'/><author><name>John</name><uri>http://www.blogger.com/profile/09521247782713845625</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_F4pWYcpsEU8/S3PZIqwAuZI/AAAAAAAAAAM/jPRRBw6gSE8/S220/JohnPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1352688022620133175.post-4780371010711927313</id><published>2010-03-23T16:23:00.003Z</published><updated>2010-06-17T12:00:44.911+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><title type='text'>What’s the next revolution in technical computing?</title><content type='html'>It’s a question that absorbs the attention of the technical computing community, especially those working at the leading edge of technology and performance (&lt;span style="font-style: italic;"&gt;high performance computing, HPC&lt;/span&gt;). &lt;span style="font-weight: bold;"&gt;What is the next disruptive technology? &lt;/span&gt;In other words, what is the next technology that will replace a currently dominant technology? Usually a disruptive technology presents a step-change in performance, cost or ease-of use (or a combination of these) compared to the established technology. The new technology may or may not be disruptive in the sense of discontinuous change in user experience.
&lt;br/&gt;&lt;br/&gt;
&lt;span style="font-weight: bold;"&gt;Why is identifying disruptive technology so important? &lt;/span&gt;First, those who spot the right change early enough and deploy it effectively can attain a significant advantage over competitors as a result of a substantial improvement in technical computing capability or reduction in cost. Second, identifying the right technology change in time can help ensure that future investments (whether software engineering, procurement planning, or HPC product development) are optimally spent.
&lt;br/&gt;&lt;br/&gt;
However, in a field as fast moving as technical computing, spotting the next disruptive technologies of specific relevance to your individual needs can easily become a full time activity (which is why NAG helps to do this for others).
&lt;br/&gt;&lt;br/&gt;
One very credible candidate for disruptive change in HPC right now is &lt;a href="http://www.hpcwire.com/features/NVIDIA-Shifts-CUDA-Into-Third-Gear-88863677.html"&gt;GPU computing&lt;/a&gt; (or related products that might be in development). However, at &lt;a href="http://hpcc-usa.org/"&gt;the Newport conference &lt;/a&gt;recently, the discussion turned to what the next disruptive technology to hit HPC would be (after the possible GPU disruption). One suggestion, made by John West (of &lt;a href="http://www.insidehpc.com/"&gt;InsideHPC &lt;/a&gt;fame), was that &lt;span style="font-weight: bold;"&gt;the next disruptive technology could be in software&lt;/span&gt;, especially programming tools and interfaces. This builds on the fact that parallel computing is no longer a specialist activity unique to the HPC crowd – &lt;span style="font-weight: bold;"&gt;parallel processors are becoming pervasive across all areas of computing &lt;/span&gt;from embedded to personal to workgroup technical computing. Parallel programming is thus heading towards a mass market activity – and the mass market is unlikely to view what we have in HPC currently (&lt;a href="http://www.hector.ac.uk/cse/training/"&gt;Fortran plus MPI and/or OpenMP&lt;/a&gt;, or limited to
