I think not.

  • June 23, 2007 18:48

I’ve only had one year of study in German, so language difficulties have often frustrated me. It’s not too big a problem though, because almost everyone can speak at least a little bit of English here. My limited control of German has helped me many times. But it’s also caused some funny situations, like this afternoon.

I sit at a computer for about 6 hours each weekday. Because I like to think sometimes that I’m not completely sedentary, I’ve been running two or three times a week for about 25 minutes. It’s something. Anyways, conditions were right and I’ve ended up with a mild case of athlete’s foot. Wanting to nip this in the bud, today I went hunting for some anti-fungal creme. I didn’t see anything like that at the supermarket last time I was there, but I remembered seeing a Drogerie nearby—more or less like a drugstore in the US, sans any sort of medication (as I found out later). So when running errands downtown today, I stopped there. Not seeing what I was looking for, I tried to describe it to the teenage Turkish girl who was working there—who surprisingly didn’t speak any English.

“Hallo,” I said. “Ich weiß das Wort auf Deutsch nicht… auf Englisch es ist ‘Athlete’s Foot’.” I don’t know the word in German… in English it is ‘Athlete’s Foot’. Seeing that she didn’t know what I was talking about, I continued.

“Sprechen Sie Englisch?” I asked.

“Nein.”

This might be awkward, I thought. I figured I’d try explaining it to her. And here’s where things went downhill. “OK. Ich lache zu viel, und dann meine Fuße heiß und rote sind.” Okay. I run too much, and then my feet are hot and red. At least that’s what I thought I said. What I really told her was that I laugh too much and then my feet are hot and red. I can only imagine what she was thinking.

She led me to an aisle of foot deodorant. Yes, this drug store has devoted 10% of its floorspace to foot deodorant. The Germans take their pedal hygiene seriously.

“Diese sind Fußdeosprays. Suchen Sie nach Fußdeospray?” These are deodorant sprays for the feet. Are you looking for these?

I took a closer look. “Nein, ich denke nicht. Ich brauche Medizin.” This evoked a stream of giggles. I seem to be good at that. I should have said Ich denke nein, rather than telling her that I don’t think.

The girl told me I should go to an Apotheke—the place where the drugs you find at a U.S. drug store are sold. She pointed me in the (wrong) direction of the nearest one, and I eventually made it there and got some Lamisil creme.

So, lessons of the day:

  • German drug stores do not sell drugs. Mostly shampoos and foot deodorants.
  • There is a difference between ‘lachen’ and ‘laufen’. I don’t think.
  • My broken German can be used to make girls giggle.

At least I got a good story out of it.

I’m not just drinking in Germany.

  • June 21, 2007 16:20

I’ve been programming for almost 3 weeks, and today I was excited to see the following output in my terminal:

    thread 0: starting with d1.data = 0 d2.data = 0
    thread 1: starting with d1.data = 0 d2.data = 0
    thread 2: starting with d1.data = 0 d2.data = 0
    thread 3: starting with d1.data = 0 d2.data = 0
    thread 3: ending with d1.data = 4 d2.data = 4
    thread 1: ending with d1.data = 4 d2.data = 4
    thread 0: ending with d1.data = 4 d2.data = 4
    thread 2: ending with d1.data = 4 d2.data = 4

Doesn’t look significant, does it :) ? The program that creates this output is a simple Java program that creates several threads that each increment a pair of shared counters in tandem. Here’s the code for the threads:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class SynchronizedCount extends Thread
{
    Object lock;
    Data d1, d2;        // Data is a wrapper class around an int.
    int id;
    Barrier b;          // A barrier synchronization class.
    int num_iters;
 
    // I have omitted the constructor, which just sets the
    // instance variables to the constructor parameters.
 
    public void run()
    {
        synchronized(lock)
        {
            System.out.println("thread " + id +
                    ": starting with d1.data = " +
                    d1.data + " d2.data = " + d2.data);
            assert(d1.data == d2.data);
        }
 
        for(int x = 0; x < num_iters; x++)
        {
            synchronized(lock)
            {
                d1.data++;
                d2.data++;
                assert(d1.data == d2.data);
            }
        }
 
        b.block();
        // No thread will reach this point until all threads
        // have called b.block().
 
        synchronized(lock)
        {
            System.out.println("thread " + id +
                    ": ending with d1.data = " +
                    d1.data + " d2.data = " + d2.data);
            assert(d1.data == d2.data);
        }
    }
}

