Exascale roadmaps, exascale projects and exascale lobbyists ask, on-again-off-again, for a fundamental rewrite of major code building blocks. Otherwise, so they claim, codes will not scale up. Naturally, some exascale projects bombard computational scientists with new domain-specific or domain-tailored languages, compiler extensions, frameworks, libraries and programming paradigms. The projects receive, in return, rewrites of simulation codes that are significantly faster. After a while. Or they get nothing at all, as users of the all the splendid new ideas find out that the proposed is not a fit to their requirements, the wheel of exascale innovations has already turned once more, or the rewrites have been that little bit more complex and more time-consuming than anticipated so that a complete rewrite finally became unfeasible. For our methodological evangelist, developing frameworks, languages, libraries, whatever would be such a joy, if only there were no or at least competent users . . .

The ISC18 workshop “The power of l(o)osing control”, organised by Tobias Weinzierl, did ask “when does a re-implementation of mature simulation fragments with novel HPC paradigms pay off?” More precisely, the organiser did ask “where is the pain barrier where consortia are willing to rewrite major code parts?”, “to which degree are mature simulation codes willing to give up control of SIMDsation, task scheduling, data placement, and so forth?” and “what information (arithmetic intensity, affinity, dependencies) should new paradigms expect their user codes to provide explicitly to frameworks?” Some answers to these questions from the workshop are summarised below. Even more questions did arise however.

I’m so sick of rewriting my code every time a new exascale project comes around the corner. The workshop kicked off with historical remarks by Tobias. When his software base underlying the H2020 FETHPC project ExaHyPE [1] was first developed as a heroic green-field approach, caches and careful memory usage used to be the non plus ultra. So the code was made to support extremely dynamic and adaptive meshes. Soon after, vectorisation and multicores became headliners on the center stage. This made the developers rewrite significant code parts into regular data structures fitting to parallel fors—just to learn afterwards that task-based parallelism is the new kid on the block everybody loves most. Today, the code tasks. But the developers didn’t win that much in terms of productivity, as they now have to think about proper task sizes, task priorities, mapping of tasks to MPI calls, and so forth. They feel being caught in a never-ending rewrite of core code parts as hardware and programming paradigms evolve. The code at no point had been future-proof.

We took away their scheduling ownership, now we have to get their data structures. The actual workshop followed this introduction. It featured six talks. Nathan Ellingwood from Sandia pointed out that their Kokkos project [2] started from a few heroic research code endeavours, too. It had been after that that they started to roll their ideas out as general-purpose ecosystem for legacy codes. One of Kokkos’ key techniques to obtain scaling code goes one step beyond the rewrites Tobias did complain about: They do not only provide parallel programming constructs. They also encourage the user to model their codes explicitly in terms of abstract data structures.

Nathan’s talk pointed out that working, i.e., scaling HPC DSLs and frameworks rely on data structures plus execution patterns. Teaming them up allows middleware or runtimes to deliver performance by choosing the right data structure realisation plus concurrency for the right platform. If we only focus on parallel programming constructs, it is, to some degree, not surprising if rewrites fail to deliver.

Thomas Fahringer discussed the rationale and lessons learned through the AllScale project [3]. He opened his presentation with the statement “I don’t believe in MPI+X+Y”. And notably, he doesn’t believe in task-based programming as the silver bullet for scalability either. Going one step beyond Nathan’s talk, he proposed to re-specify all codes in terms of their data structures plus concurrency, too, but to ask a compiler to derive the tasks and parallel constructs from hereon. The abstraction of data access plus data structure is not realised within a library or runtime, but made part of the actual translator. It can then rely on many complex code optimisation techniques such as the fusion of various parallel code regions. As such, “giving up control” is not a flaw, problem or challenge. Thomas: “It is a design principle.”

Richard Bower from Durham’s Institute of Computational Cosmology (ICC) seemed to be impressed by this idea. A team around him has written a major astrophysical SPH code from scratch. The new code SWIFT [4] expresses all of its data as small work items and formalises all work on these guys as tasks with dependencies. This green-field development allows their runtime to scale up. In a way, they seem also to rely on parallelism through parallel modelling of computations plus a formalisation of the used data structures. They just did it manually.

A controversial discussion broke off. How many data structures does a programming paradigm have to offer to allow scientists to write meaningful non-toy code? State-of-the-art physics combines all types of hierarchical meshes with FFTs, particle representations, and unstructured data sets. Or do sophisticated solutions always have to give the users the choice either to work with data structure specs plus tasks or solely parallel processing constructs? In this case, we would lose some of the academic purity of “giving up control”. Or do we need approaches where the user basically constructs her data structures? We did not find an answer, but it seems that thinking in tasks plus the data they work on is the right way to go: thinking only in terms of parallel fors or tasks doesn’t go far enough.

