My (a)musings on various things

Archive for the ‘Uncategorized’ Category

Optimising OpenFOAM: How to get a free performance boost using compiler flags

A few months ago, I managed to meander my mind into the land of software compilation and the various flags one can use to help the compiler optimise your program.  This lead me to wonder if there was any way I could speed up OpenFOAM for “free” by adding a few of these flags and came up with the following conclusions:

  • OpenFOAM compiled from source runs faster than OpenFOAM installed using a .deb package (although compiling takes longer and is much less convenient!)
  • Adding -march=native to the compiler flags is a no-brainer and gives up to 20% faster execution!
  • Adding -funroll-loops to the compiler flags gives you a little bit extra on top of this.
  • Using -mfpmath=sse can give some marginal gains, whereas either -mfpmath=both or -mfpmath=sse,387 reduce the performance.

(more…)

Things I wish were invented earlier

For today’s ramblings I am going to reminisce about a time when life was harder and highlight a couple of things that make life awesome today.

Duolingo

If you haven’t heard of it, this is a handy language learning website/tool/app that encourages learning through gamification and rewards daily practise of a chosen language.  In my history I have formally learnt both French and German foreign languages, but for various reasons ‘dropped’ them before I ever came to need them in anger, at which point they were rusty (to say the least – I no longer consider German as a language I know bar a few choice phrases).  Had Duolingo existed as a context in which to use my newly learnt languages outside of the classroom this may have been a different story, but I can only speculate and play catch-up.

Google Docs/Drive

Before I get accused of fanboyism, I will point out that other cloud based collaborative editing software exists, but in my opinion Google does it the best.  The reason I wish this had been invented earlier comes from my undergraduate days; when forced to work in random groups to produce a single deliverable output.  Back then, collaborative document writing was an extremely painful process of either (if you’re lucky) checking a version controlled document in and out to work on it, or many people sat round one computer and one mouse.  There was a third option of email and filename/revision anarchy, but it very often came down to wasting n-1 people’s time with n people sat around editing the document on one PC.

Fast forward to the present day and a plethora of options exist (of which Google Docs is one) so that all n people can be working on the same document at the same time, increasing productivity by about n times!  Another upside, is frustration is reduced by n-1 times also!  Which brings me to my final futuristic feature that I enjoy: voice typing.

Voice Typing

Admittedly, voice recognition software has been available for a long time, however I include this because it has recently become three things: ubiquitous, cheap and useful.  In particular it has been included into Google Docs, which pleases me greatly, and is one of the reasons I go for Google over (for example) Office Online.  However, I must confess that the word “useful” must be taken with a pinch of salt here; I have perfectly capable hands that can type at least as fast as I can speak, so voice typing doesn’t add anything except the feeling that I am a James Bond villain controlling my computer with my voice.  Nonetheless it’s a great option for hands-free text entry and a boon for those who can talk faster than they can type.