Each thread should have exclusive access to the counters when it accesses them—each access of the counters is a critical section.

Notice the assertions sprinkled throughout the code. I expect the values of both counters (d1 and d2) to always be the same, and so I check this at several places. If that condition is ever false, the program will crash and tell me which assertions failed. During development, assertions are a HUGE help in debugging and in writing bug-free code in the first place, as I very quickly learned. When releasing a production version of a program, assertions can be compiled out (in the case of C/C++) or disabled at runtime (in Java), so it is perfectly fine to leave them in source code.

So why did I write this asinine program? It’s a test to detect if the optimizations I’m making to Ronald Veldema’s distributed shared memory virtual machine for Java, which is designed in particular for programs that require massive amounts of memory (on the order of many terabytes) in a huge number of objects.

A Distributed Shared Memory (DSM) provides the application programmer with a single address space that is mapped onto the address space of multiple machines. This lets the application programmer write code as he (she?) would for a single computer, but the data and threads can be distributed automatically onto the available resources of machines the DSM is running on. Using a DSM lets one write a program that uses the resources of a computer cluster without having write message passing code or map shared memory buffers among machines. You just need to write multithreaded code.

Although I don’t like Java very much as a programming language (it has been hijacked by buzzword-loving enterprise weenies, and is kind of a dumbed-down language to begin with), it is an ideal target for a DSM for a few reasons:

  • The language is designed to run on a virtual machine (VM). All DSM stuff can be implemented in the VM. Java programmers/users are accustomed to running a VM, so running on our VM that implements the DSM doesn’t really add complexity—programmers don’t have to link with special DSM libraries, and users don’t have to start an extra process, both of which would be needed for a DSM in a language without a VM.
  • Threads and a memory model designed for concurrent programming are in the Java spec.

Issues arise when parallelizing an application. Unless the problem is embarrassingly parallel, there will be a possibly significant amount of data that must be shared. So, considering the shared counters program I wrote about above, when running on our DSM, the counters could be allocated on any machine running the DSM (even on different machines), but each thread needs access. What is typically done in distributed applications is to move the data where it is needed. In Ronald’s DSM, instead of moving data to threads, he moves threads to data. The fact that Java has threads as part of the language specification makes implementing thread migration a simpler than it would be otherwise. Thread migration is something that is usually only done for redundancy and for compensating for system failure. Doing it for performance is, as far as we know, a largely unexplored question.

If the program being parallelized has more reads of shared data than writes, performance can sometimes (dramatically) be improved by caching the shared data on the machines where it is often accessed. Then, data/thread migration can be bypassed for the cached data. This is what I am implementing this summer—an object replication mechanism for Ronald’s DSM that will (hopefully) offer big performance gains for many programs run on it. But caching requires synchronization when writes are performed for program behavior to be intelligible. The cache coherency protocol gets tricky fast. THAT is why I was excited when I saw the output from the counter program—it means that my synchronization protocol and implementation were correct for that run.

There are still likely race conditions present, which can be very hard to debug. An often-used strategy for detecting race conditions in a concurrent program is to run it for long periods of time (days, possibly) with a high level of concurrency—lots and lots of threads running on lots and lots of physical machines. Then you wait for your program to do the wrong thing. Before I can do this kind of testing, I need to make my caching scheme interface with Ronald’s garbage collector (which may turn out to be as complicated as the cache coherency protocol and implementation, which has taken me a couple weeks, and probably still has bugs).

After interfacing with the garbage collector and becoming confident that there aren’t in my code, I need to make sure my object replication mechanism uses a bounded amount of memory—right now, there is no limit on the amount of space the cache uses. This is bad, especially for a VM that is supposed to be very memory-efficient! What we did in Operating Systems class might actually be useful to me now—I’ll need to worry about replacement policies.

After implementing bounded memory usage for object replicas, I need to experiment with different replication heuristics, which will determine which objects should be replicated to which machines. Currently, replication is only done via a special Java method implemented in the VM that forces replication of an object to every machine.

Finally, I will need to do performance tuning and benchmarking, i.e., with my replication mechanism enabled and disabled, with real applications! Ronald has a few applications he has written or he uses to test, including a model checker (essentially, a nondeterministic Turing machine simulator), an n-body simulation, and a program that finds subgraphs in a larger graph.

