Reaching a decision

English: Distributed Memory
English: Distributed Memory (Photo credit: Wikipedia)

A week further on and not much C++ has been written – and now I think I need to make a new start.

Up to this point I have been trying to write a software model of the hardware and my thought was I could think put a software-modelling layer on top of that. But that simply is not going to work – it is just too complex.

Instead I am going to have to make some policy decisions in the software – essentially over how I model the local memory on the chip: each tile will process memory reads and writes and needs to know where that memory is – it could be in the global off-chip memory store or it could be on-chip.

The difference matters because, at least in theory, the on-chip memory is speedily accessible, while the off-chip memory is 50 to 100 to 500 times “further away”.  Because memory accesses exhibit locality it makes sense to ship blocks of addressed memory from the global to the local store – but doing so takes time and if there are a lot of memory movements then we get thrashing.

What I now have to do is think of what policy I will use to decide what memory gets stored locally (or, more likely, what policy I use to map the addresses). I’ll start by once again reviewing papers that propose some schemes for existing Networks-on-Chip.

In other news: I have had a paper (of which I am co-author and first named author) accepted by OSPERTS 15 – so I will be off to Sweden to get mauled by the audience there in early July. It will be an experience, and I am looking forward to it, but I also think it might be not so much a baptism, but a destruction by fire.