Garbage in, garbage out. Michael Bader presented his Chameleon project [5] and added an interesting observation to this: In his work, compute nodes may steal tasks plus their data from other ranks upon demand. Michael was able to present impressive scalability. They show that stealing leverages MPI work imbalances. Coming back to the compiler vs. runtime, it seems that a conclusion whether work decomposition should be done statically or dynamically is nowhere near. There are so many great opportunities, if systems suddenly can freely distribute their tasks in a lightweight manner also beyond shared memory borders.

Richard’s endeavour computes proper work decompositions in regular intervals which can be issued by the user, while Thomas’ and Nathan’s tools take ownership of work distribution through abstract specifications of data structures. All approaches rely on the fact that the right level of concurrency is provided, and that proper heuristics—when does decomposition pay off, e.g.—do exist. As Daniel Weingaertner from the Universidade Federal do Paran`a in the audience pointed out: The art is exactly this, to hide technical details (load distribution but also tiny little parameters such as grain sizes or pinning) from the developer. And that’s where runtimes and compilers really can help. Otherwise, developers might provide garbage input data. Michael’s approach provided a useful additional dimension: His approach hinges on online performance measurements. If the conclusion holds that many compile-time, static tunings due to heuristics are doomed to fail with the complex machines we face today, his approach still will succeed. Exaggerated: There’s no such thing as garbage in (in terms of work decomposition), but there is garbage work distribution.

We use C/C++ to improve accessibility and then suffer from the language’s restrictions and syntactic overhead. Any new programming model is worth developing if and only if there are users. And users have to be technically able to handle these models. Nathan’s, Richard’s, Thomas’ and Tobias’ approaches therefore all rely on C/C++. It seems that this language has finally become the ultimate to-be-used language. Bye, bye Fortran.

Harald Köstler kicked off his talk with “I have to say I’m surprised all people seem to use C++”. His refreshing talk was a tour de force through various studies on DSLs in HPC. They mainly orbit around stencil and multigrid codes. The ExaStencils/ExaSlang [6] project was one of them. Now, you might disagree with Harald that languages such as Scala or Lisp should be real candidates to program your next-generation-DSL—actually the majority of the audience first considered this to be a joke—but he made valid points: C++ templates are neither easy to maintain nor to use. Yet, most DSL extensions use generic meta programming. C++ itself is not a trivial, compact language. After all, it is way too generic to meet this goal. We consider it to be straightforward as we all are used to it, but how many young students bring along the right mastery of C++ already? Finally, just start to dream about opportunities that arise once you accept that you can use Just-In-Time compilation for example or stricter type checking. Indeed, Thomas had dropped an argument along these lines before: Compilers can contextualise code and tailor it to a situation. And if they fail due to a lack of information, they can at least let the user know that they’d prefer some more annotations, e.g. He admitted that compiling and understanding C++ was a painful exercise in AllScale. So maybe C++ is not the ultimate thing after all?

These computational scientists should be forced to rewrite everything from scratch from time to time anyway—this makes them tidy up their codes. Richard and Tobias both gave talks on bigger pieces of software. While Tobias follows an incremental approach where core routines are replaced when new technologies emerge, Richard’s endeavour is a complete rewrite of well-established physics and algorithms with a task paradigm. With Tobias being unhappy about the zombie of rewrites—they never go away—it was natural to ask Richard: was it worth it?

This is a delicate question, as obviously it took his team quite a while to deliver the new code base. This is time “lost” for “actual” science. However, he came to the conclusion that it has been worth it nevertheless. It is easy to say this once your code is up and scaling, but Richard pointed out that there are two further success implications: His team has learned a lot about software. And his team has cleaned up the code.

Whenever one starts a complete rewrite, it is very human and convenient to sit down, and try to strip a code design off its historic ballast. Complete rewrites (triggering re-thinks) improve the code quality. It is however, as Richard pointed out, almost sad to recognise that interfaces then grow and become more complex again. You start with a neat, clean design and you end up again with a complex piece of code.

The Swiss army knife is just yet another framework. The audience just started to digest Harald’s preferences for esoteric languages, when he confessed another thing: As far as he observes, most successful DSLs rely on fast and successful libraries under the hood. So the DSL’s job is not to come up with the performance. In most projects, it is its jobs to make the performance available to the user. Nathan had clarified before that Kokkos relies on BLAS et al., while Thomas’ talk did support this impression, too: His compiler also relies on libraries for performance-critical tasks. These observations relax the burden of scalability for DSLs.

In this context, Martin Kronbichler collected some ideas and lessons learned how to make a general-purpose library underlying many different codes perform. His work around deal.II [7] focuses on particular mesh types with “only” particular mesh entities and tensor-product styles, while deal.II provides manufactured data iterators and operators for popular operations. deal.II might not be a classic DSL, as it is very versatile. However, his work on purpose exploits particular characteristics and specialisations to get the whole thing fast.

Richard’s observation that their task system is tailored towards their particular application started some arguments around the question “what is a framework”? Many frameworks or libraries are probably not worth calling them that way, as they are effectively written for one particular purpose. Their programmers might claim that they are generic—they are computer scientists after all—but, at the end of the day, what they call frameworks simply realise plain functional decomposition. Different components in one piece of software do different things.

It was not clear among the workshop participants to which degree frameworks and DSLs had to be generic. Even the other way round, one might come to the conclusion that frameworks have to grow and evolve with their applications and deliver exactly the level of flexibility an actual project needs. Richard and Harald for example pointed out that they both look into structured vs. unstructured data structures or the decision when to store data as AoS or SoA. Some evergreens never disappear.

A few more implications from this project-framework co-design approach were discussed next: Richard clarified that starting from scratch is the easy part. The difficult part is to stop. Once a team has written component i itself—this will be the ultimate fit to the project— there is this temptation to write component i+1 as well. We did it for the mesh, why not also write our own load balancing? And the load balancing worked out really well (indeed it is an exact fit to our project though we are not really competitive with state-of-the-art libraries), wouldn’t it be clever to come up with our own few linear equation system solvers? And so forth . . . Perhaps the framework hasn’t been there in the first place. It grew and noone told it to stop. If this were the case, the term framework would describe a flaw rather than a cool computer science thing.

Come on, love me for the money. Let’s forget about such heretic ideas and close the discussion with two observations. The first one was made by Richard and explicitly stated by Nathan: Their ecosystems started to flourish once they provided the right tools. Task graph plotters for task-based systems are an example. The best concept might be hard to digest if you don’t give developers the right tools that allow them to develop economically. The Kokkos and the deal.II team added the second mandatory ingredient for success: a reasonable user base and active engagement with that very base.

Both items highlight that continuous, long-term funding is essential for a successful introduction of (exascale) programming paradigms, runtimes, DSLs, compilers and frameworks. Consortia need the time and resources to build up a development ecosystem around any new programming concept and to equip them with the right tools. Establishing this does not materialise in immediate scientific output, and, at the same time, it has to start way before actual computational science can be made through a new paradigm. Well, finally there had been broad agreement among all workshop participants: The establishment of a community and ecosystem is something that requires resources, but it neither fits to standard projects of short and medium duration, nor to our project notion, which has to start from the computational challenge. In an ideal world, the ecosystem has to be there before to allow application specialists to assess it and to move into a mature environment to solve “their” problem. There should thus be more funding for the ecosystem not tied to particular application research questions.

About the Author

Tobias Weinzierl is Associate Professor at the Department of Computer Science at Durham University. His work orbits around novel algorithms and clever implementations for applications from scientific computing which employ state-of-the-art physics and mathematics. At the moment, his research focuses mainly on data flow/movement (minimisation), data structure (organisation) and programming paradigm challenges. He is particularly interested in dynamically adaptive multiscale methods based upon spacetrees that interact with multigrid solvers for elliptic and parabolic partial differential equations, that host particle systems with particles of varying cut-off radii or size, or carry Finite Volume-alike discretisations. He is involved in multiple scientific open source projects such as ExaHyPE [1] and Peano [8].

References

[1] ExaHyPE—an Exascale Hyperbolic PDE Engine. http://exahype.eu

[2] Kokkos—The C++ Performance Portability Programming Model. https://github.com/kokkos/kokkos/wiki

[3] AllScale—An Exascale Programming, Multi-objective Optimisation and Resilience Management Environment Based on Nested Recursive Parallelism. http://www.allscale.eu

[4] SWIFT—SPH With Inter-dependent Fine-grain Tasking. http://icc.dur.ac.uk/swift

[5] Chameleon—Eine Taskbasierte Programmierumgebung zur Entwicklung reaktiver HPC Anwendungen. http://www.chameleon-hpc.org

[6] Exastencils—Advanced Stencil-Code Engineering. http://www.exastencils.org

[7] deal.II—an open source finite element library. https://www.dealii.org

[8] Peano—a framework for dynamically adaptive Cartesian meshes. http://www.peanoframework.org