Michael posted a complete gallery of photos from the contest on the Greenfoot site. He did not, however, capture our top winner in a reflective, contemplative pose:

DSCF1591

“I can beat that guy…”

Joe Coglianese showed that professors from big-name Universities have to get to work on their Greenfoot chops pretty early in the morning if they’re going to beat a hard-hitting high-school teacher. The competition was great, really–it was so much fun to see people hacking, submitting, tweaking, submitting… trying to get their Greeps to exhibit that critical bit of emergent behavior that would score more tomatoes than anyone else.

DSCF1580

Our winner, observing from afar… sneaky.

It was impressive how many people were drawn to the Sun booth by Greenfoot; I like to think that the combination of the activity and Sun’s presence fed off of each-other very nicely. Some people came by to find out what Sun had going on, and some came by to see Greenfoot–and they usually asked questions about both. That was cool, although from time-to-time I found myself answering questions about OpenJDK, the J2ME stack, JavaDB, and OpenSolaris. (Yes, you can run OpenSolaris in a VMWare virtual machine.)

And it was also very cool to talk to people about the ideas they had for teaching with Greenfoot. So many people were coming up with such cool ideas for how they wanted to get students playing with this environment. I’m hoping they find their way back and share some of their stories, as I’d very much like to do some interviews, ask questions, showcase student work, etc. in this space. The more we share with each-other regarding our use of Greenfoot in pedagogic contexts, the more we all benefit.

Why? Because Greenfoot is amazing. See? Look. This next photo proves it:

DSCF1582

Greenfoot is amazing

LOOK AT THAT! Look at how amazed I am by Greenfoot! Mercy. I can’t be more amazed than that. Michael is amazed too, which you can tell even from his back–look at how excited his shoulders are! Ian (left) isn’t all that amazed, but that’s because he used to program in Postscript, and is now scarred for life. However, there are people in the background who are about to be as amazed as I am, but they’re slow on the uptake. Dennis (behind me) in particular: not terribly observant, that one. In a moment, he passes out from the excitement of Greenfoot. He gives new meaning to the words “completely floored.” Really, Greenfoot is absolutely amazing, it is.

(I did not pose for that picture, and I did not have to ask Poul to take it several times before we got just the right expession of amazement on my face. That was a completely natural, un-planned expression of just how amazing Greenfoot is. Really.)

(And yes, I had fun writing this post.)

Not too long ago, we made a few interesting changes to the Transterpreter.

The first was that we updated the Multiterpreter. Donkeys-months ago (like donkeys-years, but not quite as long) we modified the interpreter to map occam-pi processes to operating system processes. This meant that we could run code in true parallel on multiple CPU or multiple-core machines. Unfortunately, the cost for process switching was so high, we couldn’t show this to anyone on the planet for fear of being shamed.

About two months ago, Adam and I sat down (I rode copilot) and rewrote that code to use POSIX threads instead of OS processes. In fact, we didn’t even do anything savvy, like use a thread-pool; instead, we just create operating system threads when they’re needed, reclaim then when they’re done. Not the most efficient way to parallelize the virtual machine, but we like to do things in the simplest way possible first. In this case, it had the smallest impact on the codebase, so we did it that way.

On my laptop (”Lyra”, a dual-core 2.0GHz Intel Core Duo MacBook), I ran some code that varies three things:

  1. The number of parallel processes being executed
  2. The amount of computation each process carries out
  3. The number of communications each process makes while computing (context switches)

In a multi-threaded or multi-core system, this will stress our run-time and tell us at what workload our parallel virtual machine is more efficient than running a single-threaded runtime on a single core. The core of the code comes from Kevin Vela’s doctoral thesis from the University of Kent (not available online).

PAR i = 0 FOR abyg
  CHAN INT chan:
  SEQ j = 0 FOR pleng
    PAR
      SEQ
        SEQ k = 0 FOR granu
          array[(granu * i) + k] := array[(granu * i) + k] + i
        chan ! i
      INT t:
      chan ? t

So, what did we find?

(Note that in each of these graphs I’ve varied both the y- and x-axis; this is bad reporting practice, and something I will correct when the tech report is put together—for now, these are the graphs I have, and I’m using them as-is. )

20070202-Lyra-Parallel

To be clear, the different glyphs represent the maximum number of POSIX threads that were allowed to be running at the same time to support a single virtual machine. On the y-axis is the time in seconds needed to compute the replicated PAR shown above (averaged over two runs), and the x-axis is the granularity of the work packets—larger granularity means more work gets done before a context switch is allowed to take place.