Between all this work, I’ll be presenting to the Computer Science faculty here in about 3 weeks. Also, Ronald and I are planning on submitting a joint paper on his DSM with my object replication mechanism to VEE by September. If I get published it will be fantastic.

On Entry.

  • June 9, 2007 10:14

On June 1st, I arrived in Nürnberg. Ronald Veldema (the Dutch guy I’m working for, see his university page here) had arranged to meet me at the airport. Here’s how it worked out.

After collecting my bag, we take a bus from the airport to the train station in Nürnberg, take the train from Nürnberg to Erlangen, and then another bus from the train station to the guest house where I am staying.

While Ronald and I fight with the train ticket machines (many of them are out of tickets), a cute oriental girl walks up to me and quickly tells me that she needs money for the train, then asks if I have money to give her (something along those lines, I realize later). The exchange goes something like this:

(Cute girl says something quick in German).

“…Wie, bitte?” (…Pardon?)

(Cute girl repeats herself).

“Es tut mir Leid, ich spreche nur ein bisschen Deutsch.” (Sorry, I don’t speak much German.)

“Oh, don’t worry about it.” She walks away.

Hooray, language awkwardness! And I’ve only been on the ground about 40 minutes. Ronald chuckles.

It’s uneventful until until the bus ride in Erlangen. Ronald buys two tickets from the driver (a 20-something German guy shaved completely bald), and enters the bus first. The driver glowers at me because of my huge bag that has all my stuff in it (thanks Sara!), and ushered me onto the bus with a quick snap of his arm. This amuses me—the angry German stereotype!

At the next stop, an older woman, probably in her 60s or 70s, enters the bus. She sits in a seat close to where I am standing, and then rattles of a question to me in German:

(Older woman quickly asks me a question in German).

Lacking the tenacity to attempt understanding, I respond, “Es tut mir Leid, ich spreche nur Englisch.” (Sorry, I speak only English.)

“Tja! Nur Englisch…” the woman scoffs.

Language awkwardness again! Ronald chuckles.

We make it to the guest house. Ronald picked up the key to my room in advance. We open it up, take a look around. “This is nice—it’s like a hotel!” he observes. And it is pretty nice—16.32 square meters, with its own kitchenette and bathroom. I set my bags down and take a look around. There’s an ethernet cable coming out from behind a chest of drawers. “Do you have a laptop?” Ronald asks. “Let’s see if you can get online.”

I set up the laptop on the desk and plug in the ethernet cable. I get a connection, but no IP address. I look for wireless, and find an unsecured ad-hoc network. I connect to it. Jackpot! I can get online, but I am a bit leary of doing anything sensitive (the person who set up the network might be sniffing for passwords or personal information). This is the only internet connection I have for the next few days—one that frequently goes up and down.

We next head to the computer science building where I will spend lots of time working. (Professor Hatcher wasn’t kidding when he said Ronald is intense! Maybe 15 minutes at my room, and then we get to work—by keeping me awake until later that night, he hopes to get me adjusted to German time as quickly as possible.) The building is huge, several stories high, and it is one of THREE buildings for computer science. Friedrich Alexander University has only around 25,000 students, by the way, and is not a polytechnic or technical institute.

We catch one of the sysadmins before he leaves for the weekend, and he sets my computer accounts up. This will let me do work on the mini cluster, a heterogeneous cluster of 16 nodes with x86, PowerPC, Itanium, and x86-64 processors. I am told I need a different account to use the cluster at the compute center, which houses a semi-large cluster of about 180 nodes. I quickly realize that this university has WAY more money than UNH, whose computer science department doesn’t have its own building (let alone 3), and as far as I know, has only a 4-node cluster. Ronald tells me that lots of the development work for the MP3 audio format was done by a doctorate student at Friedrich Alexander University. I wonder if any patent money has come to the university.

Ronald explains some fundamental aspects of the software we will work on for an hour or two, then we take a bus to the center of Erlangen so that I can buy bedsheets and a couple other things. The beds here that I’ve seen are different than in the U.S. There is a downy pad that goes on the mattress, and there is another downy blanket that goes inside a sheet. The pillows are about twice as big, like two pillows from the U.S. joined at the long edge to make a large square pillow.