Die of an Intel 80486DX2 microprocessor (actua...
Die of an Intel 80486DX2 microprocessor (actual size: 12×6.75 mm) in its packaging. (Photo credit: Wikipedia)

Been a while since I’ve written here – been avoiding writing about politics, which has obviously not been so great for me in the last couple of weeks… but now I have something else to ruminate on.

I have reached a milestone, or perhaps basecamp, in my PhD research: having a model for memory management that needs further exploration. (Hopefully there may even be a paper on this soon.)

Some of that exploration will have to be in hardware, and that’s really beyond me but I can and should build a software model to test how a many core system built using this new model might operate.

So far I have been testing or proving concepts with OVPSim but it does not allow me to build a true asynchronous multi-core model, so I need to do that in software myself.

But where to begin – I have a list of classes that you might want to have in C++:

  • Computer – which would aggregate…
    • DRAM
    • Storage
    • NoC – which would aggregate…
      • Mesh
      • Tiles – which would aggregate…
        • CPU
        • Cache
        • Ports (to the Mesh)

I hope you can see how quickly this becomes complex – and all we are talking about here is a simple software framework to allow me to do the research (ie., delivering the software, complex as it is, is only the very start.)

I am struggling to know where to begin – C++ seems like the logical choice for this, but it’s not proving to be much fun. Particularly because my CPU class has to be able to “execute” some code – I thought about using a DSL but may stick to the XML output I got from my hacked Valgrind Lackey – as at least I can then use existing XML engines.

Should I build from the XML up – eg., get a CPU class that can hack the XML and pass the requests up the chain (eg via the cache up to the Mesh and up to the DRAM etc), or what?

Slogging it out

Wrote around 100 lines of C++ tonight, but don’t feel I am making much progress in building my project: not least because many of those lines were to replace something I’d written earlier in the week.

To make matters worse I keep looking at older code I’ve written and thinking how beautiful it is, rather than the stuff I am just slapping into Vim right now. I tell myself I probably thought the same then too, but right now none of this feels like fun.

The mess is all over on Github (look me up as mcmenaminadrian).

Building a model

SVG Graph Illustrating Amdahl's Law
SVG Graph Illustrating Amdahl’s Law (Photo credit: Wikipedia)

Had a good discussion with my supervisor today – he essentially said, in terms, “expect to produce nonsense for 18 months” (meaning experimental results which seem not so useful). This was helpful as it made me get my worries about the last two weeks of tinkering on the edges of building the first “experiment” – a logical model of a NoC – into perspective.

The work goes on.

(And a new book arrived – Using OpenMP: Portable Shared Memory Parallel Programming – having consciously avoided “middleware” when writing my QD I decided I did actually need to know about it after all.)

Books about PhDs

I was wondering whether anyone has any recommendations for books about getting/doing a PhD. I am now reading The Unwritten Rules of PhD Research and it is very good, so I’d happily recommend it – it is one of those books that helps you see the underlying order in what appears to be the chaos going on around you.

For my domain of study Writing for Computer Science: The Art of effective Communication is also essential reading.

A supercomputer on every desktop? Not yet, anyway

My PhD is about operating systems on Network-on-Chip (NoC) computers. I have not actually done any research yet, so don’t expect anything here – but I have been playing with some existing data and I think it gives some interesting results.

NoCs are part of the semiconductor industry’s response to the failure of “Dennard scaling”: Moore‘s law says we can double the number of transistors on a chip every 18 – 24 months and we are still able to do that. Dennard scaling was the thing that made that super useful – because it meant the power requirements for the processors stayed constant even as they acquired more transistors. Now it has broken down, building faster chips becomes that much more difficult because, bluntly, they would burn up unless we limited the power.

NoCs aim to get round this by replacing one fast and power hungry processor on a single chip with several less powerful processors on the same chip – the idea being if we can attack the problem with several slower processors we can get the job done more quickly than if we used just one faster processor.

But there’s a catch, a big one, as captured in Seymour Cray‘s question:

would you rather plough a field with two strong bulls or a thousand chickens?

NoCs do not replace one fast chip with a dozen not quite as fast chips – they parcel out the power eaten by that one chip to the whole network on the chip – it’s not quite as bad as dividing the computing power by the number of chips (for that was the case there would be no advantage at all), but it is not fantastically above that.

Using work published by Hadi Esmaeilzadeh from the University of Washington along with others from the University of Wisconsin – Madison, the University of Texas at Austin and Microsoft Research, my projection is that, if we took one of today’s fast chips and parcelled up the power, then we would see computing power decline like this:

  • One processor: 100% computing power
  • Two processors: 65% computing power each
  • Four processors: 38% computing power each
  • Eight processors: 21% computing power each
  • Sixteen processors: 11% computing power each
  • Thirty-two processors: 6% computing power each
  • Sixty-four processors: 3% computing power each

Now, 64 x 3 = 192, so that might look like quite a good deal – a 92% speed up. But it is not that simple because some part of the code, even if just the bit that starts and ends your process, can only run on one processor even if all the rest can be split into 64 equal parts. And the pieces that will only run on one processor are now 33 times slower than they were before. The key balance is this: how much code can you run at nearly twice the speed (92% speed up) versus how much do you have to run at 33 times slower than before?

The answer is that you have to run a lot of code in the fast zone before you really see a big advantage.

45nm NoC modelled

As the graph suggests you would need to have about 99.9% of your code capable of running in parallel before you saw a guaranteed speedup with 64 processors in your NoC. Plenty of such code exists – such as in image handling and so on – but you are not likely to be running too much of it on your desktop computer at any given time (except perhaps when you are running a streaming video application) and the big disadvantage is that when you are not running the parallel code you are stuck with the 3% performance.

(Actually, it’s not quite as simple as that, as you may have a faster processor equipped to do the single thread of execution stuff, but then your computer starts to become more expensive.)

In the future chips will get faster – but maybe not that much faster. In a decade’s time they could be between 400% and 34% faster than they are today, depending on whether you are optimistic or pessimistic (realistic?) about processor technologies. That will help, but still not enough to put this technology in your desktop – as opposed to your games console or your television set or maybe a specialised processor in a top of the range machine.

So don’t expect your personal supercomputer too soon.

“Go and invent something”

This, in terms, is what my supervisor said to me this afternoon – his point being that while I had successfully presented my literature review, the time had come to start looking at real things that could be put on Network-on-Chip systems.

So, some thinking required over Christmas.

I do have my parallel filesystem idea to look further at, but he’s also suggested one or two other areas to look at.

Anyway, Kansas is going bye bye.

And so to York


I am just back from two intellectually intoxicating days at the University of York, where I made an early start to my PhD (technically I am not starting until July) in real time operating systems.

In a few years this may all look like a mad escapade, perhaps I am old enough to know better. But right now I am admit to a slight giddy excitement about it all.

The peak moment was when I walked into the library, a building which you could live the rest of your life in. Walking up to the top floor, where the computer science texts were stored, I stopped off to read a few pages in a book about the correspondence between Mary McCarthy and Hannah Arendt. I don’t know much about either woman, but  I do know I want to know.

Th library also reminded me of the elevated status of research students – apparently, when I am issued with a card, I can borrow up to 50 (! Seems so outlandish I wonder if I misheard ’15’) items for as long as three months.

Roughly speaking there are about three times as many under-graduates in the UK as there were when I was one and so York (a middle sized institution) is about 50% “bigger” than Edinburgh was when I was there but numbers are not the only change one notices – there are far more overseas students than quarter of a century ago, sought by the universities because of the fees they pay and attracted to the UK by our universities’ reputation for excellence (both factors make the current government’s attitude of distrust towards foreign students look seriously flawed).

Cannot wait till I go back!

(And thanks again to Birkbeck for making it all possible).

University of Hertfordshire

University of Hertfordshire. This building hou...
Image via Wikipedia

I went to the University of Hertfordshire’s postgraduate open day today – a couple of strange feelings about the trip for political reasons – the one previous time I had been on the campus was when I had a not every pleasant encounter with the Revolutionary Socialist League/Militant Tendency controlled student Labour club of what was then Hatfield Polytechnic at the very end of 1987, and on the way there I suddenly realised I was walking down the same street where I had spent the afternoon “knocking up” for Labour on 1 May 1997.

But my trip today was nothing to do with politics: I was simply checking them out as a potential PhD institution. It was a long way to go for a five-minute conversation, though it was still worth it as it clarified for me that I should concentrate my efforts on getting the MSc project done and not worry about a PhD just yet.

I was quite impressed by the university, though, for a few reasons. Firstly, most of the main campus is built in a particular civic style popular in Britain in the late 1940s, early 1950s: low rise vernacular brick and glass I am going to call it as I don’t know any better. It’s a style I like because to me it suggests optimism and endeavour and public spirit after the huge financial and other hardships of the war – a war in which Britain’s willingness to sacrifice its finances was absolutely fundamental to the global victory over fascism and militarism.

Secondly, because they told a good tale of how they believe they are the best of the “new universities” and that they have backed up that claim by investing significantly in their infrastructure – they also said they run the largest university bus service in the world: so the Chinese are not beating Britain on every superlative yet!

What’s next?

Students taking a test at the University of Vi...
Image via Wikipedia

My first exam in the second year of the (part-time) MSc is tomorrow and I guess I am writing this blog partly as a way of avoiding more revision, but partly also because if last year’s experience is any guide, that exam will knock the stuffing out of any optimism I have, so I shall write something now while I still have some hope.

The exams are not the end of the degree if I pass them then technically I can claim a post-graduate diploma, but I already have one of them, in Journalism Studies from Westminster and as was said to me at the time “it’s just about worth the paper it is printed on”: I learnt a lot but nobody much else is impressed.

To get the degree I need to complete my project on memory management in the Linux kernel – it’s an ambitious project and time will be short so it may get frantic.

But when it’s over, what will I do? I don’t plan to work in IT: 45 seems quite an age to go from reasonable success and some prospects in one career to starting at the bottom in any case.

But nor do I want to abandon science for a second time. A part-time PhD? That really is a long term commitment, though.