20121223

Alarm clock

In a sudden stroke of genius (the kind that can only occur at 1:30 in the morning), I have just invented the most annoying alarm clock ever.

while true; do beep -f `random 100 2000` -l `random 5 300`; done;

(Where random is a script I wrote that does the obvious.)

Not only is it incredibly annoying, but you can't control-c it, since the beeps are running so fast.  I also had the luck (misfortune?) of running it while sudoed as root, so it ended up with some kind of weird reparenting and so it didn't even stop when I closed my terminal... I finally had to rmmod pcspkr to get it to quit while I hunted down the offending process.

I don't yet know how I will fully use this newfound power, but if nothing else I can guarantee I will be waking up tomorrow morning.

20121214

Book Reviews 2012: Martha Wells

I discovered a new fantasy author while touring a used bookstore, Martha Wells.  I've since bought everything of hers I can get my hands on.

The Books of Raksura, Martha Wells
The Cloud Roads (The Books of the Raksura)
The Serpent Sea (The Books of the Raksura)
The Siren Depths (The Books of the Raksura)
I rate them as 5/5 all the way across.  The series chronicles the adventures of a clan of "Raksura", sentient fantasy creatures (people?) in a realm of other sentient fantasy creatures.  There was some magic here, but it was fairly subdued, and mostly taken for granted.  The series was mostly about the cultural differences of the various peoples, and one misfit's attempt to assimilate, with some villains and adventure thrown in for fun.


The Books of Ile-Rien, Martha Wells
The Wizard Hunters (The Fall of Ile-Rein: Book 1)
The Ships of Air (The Fall of Ile-Rein: Book 2)
The Gate of Gods (The Fall of Ile-Rein: Book 3)
The Death of the Necromancer
The Element of Fire
Also 5/5 all the way across.  The first three books are trilogy, set in a fantasy world that has 1900's era technology (ie simple cars and air ships, electric lights, but not much else) and well-established schools of magic and sorcery.  The country of Ile-Rien finds itself fighting a war, and the characters set off in search of a powerful magic to defeat their enemies.  The world that she creates here has enough depth to it that I found even the back stories enthralling.

The last two books are stand-alone novels set in the same world but during earlier time periods.  They have some familiar characters, but were essentially distant back-stories for the events in the trilogy.


Wheel of the Infinite, Martha Wells
Also 5/5.  At a high level, this book follows the main characters as the restore balance to the "Deep Magics" that govern the world (my term, not hers).  Magic is assumed everywhere, but not actually exhibited much by the characters.  I thought this one was a little more adventure driven, with a little bit of deeper issues thrown in, and much less cultural focused than most of Wells' other works.


City of Bones, Martha Wells
I rate this at 4/5.  City of Bones was a set in a post-apocalyptic world with survivors struggling to survive.  The male lead (named Khat) carried this book in my opinion.  He was another cultural misfit trying to survive in a foreign city, honest enough to be endearing and with enough character flaws to get himself into trouble.  The world was interesting and all, but I found him fascinating.

Khat kind of reminded me of a more interesting version of the male-lead from the Ile-Rien trilogy.  And the overall crisis the characters solve felt a lot like the one in Wheel of the Infinite by the end.  So that's mainly why I rate this as only a 4/5.  But the book might stand better on it's own if you hadn't have just read her other books. :-D


And that's all the motivation I have for the evening, so I'll stick to one author for now.

New Computer

I recently upgraded my main system from a Phenom II to an Ivy Bridge (Xeon E3-1270), and this may be stating the obvious, but dang is it faster...
I have a little benchmark program I wrote to test a simple C-library of data structures, that normally took 10 seconds on my old machine, that now completes in just under 4. If I launch eight of them at once (two per real core), the hyper-threading lets them complete in just under 6 seconds a piece. Wow!
With my spare cycles, I normally run GIMPS work units, which is a distributed prime number search that consists of heavy floating point operations. The new machine processes work units about 6 times faster than the old one. I'm assuming the new AVX instructions are mostly responsible.
Which brings me to an awkward problem... I normally run 4-threads of GIMPS at a niceness of 19, which usually translates into very little CPU usage, and I just let it run without typically noticing any performance hit. But with hyper-threaded cores, the Linux scheduler notices that I've got spare CPU's, and happily schedules them with GIMPS tasks. So what ends up happening, is I get my interactive workload on a core, and a GIMPS thread on it's hyper-peer, and they split CPU roughly 50% (modulo the hyper-threading boost). That kind of hurts, but I also hate to turn off hyper-threading since it was a 30% throughput boost when I do have real multi-threaded workloads.
At the moment I'm just living with it, and turning off GIMPS if I run into a situation where I care, but that kind of sucks. I tried playing with cgroups, but from all I can tell, they're not really designed for this. You can use them to limit things to a percentage of the CPU when you're under load, but when there are spare cores they optimize for throughput, and schedule things anyway.
After digging through the Internet, I finally found a utility called cpulimit that is almost what I want. It'll let me limit the total CPU of a process tree to X% of a core, so I can limit GIMPS to 3 cores, and leave one completely spare, but I still have to manually pay adjust to it if I want to give it my whole CPU while I'm gone.
What I really want, is for it to check my load average, and automatically scale up/down the limit it's applying to GIMPS based on how busy my system is. After pulling the source for it, I think I know how to make it do that, so sometime when I get really motivated I'm going to give it a try.
Among the other fun things I've learned while setting up this machine is what happens when you don't have your static /dev setup right (the kernel can't launch init...), when you don't have a /run folder (your hostname never sets, and you can't successfully halt or reboot among other things), and Gentoo live cd's haven't setup the net.eth0 symlink by default since at least January. Oh, and don't dd your disk while you have it mounted... It doesn't end well.
I have also now become well-acquainted with NewEgg's return policies, having sent them back a bad motherboard, and a set of four 8-GB RAM chips (which I mistakenly ordered despite the fact that registered memory wasn't compatible with my motherboard). Props to NewEgg for painlessly taking it all back.  (Update: NewEgg has since refused to accept my motherboard back... :-(  )

I'd like to think this experience has made me wiser, but if nothing else, at least I now have a faster computer. :-D