The Benefits of Using Rigorously Tested Routines from Numerical Libraries-- Computer Science Edition", written by the CEO of the worldwide Numerical Algorithms Group, a unique not-for-profit organization at the cutting edge of computer science .
1. The Benefits of Using Rigorously Tested
Routines from Numerical Libraries
By Rob Meyer, Numerical Algorithms Group
Executive Summary—This white paper –“The Benefits of Using
Rigorously Tested Routines from Numerical Libraries—Computer
Science Edition” speaks to matters affecting computationally-intensive
application development. To the extent that software engineers and IT
specialists’ work involves significant numerical computation, it is timely to re-
examine how computational frameworks are or are not designed for maximum
performance.
Although many have long relied on pre-packaged software for many routine
tasks, new areas of research have often outpaced these pre-packaged
offerings. Concomitantly, whether realized or not, nearly every business is
working in a computational infrastructure that employs multicore processors
that significantly SLOW performance of legacy applications originally
developed for single processor computing environments.
Performance gains today, by and large, are no longer accessible through
hardware upgrades—the historic path taken by commercial enterprises of all
kinds through the decades. Now we have entered a period where investment
in software, not hardware, may matter more and a re-examination of the
computational infrastructure at work is extremely relevant.
“The Benefits of Using Rigorously Tested Routines from Numerical
Libraries—Computer Science Edition” will provide a framework for
understanding how commercially available numerical libraries can be a
powerful tool to manage today’s IT and software development challenges,
including discussion of:
-commercially available numerical libraries vs. numerical code developed in-
house
-commercially available numerical libraries vs. open source code
-quality control— validation and testing issues
-future-proofing— costs of migrating to newer computational platforms such
as GPU or HPC environments
-future proofing—the value of library documentation vis-à-vis an application’s
entire lifecycle and the given of staff turnover
-tips on real-world trials to determine ability of numerical libraries to speed
application development
2. For more information including answers to more specific questions on the
suitability of the NAG Library algorithms to particular research areas, contact
David Cassell, NAG Library Specialist, at david.cassell@nag.co.uk.
-----------
How would you feel if, after latest hardware because they are
devoting weeks or months to using applications coded for use on
application development, you found a single processor when the new
that your application produced hardware is equipped with a
incorrect or unreliable results? multicore chip. Counter-intuitively,
hardware that could potentially
The use of rigorously tested speed processing time by orders of
routines from numerical libraries magnitude may be responsible for
has long been a proven way to significantly slowing down many
speed application development and applications. These organizations
performance. Recent then experience significant bottom
developments in processor design line impact without realizing why
and computational science this is occurring. The issue for
suggests that their use should which they are unprepared is that
become even more widespread. programming a multicore computer
This is because very few is more complex than software
application developers have the development on a single processor
expertise or time to assess and system.
understand the implications of the
rapidly evolving computing Numerical libraries have always
infrastructure on their work. As a been the preferred mechanism by
consequence, they may not obtain which sophisticated technical
the best runtime performance or application developers could
consistent accuracy from their readily incorporate mathematical
codes. and statistical functionality within
their applications. Today these
We have entered a period where libraries offer a new opportunity to
investment in software, not organizations in that they provide a
hardware, matters most. convenient way to access the true
power of multicore systems.
The advent of multicore processors
is responsible for this. Traditionally Why is this so?
performance improvements were
largely attributable to the use of Custom developed numerical code,
faster clocked processors. for use in a specific application, can
However in the multicore be incredibly time consuming to
environment the clock speed of produce and also the most costly
each core is now slower and hence strategy in the long term. Such
application performance will code may take a long time to
decrease unless more than one develop because of the
core can be utilized. Many complexities of designing the best-
organizations may therefore notice match algorithmic approach
degradation in application appropriate to the solution of the
performance when they deploy the specific problem and the difficulty
3. of encoding that algorithm in an to choose between different
accurate and stable numerical hardware platforms and
manner. Then, the very fact that it programming languages to best
is being written for one current take advantage of the particular
application suggests that the characteristics of hardware and
developers may not consider the software available but still have
possibility of extended numerical confidence in any results produced.
requirements and therefore may
not include the flexibility and The individual numerical methods
documentation vital to enable the used in diverse fields such as
next advance for the product or the modelling, research, analytics,
next development project. design, exploration, financial
engineering and product
It can be argued that free development must constantly
algorithms, available from the evolve as well. This is because
Internet, can provide an alternative new, more reliable algorithms that
to commercially available numerical are efficient generally or on specific
libraries. Unfortunately support, hardware configurations are
constantly being
developed. Indeed
some routines that
were considered
state-of-the-art only
a few years ago are
thought to be very
inefficient by today’s
standards.
Developers of
numerical libraries
are constantly
striving, through
maintenance and rigorous testing algorithmic
of these sources is at best innovations, to provide problem-
unpredictable and therefore the solving software that is appropriate,
user of such software is, perhaps efficient and robust on the wide
unwittingly, risking the long term range of computing platforms used
viability of their application. The risk at the time by the technical
incurred may be acceptable, in the computing community. In this way
short term, for non-critical their work continually replenishes
applications but as new computing the contents of numerical libraries
architectures emerge this risk with new material and improved
increases significantly and may techniques and makes these
prevent optimal, or any, use of the libraries available on the hardware
code in the longer term. of choice.
This latter point is important as, at Going forward a few years another
any given point in time, multiple widespread shift in the normal
differing computing environments technical computing architecture is
can be utilized by a single widely predicted. This shift will
organization. They want to be free have a similar range
4. hardware and software systems
of ramifications to the current and still maintain the efficacy of
migration from single to multicore, their legacy code, and the many
namely the move to manycore 1 or thousands of “person-hours” that it
GPU 2 computing. This scenario embodies, as they move forward.
vividly illustrates the major problem
faced by organizations – Another advantage of selecting
investment in development of algorithms from comprehensive
specialist code for a specific numerical libraries is that when
computing architecture may have a developers require access to a
short lifespan before it is obsolete. different technique it may well
In this changing environment most already be available in a tried and
organizations ought not to try to tested form that they can rely on.
justify such a cost when there are This is because numerical library
off-the-shelf alternatives produced developers are often assisting
by numerical software specialists. researchers at the cutting edge,
developing methods applicable to
The combination of the above one area of research but that, over
factors put organizations that use time, may well be applicable in the
the tried and tested algorithms from wider spheres of science,
commercial numerical libraries as engineering and business
the building blocks of their analytics.
applications, at a competitive
advantage. Developers can more Consider as an example the
readily migrate codes to new inclusion, in a release of the
Numerical Algorithms Group (NAG)
1
A manycore processor is one in which Library, of functions for wavelet
the number of cores is large enough that transforms. Wavelet techniques 3
traditional multi-processor techniques are are used in image processing and
no longer efficient. It is the generation
beyond multicore.
2 3
A GPU is a Graphical Processing Unit.
General Purpose GPUs are well suited for http://www.nag.co.uk/numeric/FL/nagdoc_f
running some numerical algorithms. l22/xhtml/C09/c09conts.xml#C09
5. for seismology and astrophysics.
Do they come to bear on other
areas of technical computing? Well
yes – they are already used in the
finance industry. Such cross-
fertilization from one engineering or
science discipline to another is a
well-established pattern of how
breakthroughs occur.
The extent to which numeric
libraries provide extensive
documentation also confers a
competitive advantage to users of
these libraries, especially when one provide a simple mechanism by
considers the full lifecycle of the which this can be achieved. For
technical application being example, the NAG Library
developed. For example, there are documentation employs a decision
often numerous ways that, tree structure, a tool familiar to
superficially, appear to give a computing professionals, to
developer some means to solve a establish the precise definition of
the problem to be solved. This
leads the user to routines most
appropriate to the actual problem.
In some areas of numerical
computation, though, it is not
possible to identify just one method
that is most suitable for the solution
of a problem. In these areas the
best solution is arrived at via an
iterative process whereby different
techniques are applied to the
problem and the best selected from
the experimental evidence. Having
access to a range of algorithmic
techniques, using similar
interfaces, to enable this
particular problem. In practice not
experimentation can therefore be
all of these potential approaches
critical. The best numerical libraries
are effective, accurate or efficient
provide these facilities to cater to
when applied to a specific problem.
this development paradigm.
The ability to select an appropriate
algorithm for the task in hand is
Finally, of course, the quality of the
therefore vital if the developer and
routines provided by a commercial
his organization wants timely
numerical library remains
results that can be relied upon. The
paramount. As an example, a good
detailed and refined documentation
quality local optimization code,
associated with well-established
especially one that enables
commercial numerical libraries
constraints on the variables, is
6. dauntingly long and tricky to write engineering support to some of the
and can run into thousands of lines world’s leading high performance
of code. If that were a custom computing centres.
source then the initial development
constitutes only a small part of the Researchers worldwide,
overall cost. Other factors, such as collaborating with the NAG
testing, error correction and technical team, help provide
general support, which can be regular updates and in-depth
guaranteed when using a support for the NAG Library. This
commercial offering, must also be activity provides valuable insight
taken into account. into emerging requirements for new
research in computer science and
One highly regarded library, the numerical methods. The result is
NAG library 4, is continuously one of the world’s most reliable
maintained and expanded by the collections of numerical algorithms,
Numerical Algorithms Group including well over 1600 user-
(NAG). The Numerical Algorithms callable functions.
Group (NAG, www.nag.com), is a
not-for-profit numerical software General purpose numerical
development organization, with libraries, such as the NAG Library,
offices around the world, founded contain proven routines that
four decades ago that collaborates provide access to unrivalled
with world-leading researchers and functionality covering a broad
practitioners in academia and spectrum of numerical and
industry to, among other projects, statistical methods on a wide range
create a rigorously tested set of of computing platforms. Users can
mathematical and statistical readily utilize these techniques
routines. from their own programs and have
complete confidence in the results
The routines in the NAG Library returned enabling them to speedily
can be called from a wide range of develop sophisticated applications.
programming languages and are
relied on by those working in C++, It is a straightforward task for
C#, F#, FORTRAN, MATLAB, R, organizations to investigate the
Maple and other environments. potential benefits offered by
NAG routines are also tuned for reputable numerical libraries. For
use on multicore and parallel example, the mathematical and
systems by employing standard statistical library of the Numerical
conforming techniques in order to Algorithms Group can be used on a
provide high performance while still trial basis. Simply get in touch with
maintaining the best algorithmic NAG
accuracy and stability. In addition, (http://www.nag.com/contact_us.as
NAG’s wealth of knowledge in the p) to find out which components of
high performance arena is the NAG library will most help your
recognized by the fact that it is work.
contracted to provide
computational science and
4
http://www.nag.co.uk/numeric/numerical_li
braries.asp
7. Readers of “The Benefits of Using Rigorously Tested Routines from
Numerical Libraries—Computer Science Edition” may also be interested
in the following case studies:
Parallel algorithms at Queen's University, Ontario - Why the NAG Library for
SMP & Multicore?
http://www.nag.com/Market/articles/parallel_algorithms.pdf
NAG's HECToR dCSE Team Quadruple Performance of Quantum Monte-
Carlo Application - CASINO
http://www.nag.com/Market/articles/dCSE_Report_CASINO.pdf
Rapidly develop an application for forecasting from NAG routines - CACI finds
it easy
http://www.nag.com/Market/articles/CACI_Case_Study.pdf
ZS Associates use the NAG Library for data analysis when guiding hundreds
of millions of dollars of marketing expenditure
http://www.nag.com/Market/articles/zs_associates.pdf
-30-
Rob Meyer is CEO of the worldwide Numerical Algorithms Group
(www.nag.com). The Numerical Algorithms Group (NAG, www.nag.com), is a
worldwide not-for-profit numerical software development organization founded
four decades ago that collaborates with world-leading researchers and
practitioners in academia and industry. With offices in Manchester, Chicago,
Tokyo and Taipei, and a worldwide distributor network, NAG provides high-
quality computational software and high performance computing services to
tens of thousands of users, from Global 500 companies, major learning
academies, the world’s leading supercomputing centers, numerous
independent software vendors and many others.