On my MacBook (above), we had to have each thread do a significant amount of work (process a 65K element array in a non-trivial manner) with relatively small amounts of communication (long work periods) before we saw a speedup due to parallelism. My suspicion is that OS X is such a hungry operating system that it (and other application processes) were constantly asking for attention, and therefore, the Transterpreter threads rarely had the opportunity to run for a significant amount of time.

So, to belabor this just a bit, we can see that with one thread of control (a single-threaded interpreter), we compute packets of granularity 1 approximately 20x faster than if we run a 2-threaded interpreter. On a two-core machine, this doesn’t necessarily make sense… unless we consider the possibility that the two POSIX threads are spending all of their time contending for an opportunity to run, in which case it makes sense that we’re not seeing any benefit of having a parallel runtime.

As the granularity approaches 50 (which we can convert into a specific number of VM instruction cycles, if we wanted to), we see that the single-threaded and dual-threaded interpreter run at almost the same speed. This is because we are no longer seeing the contention at the operating system level for multiple threads to be executing. Or, perhaps it is because we are no longer fighting the operating system for a chance to execute.

On Hadar, a SunFire 880 with four 750MHz UltraSparc III processors and 8GB of RAM, I found the results were… a bit odd:

20070202-Hadar-Parallel

Ignoring a granularity of one for a moment (which is effectively measuring context switch time of the POSIX implementation on a given machine), we can see that a two- and four-threaded interpreter are always slower than a single-threaded interpreter. However, if we increase the number of threads the Transterpreter is allowed to spawn to 8 or 16, the Transterpreter is always faster for even small workloads than a single-threaded Transterpreter.

I have not fully investigated this yet; I believe this is because Solaris handles pthreads differently than other operating systems. In particular, it has a notion of virtual CPUs, and I think (but am not sure) that with too few threads, it assigns them all to a single virtual CPU, which is assigned to a single physical CPU. Therefore, even though we have four cores (most of which are idle), there is massive contention on a single CPU. When the OS sees more threads in play, it actually farms them out to multiple virtual (and physical) CPUs.

I have to read more on this (and have some excellent resources from Sun that I picked up while at SIGCSE), and do not doubt that this situation can be improved. Our initial testing was only over the course of a few days, and I need to investigate this further before turning the work into a tech report. (From exploration, to blog post, to tech report, to publication, I suppose.) In other words, I’m sure that Solaris isn’t completely borked—instead, I assume I have to do some more work to make sure it does what I want, instead of whatever the current default is.

The last system we did some tests on was Ninja, an Intel SR1200 server with two PIII 1.4GHz processors and 2GB of RAM running Debian GNU/Linux with a SMP kernel (rev. 2.6.17-2-686).

20070202-Ninja-Parallel

Ninja produced the curves I expected from the other two machines, actually. We see that a single-threaded Transterpreter is faster than a multi-threaded interpreter for very small work packets. However, with a granularity of 5, we see that a single-threaded, dual-threaded, and quad-threaded interpreter all run at roughly the same speed. From that point forward, it is better to have multiple threads in the interpreter than a single thread, as more work gets done in unit time. And, I believe that this easily represents “real world” work packet sizes.

What I don’t quite understand is why four threads is better than two for very small granularities. Like the other platforms, there is a good deal more investigation to be done before I understand the implementation of POSIX threads in a given operating system (OSX/BSD vs. Solaris vs. Debian GNU/Linux 2.6) and how that effects the execution of a parallel Transterpreter.

Why do I think this is cool?

The Transterpreter runs on the Texas Instruments MSP430 (an 8MHz, 10KB RAM embedded processor), the LEGO Mindstorms (a 16MHz embedded system with 32KB of RAM for both the interpreter and code), as well as my MacBook, Christian’s G4 Powerbook, our Linux dual-processor server, quad-processor Suns, and most likely any machine with a C compiler. The code I ran to test our “POSIXterpreter” does not exercise any features of the language that would not run on all of these platforms—put another way, the bytecode for my tests could be executed on the MSP430 without modification; we might blow the RAM if we make the replicated PAR too big, but that’s about it. That’s how portable the code is across Transterpreter instances right now.

Tyan recently announced their 40-processor “desktop supercomputer.” This is a set of five, dual quad-core (8-processor) blades in a box on wheels. So, you get five computers in a box, each with eight processors, and a max of 60GB of RAM (12GB per blade). And the price? $20,000.

Not bad.