I get some kind of pastry at a bakery in the department store (bakeries everywhere!), then we head back, at which point I pass out for about 13 hours. It’s an adventure!  I just wish I spoke more German.

I have arrived.

  • June 2, 2007 16:20

On Thursday I flew out of Boston to Frankfurt am Main. When I was checking in for the flight, I was worried that I would have trouble because my bag and carry on were too heavy—the carry on was supposed to be no more than 18 pounds, and the checked baggage no heavier than 50 pounds. Well, both were over that, but no one said anything. Strange.

The flight to Frankfurt was a little less than 7 hours in the air—not too bad. I slept through the movie, and that’s all the sleep I had that day. I had ordered a “HIGH FIBER MEAL” when I ordered my tickets because there was no “NORMAL MEAL” option. They gave me the same as everyone else. For airline tickets, I went directly through Lufthansa’s website. Many people recommended different sites that purportedly give discounts to students. All of those sites except Lufthansa were actually more expensive than, for example, Orbitz, probably because I decided to fly during a peak traveling time for summer. Lufthansa was a little bit cheaper than Orbitz.

On the flight, they had free alcohol—red wine, white wine, scotch, Irish creme, etc. I don’t know if that’s standard fare… but hey, buzzed passengers are happy passengers. I had some wine and read, but mostly
just sat thinking. They had a classical music channel playing which I listened to for most of the flight. As we flew in to Frankfurt, the sun was rising and Wagner’s Valkyrie played on my headphones. It was epic. I guess it’s my Germany theme music.

With cheapness of airfare comes a price. I had a 7 hour layover in Frankfurt, and didn’t make it out to see any of the city. I had to switch terminals for my connecting flight to Nuremberg. I passed through a tunnel connecting the two terminals. It was very long, kind of dim, with the walls and ceiling lit with lights that changed colors, and underwater newage music with sonar pings. After going through the tunnel, we had to go through security again.

Going through security for the terminal switch, someone flying first class started arguing with the guy that was administrating the lines, who was making everyone go into one line rather than run the separate lines for first class/business/coach. “Why are you letting economy passengers go through the line marked for first class! You will make me miss my flight!” he said. The administrator responded, “Sir, I am in charge here. Please, just step into the line.” The situation escalated for a few minutes, ending with the “troublemaker” being detained by German police, and a Scandinavian in the line shouting to the administrator, “You treat us like cows! We are people and you treat us like cows!”

After passing into the next terminal, I walked around, got coffee and a brezel (pretzel), took a quick nap, read some newspapers, searched for wifi, and read a book. I almost picked up “Harry Potter und der Stein der Weisen”, but figured it would be cheaper outside of an airport—plus, I had a book I was in the middle of. Seven hour layovers are long. There were many free newspapers in the terminal (mostly in German, and all in color, even on a weekday), a couple of which I looked at. I was able to get the gist of some of the articles I looked at, even if I didn’t understand word-for-word each sentence. There was one article about organ donoration in Europe. There were a couple tables of statistics. Austria was ranked very low both in terms of percentage of people who are signed up as organ donors, and in percentage of people who have spoken about such donation with their families. If I recall, Germany was also ranked low, although not as low as Austria. Sweden was number one for organ donors. Perhaps they are enlightened. I’ve also read that Sweden is the most secular nation on earth. Hmmm…

I was near a television playing Deutsche Welle much of the time I was waiting. At one point, a short clip of what looked like Tobias Isenberg’s research was played. He was (is?) a faculty candidate for UNH computer science, and specializes in graphics. I saw his presentation at UNH a few months ago. The spot that was on TV was for a collaboration device for working with photos—a big touch-sensitive table that doubles as a screen, with some fancy-pants UI so you can “slide” photos across the table to other people, among other things. It was neat to see something I had seen on person first, on TV.

I realized when I got here just how dependent I have been on my cellphone as a timepiece. I haven’t done the whole watch thing for about five years, so my cellphone at home started doubling as a watch. It’s not GSM like the rest of the world uses, so I have that cell phone disabled until I come back (saves me money). Jet lag and lack of a convenient timepiece have wreaked havoc on my body clock.

More later. I have pictures to go through, and no reliable internet until Tuesday probably—right now I am tenuously piggybacking onto someone’s unsecured ad-hoc network, which has been going up and down.