06 August 2008

ImageMagick crops your white space!

ImageMagick is a fabulous command-line tool for image processing. I use it a lot for converting between different image formats, which it does with no fuss whatsoever -- as the following PNG to PDF example illustrates:

$ convert in.png out.pdf

ImageMagick can do much, much more than conversions. Today I learned the following trick from an
e-mail list discussion:

$ convert -trim img.pdf

which trims all the white space from around an image. It's a great trick for inserting Matlab plots into papers! I used to do this by hand with an image editing program like the GIMP; it's great to know that I don't have to fire up such a massive tool in order to accomplish this simple task. (The GIMP is a wonderful program, incidentally, but starting it up just to crop some white space is a task beneath its mighty powers.)

05 August 2008

New version of ECL is out

A new version of Embeddable Common Lisp (ECL) is out!!! I use ECL in my projects to support Lisp as an embedded scripting language in large C-based projects. ECL's chief developer (Juan Jose Garcia Ripoll) is amazingly responsive, which makes the library a pleasure to use. Yay ECL!!!

30 June 2008

(Pseudo)random numbers matter


The newly released LAPACK Working Note #206 gives yet another reason why generating good pseudorandom numbers matters:


In May 2007, a large high performance computer manufacturer ran a twenty-hour long High Performance Linpack benchmark. The run fails with the following output:

|| A x - b ||_oo / ( eps * ||A||_1 * N ) = 9.22e+94 ...... FAILED


What happened was that the benchmark's matrix generator uses a lame linear congruential pseudorandom number generator, which causes generated matrices to have repeated columns for certain unfortunate choices of matrix dimension. This of course makes one wonder why the generator doesn't just make a matrix which is known to be invertible, say, by generating a sufficiently nonzero diagonal matrix and hitting it on both sides with orthogonal transforms until the zeros are filled in. Regardless, the bug meant 20 hours of very expensive, intensely power-consuming supercomputer time were wasted on computing the wrong answer to a problem which at such sizes very few people need to solve. So, random numbers do matter ;-)

26 June 2008

Contemplation leads to messes

I like to make espresso using one of these gadgets. When you press out all the water, it leaves a "puck" of compressed grounds, which you can pop out straight into the garbage or compost just by pushing on the handle. I was looking at the puck this morning and saw some lovely patterns made by different layers of grounds. One thin layer in the puck appeared more compressed than the other layers, but this more compact layer wasn't a straightforward horizontal cross section -- it had a ridged topography like one sees in the sedimentary rock hills around here. It made me wonder about the bulk properties of solid particles, about which I had seen an interesting presentation a few months before, on simulating such materials.



As I was holding the puck in my hand and examining this layer from all angles, the puck suddenly broke into its constituent coffee grounds and made a huge mess all over the floor. I realized then that I had fallen into the nerd's usual trap of neglecting practical matters for the sake of contemplating lovely abstractions ;-)

13 May 2008

Verifying identity: Existence and uniqueness

Some friends of mine have been playing an online diplomacy and military simulation game, in which each player represents an independent country. One of the biggest problems in the game is "multis" -- multiple accounts created by one person. The one person uses the multiple nations to magnify his/her power in the game. The rules prohibit this practice, but it can be hard to detect. Restricting each player to use only one IP address is annoying (as it prevents multiple people from using the same computer), but a start. The underlying problem is how to establish uniqueness of identity: Are you the only person who claims to be you?

Another identity problem is that of verification: Are you the person whom you claim to be? This was a problem faced by Daniel Plainview, the protagonist of the 2008 movie There Will Be Blood. Was the man claiming to be his brother Henry actually that person? Daniel is understandably mistrustful. Ultimately the question is resolved accidentally, by the exchange of a bit of personal information -- an oblique reference to an inside joke. When verifying identity, one has to take care not to give away information when asking for it: for example, if you give a bank your social security number, the bank could then use it to masquerade as you. Some recent security research has addressed the question of how to verify identity without giving away a secret. Daniel Plainview's homegrown solution is just as effective: inside jokes rely not only on objective information, but on a particular emotional response which would be very hard for either a machine or an unrelated human to mimic. In that sense, they are even better than CAPTCHAs: They give away very little information and are very difficult for unauthorized agents to solve.

Uniqueness is an easy problem to solve in person, aside from comedy sketches involving twins. This is because human "duplicates" (genetically identical multiple births) are difficult to "make." In contrast, it's very hard to solve remotely and electronically. If you can fake a verification test, then you can break a uniqueness test. So verification and uniqueness go hand-in-hand.