I haven’t written it up yet, but the Transterpreter also does OpenMPI. That means that we can actually spread computation across machines in a cluster as well as across SMP cores. This is way alpha code, but I’ve demonstrated to the group that we can split things up on the Darwin H4 supercomputing cluster (a 2.4GHz Dell and a 3.2GHz Dell under adjacent desks on a 100 Mb network). Given a bit of time, this could become a first-class part of the Transterpreter release, and we’d have an excellent environment for controlling parallelism in a heterogeneous cluster environment.

Or, as the case may be, an excellent way of exploiting the resources of a 40-processor supercomputer-in-a-box. With five POSIXterpreters running large thread pools, adding some intelligent (batch) scheduling, and a more fully-featured set of MPI bindings, we’d have a seriously smart setup for doing parallel computing. All the pieces are there, but we don’t have the financial justification to dedicate the time to the development. So, we continue stealing a little bit of time here and there to see if we can demonstrate that this is a really powerful way to orchestrate the use of high-perf libraries (like BLAST, LAPACK, etc.) in a robust, safe, and semantically clear way in a truly parallel environment.

Sunday I take off for San Fran, and am pretty psyched. Christian, Jon, and I are heading to the AAAI Spring Symposium to talk robotics and concurrency with a bunch of other robotically-minded people; that fills our time between Sunday and Wednesday. Thursday, we’ll be giving a Google TechTalk, which should be very fun—at least, we’re planning on enjoying the talk immensely. Then, we’re thinking (but aren’t committed) to doing a little bit of light camping, as this time of year can be soooo nice in the Bay area.

We don’t have housing nailed down for Palo Alto Sunday/Monday/Tuesday, but I think we might just grab a hotel near Stanford. It will be a bit pricey, but otherwise, we’re dealing with cars, and parking, and commuting, and… that’s not so much fun. We’ll see.

I’ve touched base with a few friends in the area (dbort and Tzu), but I’m wondering if there’s anyone I missed. Is there anyone who reads this blog who is in the Bay area I should try and say ‘hi’ to? Is there anyone who reads this blog who knows anyone in the Bay area I should say ‘hi’ to? (I think that’s one degree of separation; more degrees of separation than that, and I suspect I only want to know them if they’re going to give me money for my ideas on fixing email, or if they want to give us a place to sleep.)

This is very, very exciting. I mean… very. Exciting. Very.

OK, so I just like talking about and playing with robots. What can I say?

  1. Iron-on transfer paper is really cool! You can print on it from an ink-jet (mirrored, of course), then iron on anything you want onto (say) a T-shirt! Groovy!
  2. Iron-on transfer doesn’t really work with fleece! In particular, fleece headbands!

Yeah, I tried doing an iron-on transfer onto a fleece headband. It kinda flattened the headband and left it a lifeless, pancaked mess. Sad. No Transterpreter headbands for me…

OK, OK, so I was making props for a talk tomorrow. And it will be fun, methinks… if I can run it fast enough. I’m just concerned that I’ve included too much cool stuff… I’ll reflect on it some more before tomorrow afternoon, I guess…

In sequence: 1 2 3

I’ve recently been experimenting with both JungleDisk and jetS3t for backups. I like the command-line driven jetS3t, but must admit that some new features are being rolled into JungleDisk that I really like. In particular, the most recent version (1.25) of JungleDisk supports:

  • Fast file copying / renaming / moving without the need to re-upload (YES!)
  • AES encryption with up to 256 bit keys
  • Keep modification timestamp for backed up files
  • Optional SSL for connections to S3 (for a second layer of encryption in transit)
  • Auto mount/un-mount volume on OSX

The next version (1.30) is apparently going to support three awesome features:

  • Backup history / logs
  • Backup of in-use files
  • Incremental backup of only the changed portion of large files (YES! YES!)

The last feature—incrementally backing up only changed portions of large files—is awesome. This means I can have large databases (eg. Yojimbo) and back them up regularly, but the whole DB does not get copied every time I make a change.

In the next few days, I’ll start digging into some of Tom’s other questions on this theme of backups—in particular, I want to hit version control. Version control provides the busy author with a way of saving every single incremental change to their documents, as well as some comments and metadata about the nature of those changes. This way, you can do things like cut a whole chapter from a book, or a paragraph, or similar… and not worry about “loosing” it, because it will always be preserved in your version control history. If you decide you want the content back, you just go browsing, and viola, you have your text back.

Creative Commons License

This post is licensed under a

Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.

First thing in the morning, we have a crowd waiting to get their updated and new submissions in. It began at 9:30 AM, and from then until the closing at 10:20, everyone was frantically updating and tweaking their Greeps until they were lean, mean, tomato-eating machines.

