I think this is a very good idea. Indeed, dune/common is very crowded and in my opinion, we should think about moving most headers into suitable subdirectories.
I would also like to add a few directories and Matrin's suggestion looks reasonable (although math, math/vector, math/matrix is a bit more than I would have suggested...)
Feel free to improve the suggestion. I was merely trying to keep the number of headers per subdirectory small. Just a math subdirectory will be sufficient for me, too.
I'm also not convinced by most of the cons Markus mentioned but
think that 63 header files in one directory is much to much for
users to find classes in the module. In addition this number has been
nicely increasing over the years:
headers in common | how long ago
head: 63 |
rev 6500: 65 | 1 year
rev 6000: 55 | 2.5 years
rev 5500: 47 | 3.5 years
rev 5000: 40 | 5 years
That looks quite linear - more than 1 header every 2 months (except the latest value no idea where those headers disappeared to - perhaps dune-geometry... extrapolating gives us about 100 headers in 2018 :-)
I second Christian's proposial.
Maybe binaryfunctions.hh can be moved to parallel/, too. It is only used in ComposeMPIOps in mpicollectivecommunication.hh (see #600 (closed)).
Like Markus I don't see a benefit in creating to many folders. What is the benefit of a folder containing 2 to 4 headers? Searching for the right file is harder for me; I usually have to look in multiple folders because it is rarely obvious to what folder a header belongs. I. e. in Martin's suggestion, I'd expect array.hh in c++11.
Concerning Andreas statistics, I don't see the problem. The number of dune core modules is growing over the time, too. Many files contain useful features and I don't want to miss the features we gained in the last 5 years.
I just migrated the parallel headers to the subdirectory in my own branch (without compatibility). Using the attached script, adapting all my other modules (dune-common had to be done by hand) took only a few commits.
As we seem to agree on moving the parallel headers, you can check for yourself whether moving the headers is a problem or not. Of course, the main branch of dune-common should provide compatibility headers for one release cycle.
@Andreas: I think you misread/misinterpreted Christoph's post. IMHO he (like me BTW) is not seeing how finding a class is easier with more subdirectories.