Oftentimes in math, there's a fruitful tension between existence and uniqueness. When one wishes to prove that "there exists a unique object," one generally proves existence and uniqueness separately. (In this context, "uniqueness" means that if such a thing does exist, it must be unique. So uniqueness by itself doesn't necessarily imply existence, nor does existence by itself necessarily imply uniqueness.) I'm curious whether this tension could be helpful in the field of verifying identity. Answering the question "Am I Jane Doe?" is relatively easy, but the question "If I am really Jane Doe as I claim to be, then there is only one such person" doesn't even seem to be the right question to answer. Furthermore, it shouldn't be necessary to reveal your true identity in order to play an online game. Can uniqueness be solved without verification?

07 May 2008

Two new LAPACK Working Notes have been published!

"LAPACK Working Note 199: Regular Full Packed Format for Cholesky's Algorithm: Factorization, Solution and Inversion."
by Fred G. Gustavson, Jerzy Wasniewski, and Jack J. Dongarra
UT-CS-08-614, April 28, 2008.

"LAPACK Working Note 200: Some Issues in Dense Linear Algebra for Multicore and Special Purpose Architectures."
by Marc Baboulin, Jack Dongarra and Stanimire Tomov
UT-CS-08-615, May 6, 2008.

You can download them at the above link.

28 April 2008

Microsoft comes over to play

Monday and Tuesday this week: a new (three months old!) numerical libraries group from Microsoft came over to speak with us linear algebra hackers and parallel performance tuners. Today we did most of the talking, but we learned something from them: They aren't from MS Research, and they aim to do applied research (not "blue-sky research," as the group's manager put it) with a 2-5 year horizon, and then transition successful, desired prototypes out into a production group. They've been incubating some scientific libraries for about two years, and they want to push it out into a core scientific library (sparse and dense linear algebra for now). Target hardware is single-node multicore -- no network stuff -- and they are especially interested in higher-level interface design for languages like C++, C#, and IronPython, built on both native and managed code. ("Managed code" means heavyweight runtimes like the JVM and .NET -- .NET is a big thing for them in improving programmer productivity, and these runtimes have a growing ecosystem of friendly higher-level languages.) Their group is pretty small now, but they are actively hiring (in case any of you are looking for a job in Redmond-world), and they have some bright folks on their team.

One of our biggest questions was, and probably still is, "why?" -- why wouldn't third-party applications suffice? Then again, one could ask the same of a company like Intel -- why do they need a large in-house group of HPC hackers? However, there's a difference: MS doesn't have the personpower or expertise to contribute as much to, say, ScaLAPACK development as Intel has, nor do they intend to grow their group that much. This team seems to be mainly focused on interface design: how to wrap efficient but hard-to-use scientific codes so that coders in the MS world can exploit them. In that context, my advisor showed one of his favorite slides: three different interfaces to a linear solver (solve Ax = b for the vector x, where b is a known vector and A is a matrix). One is Matlab's: "A \ b". The other two are two possible invocations of ScaLAPACK's parallel linear solver. The second of these has nearly twenty obscurely named arguments relating to the data distribution (it's a parallel distributed-memory routine) and to iterative refinement -- clearly not what you want to give to a 22-year-old n00b fresh out of an undergrad CS curriculum who knows barely enough math to balance a checkbook. Ultimately, MS has to design programmer interfaces for these people, as well as for gurus -- which is something that the gurus often forget.

Another reason perhaps for the "why" is that high-performance, mathematical calculations are a compelling reason to buy new computing hardware and software. There are interesting performance-bound consumer applications being developed, most of which have some kind of math kernel(s) at their core. MS presumably wants to get in on that action, especially as it is starting to lose out on the shrink-wrapped OS-and-Office software market as well as the Web 2.0 / search market.

It's interesting to watch a large, bureaucratic company like Microsoft struggling to evolve. IBM managed this sort of transition pretty well, from what I understand. They still sell mainframes (and supercomputers!), but they also sell services, and maintain a huge and successful research effort on many fronts. MS Research is also a powerhouse, but somehow we don't see the research transitioning into products, or even driving the brand, as it does in IBM's case (think about the Kasparov-defeating chess computer Deep Blue, for example). Maybe it does drive the products, but somehow the marketing has failed to convey this. I kind of feel for them, just like the "Mac guy" feels for the "PC guy" in Apple's ad series: They have to struggle not only to command a new market, but also to reinvent their image and command a brand.