Floor1

The doors finally closed on submissions, and the top three from the open competition were then run against each-other. They had one run each; the highest score won an iPod Nano, and the next two won a very stylish Greenfoot mug.

Sadly, everything went by very quickly, and I don’t have the names of our champions! However, I do know our grand prize winner was a high school teacher, and will post video of some of the winning solutions after I get my hands on them.

At this point, we’re all very tired Greenfooters, and are going to take it easy for the rest of the day.

Somehow, we went from day -1 to day 2. In truth, I should have labeled “Day -1″ as “Day 0″, at which point things would make more sense.

*cough*

Today we’ve had a great response on the Greenfoot competition; in fact, things have been hotting up all afternoon as people come and go from the Sun Microsystems booth with their improved Greep programs. Sadly, I was too busy handling questions when we had really big crushes, but I do have some snapshots of the booth. I’m using the camera built into my MacBook, which is nothing to write home about… but it’s good enough for blogging!

Photo 3

Me!

MyPicture

The booth (or part thereof)

Photo 2

Ian and Poul

So, it’s good fun. I’m certainly having a good time, and lots of friends are coming by to say hi, and in some cases, be surprised by Greenfoot. It is awesome.

So, like a good Greep, I’m going to go tomato-hunting…

Sigcse07Logoverysmall

The day began for many of us (coming from Kent) at an unreasonably early hour. Poul and I, for example, were marvelling that we felt “wide awake!” at breakfast… at 6:30AM. This is, of course, because we’re still in GMT, and you tend to wake up kinda early in EST.

Poul is spending the day at the Doctoral Consortium, and I spent my morning stuffing bags for the conference. This evening is the Greenfoot workshop at SIGCSE; I don’t think there are any slots left, which is OK… as it is, it’s going to be a tough session. Michael is taking a nap in preparation, as 7PM to 10PM is… well, midnight to 3 AM in GMT, and one day is not enough time to get over the lag. I may be there as well, and will report on the workshop afterwards. It should be a lot of fun.

At some point, we’ll get things set up at the Sun booth as well; the iPod for the competition has been purchased, and I’ll make full details available here when it is released/announced.

I think I’m going to try and forgo the nap… but that might be a bad idea…

I received this comment to my last post:

Jungrire, qhqr. V’z n uhzna naq V unir penml znq rapelcgvba fxvyym

This cyphertext does not look like it went through a particularly hard algorithm. In fact, the remenant of punctuation, and the fact that some of the letters show up with what appears to be a “normal” frequency is a big clue that this is, most likely, a Caesar cypher—or a shift of 13 letters. The question is, did the enterprising individual do it themselves, or find a webpage to encrypt their message to me.

I used a webpage to decrypt it. :)

20070307-Cyphertext

The cleartext is:

WHATEVER, DUDE. I’M A HUMAN AND I HAVE CRAZY MAD ENCRYPTION SKILLZ

The use of non-standard spelling of “SKILLZ” could have thrown most people in decrypting this cyphertext, but my on-line decrypter munched right through it. So, yes, some humans are amazingly adept at carrying out secure cryptographic functions; I have no idea what I was thinking in that last post. My bad.

SIGCSE 2007 in Covington, Kentucky is going to be an exciting place for Greenfoot activity. Michael is leading a workshop on Greenfoot, and we will have some space (free iPod!) at the Sun Microsystems booth in the exhibition space for presenting Greenfoot and talking to people who are interested in this really cool software.

What might be (free iPod!) of interest to people who will be attending the conference is that there will also be a Greenfoot programming competition! We’re not sure if there will be any prizes yet (iPod!), but we’re hoping we can come up with something. (OK, OK, I’ll cut the suspense. At the least we’ll have some Greenfoot mugs and t-shirts.) The competition will require you to use some of your decentralized Java chops to develop agents who can “get their agent on” better than (did I say iPod Nano?) anyone else’s agents.

In particular… we’re going to give you Greeps. These little aliens just love tomatoes, and your job is to make sure they’re well fed. I’d show you a screen shot… but I don’t want to give too much away right now. I suppose I could let you see what the Greeps look like, though:

20070304-Greeps

I had to blow that image up a bit, and it doesn’t (really! a nano!) look as good as it should… but I think you get the idea that these are some evil, vicious… tomato eating… cute… aliens that are set to take over the wo… ravage gardens everywhere.

So join us at SIGCSE, and check out the programming competition. Perhaps we’ll even have some kind of MP3 player as one of the prizes… ;)