-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Towards Multimaterial Simulations #932
base: master
Are you sure you want to change the base?
Conversation
Hi,
|
I'm afraid this is the only realistic option considering the current speed of yateto. Even currently, on some machines, the code generation takes more time than compiling the rest of SeisSol.
Yup. Well, it works for elastic-acoustic if you modify the Riemann solver accordingly. EDIT: You can also check my thesis draft, I state the Godunov states explicitly for the coupling and explain, what data is needed.
Note that this opens up another problem: Output. Acoustic only has 4 unknowns (and a different sign convention). This means that we would need to have capability of using two different output writers for different sections of the mesh. |
See SeisSol/yateto#62 , though I've only tested it for four materials and one order at a time for now (the core still does not compile yet), and without subroutines. It is extremely slow, but it works. Maybe we can pre-run some optimizations in Yateto? Or still optimize something? Alternatively, we can run Yateto multiple times, CMake/i.e. make/ninja should be able to parallelize that. The plan would be to ultimately offer a single SeisSol binary.
Yup, that's where I had noticed my fallacy... :/ Will need some re-design later. For now at least, I'll let everything focus on just order/precision then.
A temporary material definition exists in
I know, that's another thing why it's good to have the output/checkpointing rewrite soon-ish. ;)
Probably that will be in one go. Right now, the biggest challenge is to re-do the core (LtsLayout).
Ok. Sounds good. Probably, we can have a templated |
Parallelization should be easy, since Material/Order are independent. With 5 material models and 4 orders, you can generate the code in parallel on 20 cores, in the same time. Compilation time rises though, since we already use the parallelism from make.
The same problem holds for poroelasticity with 13 quantities. |
Regarding output again: we should be able to at least get the receivers and energy working without too many issues, I'd think. |
This PR is more or less meant as a suggestion and hopefully also as a tracking issue—it's definitely not ready for review or anything yet. (first drafts for this issue started somewhen rather shortly after #829 was completely done) Hopefully, it will be done in some months. But—if we don't merge it, it's fine as well.
It begins to work on multimaterial simulations, but it doesn't compile by now. Also, next to nothing has been tested. But if it even remotely works, we may soon also get rid of re-compiling SeisSol for each new equation, as a side effect.
What it does in short: each cell gets a configuration. Currently (that can be changed), the configuration is determined by the group of an element, and the configurations are specified in a file of their own. Right now, it's supposed to have the following YAML format:
And so on. The following features (most of them untested by now, unfortunately):
src/Common/cellconfig.hpp
). There's more template metaprogramming insrc/Common
by now. A configuration itself is an empty struct with a bunch of template arguments (i.e. Material, precision (real type), order, and plasticity) that is only used to select the appropriate types usingstd::visit
or someauto
-parametrized lambda. And, it's shorter than writing out four different arguments for each class (or using a preprocessor define to hide that). Thus, we can always just dotemplate<typename Config> class SomeKernel{...};
, and then usetypename Config::MaterialT
,typename Config::RealT
,Config::ConvergenceOrder
,Config::Plasticity
to access the arguments.Config
type.TimeCluster
class have been moved out of there, and are now placed in theWaveProp
folder. In particular, theTimeCluster
s retain all their actor logic.Equations
got all symlinks removed.LTSForest
which, in effect, spawns one LtsTree for each configuration, and goes over them in a visitor-like pattern: i.e. we need a ton of lambdas with auto parameters. And for some (likeCellLocalInformation
), that may not be necessary... We'll see.The following is currently in progress:
Kernel<Config>
, and creates an empty function withKernel<Config1>, Kernel<Config2>, ...
etc. as arguments. I'm not yet certain if it'll work, but it's not too nice even if it does. ... Alternatively, we could usestd::visit
, maybe.lookup
function.The following will need to be done:
LayeredStorage<ConfigLayer, IndexedLayer, InteriorGhostCopyLayer>
, and then to automatically generate types for all related configs and combinations with ghost, copy, and interior layer (can mneme do that?)—instead of relying on masking the respective things. If we have that, we could also support different dynamic rupture models in a single simulation (--again?)—if that's needed. ... Generally, can mneme help us in this direction maybe?Anyways, I know this PR is far too big; so I offer to split it into multiple parts, or open up a development branch which can also be used to work on the rewrite of the IO and checkpointing functionality in more PRs of their own.
Feel free to comment and criticize everything, or even if you think that it will not work out at all.