3from .DaStGenToLegacyTool
import DaStGenToLegacyTool
13 Simple generator mapping a DaStGen2 object onto a plain C++ class
21 return "peano4::stacks::STDVectorStack< " + self.
_data.get_full_qualified_type() +
" >";
25 return "#include \"peano4/stacks/STDVectorStack.h\" \n \
26 #include \"" + self.
_data.namespace[-1] +
"/" + self.
_data.name +
".h\""
31 Pass in a version of output. It is important that external tools are used
32 first before we start any compile or so. So I add them first.
34 full_qualified_name =
""
35 for i
in self.
_data.namespace:
36 full_qualified_name += i
37 full_qualified_name +=
"::"
38 full_qualified_name += self.
_data.name
39 self.
_data.data.set_full_qualified_name(full_qualified_name)
41 self.
_data.data.write_header_file( self.
_data.subdirectory + self.
_data.namespace[-1] +
"/" + self.
_data.name +
".h" )
42 self.
_data.data.write_implementation_file( self.
_data.subdirectory + self.
_data.namespace[-1] +
"/" + self.
_data.name +
".cpp" )
43 output.makefile.add_cpp_file( self.
_data.subdirectory + self.
_data.namespace[-1] +
"/" + self.
_data.name +
".cpp", generated=
True )
50 Default superclass for any data model in Peano which is stored within the grid
52 A DaStGen2 data type generator. To add fields to this object, just
53 use the DaStGen2 instance data of this field, i.e. data.add_attribute().
58 data: dastgen2.DataModel
59 Add elements to this guy to enrich your data model.
61 peano4_mpi_and_storage_aspect: peano4.dastgen2.MPIAndStorageAspect
62 This aspect adds the Peano-specific MPI routines to the data type,
63 i.e. routines used for boundary and re-balancing exchange. Modify
64 this one if you want to control certain data exchange or merge
70 I can control when to store data through the peano4_mpi_and_storage_aspect.
75 If you want to add your own MPI merge implementation, you have to
76 alter the attribute peano4_mpi_and_storage_aspect.
88 readme_descriptor =
"""
92 readme_package_descriptor =
"""
93### Data structure modelling
95Peano models its data structures via a tool called DaStGen. The actual DaStGen
96version in use is the second generation of DaStGen which is integrated into
97LLVM, e.g. The first generation of DaStGen has been a stand-alone Java tool
98which serves as a precompiler. As DaStGen 2 is not published yet, we appreciate
99a citation of the two original DaStGen papers when you discuss the memory needs:
102 @InProceedings{Bungartz:2008:DaStGen,
103 author={Bungartz, Hans--Joachim and Eckhardt, Wolfgang and Mehl, Miriam and Weinzierl, Tobias}, "
104 editor={Bubak, Marian and van Albada, Geert Dick and Dongarra, Jack and Sloot, Peter M. A.},
105 title={DaStGen---A Data Structure Generator for Parallel C++ HPC Software},
106 booktitle={Computational Science -- ICCS 2008},
108 publisher={Springer Berlin Heidelberg},
109 address={Berlin, Heidelberg}, "
111 isbn={978-3-540-69389-5}
115 @article{Bungartz:2010:DaStGen,
116 title = {A precompiler to reduce the memory footprint of multiscale PDE solvers in C++},
117 journal = {Future Generation Computer Systems},"
123 doi = {https://doi.org/10.1016/j.future.2009.05.011},
124 url = {https://www.sciencedirect.com/science/article/pii/S0167739X09000673},
125 author = {H.-J. Bungartz and W. Eckhardt and T. Weinzierl and C. Zenger},
126 keywords = {Data compaction and compression, Code generation, Multigrid and multilevel methods},
127 abstract = {A PDE solver's value is increasingly co-determined by its memory footprint, as the increase of computational multicore power overtakes the memory access speed, and as memory restricts the maximum experiment size. Tailoring a code to require less memory is technical challenging, error-prone, and hardware-dependent. Object-oriented code typically consumes much memory, though developers favour such high-level languages offering meaningful models and good maintainability. We augment the language C++ with new keywords branding records to be memory-critical. Our precompiler DaStGen then transforms this augmented specification into plain C++ optimised for low memory requirements. Hereby, it encodes multiple attributes with fixed range within one variable, and it reduces the number of bits per floating point value. The tool also generates one user-defined MPI data type per class and, thus, facilitates the construction of parallel codes with small messages.}
133 super(DaStGen2, self).
__init__(name)
146 def configure(self, namespace, association, subdirectory=""):
149 I always need the MPI aspect, but I can't add the right one before I don't
150 know whether this DaStGen model is used for vertices, faces or cells. To I
151 hook into this routine. In theory, I could add the DaStGen2 MPI aspect
152 straightaway (in the constructor), but I decided to do so in one place.
155 Implementation detail
157 It is important that we add the aspect once when we initialise the code and
158 then reconfigure it. I had the commented out version before, but that one
159 adds an aspect everytime configure() is called and thus causes issues as
160 aspects might be added multiple times.
163 super(DaStGen2, self).
configure(namespace,association,subdirectory)
172 @additional_load_and_store_arguments.setter
175 for new_argument
in new_arguments:
177#include \"""" + new_argument[1].replace(
"::",
"/") +
""".h"
Represents on DaStGen2 object, i.e.
Represents Peano's MPI and storage aspect injected into a DaStGen model.
Specialisation of dastgen2.attributes.DoubleArray which relies on Peano's tarch.
Simple generator mapping a DaStGen2 object onto a plain C++ class.
get_header_file_include(self)
construct_output(self, output)
Pass in a version of output.
get_stack_container(self)
Default superclass for any data model in Peano which is stored within the grid.
__init__(self, name)
Both the association and the namespace are not to be set directly, but through the operation configur...
_additional_load_and_store_arguments
configure(self, namespace, association, subdirectory="")
I always need the MPI aspect, but I can't add the right one before I don't know whether this DaStGen ...
peano4_mpi_and_storage_aspect
additional_load_and_store_arguments(self)
_additional_load_and_store_arguments