Started hacking on GHC capabilities
Today I’ve started the small personal hacking project of implementing dynamic capatiblities in GHC‘s parallel runtime system; I’ll blog about my efforts, problems and solutions and would be grateful for any hints, comments or pointers for more documentation. I began by talking with Simon Marlow and discussing the idea. He said that it’s a least worthwhile to try implementing it.
Currently I
- made an account (mlesniak) on the GHC’s developers wiki.
- opened a ticket (No. #3729) as a task, describing my idea: “Currently the number of capabilities can only be set at the start of a program using -N. At least for benchmarking and playing with semi-implicit code (any other real-world scenarious?) if would be nice to change the number of capabilities at runtime.”
Current questions:
- There is no person assigned on this task, should I assign myself?
- It’s the only project without a particular difficulty (Diffuclty: None); should I set one or is this set by one of the “important” maintainers?
- downloaded the source for GHC HEAD, according to Getting Started
- was able to compile it on my 2.4 GHz Dualcore with 4 GB memory using the Building Guide. It took about 40 minutes for a full compile (yikes!)
- took a first look into ghc/rts/ Capability.c and Capability.h. This looks quite complicated and I probably have to understand a lot of the underlying system before I can even think about trying to modify this part of the RTS itself. Hopefully, the GHC Commentary will help.
Why do I do this? Firstly, I really like to solve problems and learn new things on the way. Secondly, I was always interested in the underlying parallel runtime system of GHC but without a concrete task motivating myself to understand this huge system was difficult. Thirdly, I hope that by learning part of the system I’m able to implement some of my (currently quite vague) ideas on dynamic adaptiblity of parallel runtime systems.
I will keep the interwebs updated, but do not expect too much soon, since I do this primary in my free time. Any hints, questions, remarks, (de-)motivating comments?