Peano
Loading...
Searching...
No Matches
Project.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3import peano4.api
5from peano4.api.taskgraph.compiler.PropagateUseStatements import propagate_use_statements
6from peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag import derive_load_store_compute_flag
7
8import dastgen2
9
10import abc
11import os
12import sys
13
14
15class Project(object):
16 """!
17
18 ExaHyPE 2 project
19
20 Represents an ExaHyPE 2 project. An ExaHyPE2 project is a Peano 4
21 project with a particular set of actions (algorithmic phases)
22 that you can choose from and with particular solver types. It
23 realises a builder mechanism, i.e. you build up your ExaHyPE 2
24 project and then you finally tell the project "give me the Peano 4
25 project". From hereon, you can use this Peano 4 project to actually
26 set up the Peano 4 application.
27
28 The project will have a marker per cell that encodes stuff alike
29 a boundary marker. But it is also used to coordinate different
30 solver types.
31
32 @see generate_Peano4_project()
33 """
34
35 class Generator(abc.ABC):
36 """!
37
38 Base class for the code generation steps that turn an ExaHyPE 2
39 Project's configuration into actual generated files.
40
41 generate_Peano4_project() below currently does this work inline (see
42 the "@todo Has to go into a generator" note in there); the various
43 steps it performs (writing the solver implementation files, the
44 solver repository, the main file, ...) are meant to become Generator
45 subclasses instead, of which SolverToCPPFiles is the first.
46
47 """
48
49 def __init__(self, project: "Project"):
50 self.project = project
51
52 @abc.abstractmethod
53 def construct_output(self, peano_project):
54 """!
55 Add this generator's output to peano_project (a
56 peano4.api.Project-compatible object, or anything else that
57 add()'s cleanly into peano_project.output). This is the one
58 thing every Generator has to implement.
59
60 peano_project: peano4.api.Project
61 The Peano 4 project that self.project.generate_Peano4_project()
62 is currently assembling. It is a local variable there, not an
63 attribute - merely passed through here, so this generator can
64 add its own artefacts to it.
65 """
66
67 def __init__(self, namespace, project_name, executable, directory=".", subdirectory="", abstract_overwrite=True):
68 # Kept around only to construct the peano4.api.Project afresh each
69 # time generate_Peano4_project() runs - see there. That project is a
70 # local variable, not an attribute: repeated calls to
71 # generate_Peano4_project() must yield an independent snapshot
72 # rather than accumulate onto a stale, shared instance.
73 self._namespace = namespace
74 self._project_name = project_name
75 self._directory = directory
76 self._subdirectory = subdirectory
77 self._abstract_overwrite = abstract_overwrite
78
79 self._solvers = []
80 # What is realised: single solvers and hosts of several solvers, in the order of their addition
81 self._realisations = []
82 self._domain_offset = [0.0, 0.0, 0.0]
83 self._domain_size = [1.0, 1.0, 1.0]
84 self._dimensions = 3
89 self._log_filter_file = "exahype2.log-filter"
90 self._number_of_threads = "tarch::multicore::Core::UseDefaultNumberOfThreads"
91 self._multicore_orchestration = "tarch::multicore::orchestration::createDefaultStrategy()"
92 self._timeout = 3600
93 self._gpus = []
94 self._step_report_class = "peano4::DefaultStepReport"
95 self._additional_includes = [ "tarch/logging/LogFilterFileReader.h",
96 "tarch/accelerator/Device.h"
97 ]
99 self._build_mode = peano4.api.output.CompileMode.ASSERTS
100 self._executable_name = executable
101 self._periodic_BC = [False, False, False]
102 self._output_path = "./"
103
104 # Turns this project's configuration into the header/implementation
105 # file pair holding main(). Defaults to an ExaHyPE-flavoured main
106 # similar to python/exahype2/ExaHyPEMain.template.h/.cpp; assign a
107 # different Project.Generator subclass instance to use your own.
108 from .generators.DefaultSimulationMain import DefaultSimulationMain
109 self.mainfile_generator = DefaultSimulationMain(self)
110
111 # Generates repositories/SolverRepository.h/.cpp (one extern
112 # instance per registered solver, plus the getMinTimeStamp()/
113 # getMaxTimeStamp() aggregators).
114 from .generators.SolverRepositoryGenerator import SolverRepositoryGenerator
115 self.solver_repository_generator = SolverRepositoryGenerator(self)
116
117 # Translates each of the four algorithmic phases' task graphs into a
118 # sequence of Observers (peano4.api.solversteps.Step). Defaults to
119 # the simplest possible compiler, which just linearises the task
120 # graph without exploiting any of its parallelism; assign a
121 # different translate() routine (e.g. from a hypothetical
122 # peano4.api.taskgraph.compiler.Parallel) to use a smarter one.
123 self.compiler = peano4.api.taskgraph.compiler.Sequential.translate
124
125
126 def set_load_balancing(self, load_balancer_name, load_balancer_arguments=""):
127 """! Set load balancing scheme
128
129 The load balancing scheme controls how subtress are distributed both
130 among ranks and threads, i.e. the instance is important for MPI but
131 also whenever you use any multithreading strategy.
132
133 Similar to set_multicore_orchestration(), you have to let the project
134 know about where the load balancing is held. If you rely on the
135 load balancing toolbox and if you have configured Peano with the
136 load balancing toolbox, then simply adding the right eader is
137 sufficient:
138
139 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140 project.add_mainfile_include( "toolbox/loadbalancing/strategies/Hardcoded.h)
141 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
143 If you use a bespoke load balancing, you also have to add the
144 implementation file or hosting library to the project.
145
146 @param load_balancer_name: string
147 Should be full-qualified name of the load balancer.
148 By default, I recommend to pass "toolbox::loadbalancing::strategies::RecursiveSubdivision".
149
150 @param load_balancer_arguments: string
151 If your load balancing requires parameters, add them
152 here. It is a string that will be copied into the C++ class instantiation.
153 Please add the brackets yourself, i.e. "(3,4,5)" is fine, but "3,4,5" is not.
154 The only exception is the empty parameter list. Here, you can/should simply
155 add the empty string.
156 """
157 self._load_balancer_name = load_balancer_name
158 self._load_balancer_arguments = load_balancer_arguments
159
160
161 def set_log_filter_file(self, file_name):
162 """! Set a log filter file name
163
164 Pass in the empty string, if you don't want the code to use the
165 hard-coded defaults. That is, by default an ExaHyPE2 application
166 searches for a file exahype2.log-filter. Through this call, you can
167 instruct the project to use another filter file.
168
169 @param file_name String
170 Name of the log filter file that the application should load on
171 startup.
172
173 """
174 self._log_filter_file = file_name
175
176
177 def set_number_of_threads(self, value):
178 """! Set number of threads to use
179
180 Pass in number of threads (positive integer) or a string such as
181 "tarch::multicore::Core::UseDefaultNumberOfThreads". Please note that
182 this value is handed through to Peano which in turn passes it on the
183 tarch::multicore::Core::configure(int). It then depends on the
184 multithreading backend if this backend allows you to set the thread
185 count manually. Many backends (such as OpenMP) do not allow this,
186 but require users to use environment variables (or scheduler options)
187 instead.
188
189 """
190 self._number_of_threads = value
191
192
194 """! Set orchestration
195
196 The orchestration accepts one value which is a C++ statement. This
197 value has to be a string which creates an orchestration object,
198 i.e. an object of the type tarch::multicore::orchestration::Orchestration,
199 on the heap.
200
201 You can either create it directly (in this case you need to add a new),
202 or you can use a factory method such as
203 tarch::multicore::orchestration::StrategyFactory::createDefaultStrategy().
204
205 Depending on where you come from, you might have to add the strategy's
206 header file to the project explicitly. By default, the ExaHyPE 2
207 project only is aware of very few strategies. Here's an example:
208
209 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210 project.add_mainfile_include( "tarch/multicore/orchestration/Hardcoded.h")
211 project.set_multicore_orchestration(
212 "new benchmarks::exahype2::ccz4::MulticoreOrchestration()"
213 )
214 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215
216 @see exahype2.Project.add_mainfile_include()
217 @param value C++ expression delivering a new orchestration object on the heap
218
219 """
220 self._multicore_orchestration = value
221
222
223 def set_timeout(self, value):
224 """! Set timeout
225 value has to be a number greater or equal to zero, this then sets the
226 timeout in seconds after which a node waiting for an MPI message shall
227 quit an shutdown the whole application with an error report.
228 If zero is passed, this feature is switched off and nodes will wait
229 indefinitely.
230 """
231 if value < 0:
232 raise Exception("Timeout has to be greater or equal to 0")
233 self._timeout = value
234
235
236 def set_step_report_class(self, class_name):
237 """! Set the C++ class the generated main instantiates to report on steps
238
239 class_name: str
240 Fully qualified C++ class name (e.g. "peano4::DefaultStepReport",
241 the default) of a peano4::RunMultipleSteps::Report subclass. The
242 generated main creates exactly one instance of it, so the class
243 has to be default-constructible. If you pass in anything other
244 than the default, its header is not included automatically - you
245 have to make it visible to the generated main yourself.
246 """
247 self._step_report_class = class_name
248
249
250 def set_gpus(self, value):
251 """! Set GPUs to be used
252 value is a list of integers or the empty list if you want the code to
253 use all GPUs that are visible to a rank.
254 """
255 self._gpus = value
256
257
258 """
259 The standard extensions that I use for both Peano and ExaHyPE.
260 """
261 LibraryDebug = "_debug"
262 LibraryRelease = ""
263 LibraryTrace = "_trace"
264 LibraryAsserts = "_asserts"
265 LibraryStats = "_stats"
266
267 def set_Peano4_installation(self, src_path, mode=peano4.api.output.CompileMode.RELEASE):
268 """
269 src_path: string
270 Path (relative or absolute) to the src directory of Peano. This path
271 should hold both the headers (in subdirectories) and all the static
272 libraries.
273
274 mode: peano4.api.output.CompileMode
275 """
276 self._Peano_src_directory = src_path
277 self._build_mode = mode
278
279 def add_solver(self, solver):
280 """!
281
282 Add a solver, or a host of several coupled solvers
283
284 @param solver: exahype2.api.Solver or a coupling
285 A coupling (e.g. exagrype.api.FOSOSolver) brings its solvers along,
286 i.e. it has an attribute solvers. The project registers each of them
287 with its solver repository and README, but lets the coupling realise
288 them (generate_solver_realisation()), so it can couple the task
289 graphs of its solvers.
290
291 """
292 if hasattr(solver, "solvers"):
293 self._solvers.extend(solver.solvers)
294 else:
295 self._solvers.append(solver)
296 self._realisations.append(solver)
297
299 self._solvers = []
300 self._realisations = []
301 self._peano_project.cleanup()
302
303 def __export_constants(self, peano_project):
304 """
305 We export ExaHyPE's constants. Besides the constants from ExaHyPE,
306 we also export some parameters from Peano onto the ExaHyPE constants
307 file. Therefore, it is important that you parse the configure output
308 before we export the constants.
309
310 peano_project: peano4.api.Project
311 The Peano 4 project that generate_Peano4_project() is currently
312 assembling. It is a local variable there, not an attribute -
313 merely passed through here, so this routine can export onto it.
314 """
315 peano_project.constants.clear()
316 offset_string = "{" + str(self._domain_offset[0])
317 size_string = "{" + str(self._domain_size[0])
318 for i in range(1, self._dimensions):
319 offset_string += ","
320 size_string += ","
321 offset_string += str(self._domain_offset[i])
322 size_string += str(self._domain_size[i])
323 offset_string += "}"
324 size_string += "}"
325 peano_project.constants.add_include("""#include <bitset>""")
326 peano_project.constants.add_include("""#include "tarch/la/Vector.h" """)
327 peano_project.constants.add_include("""#include "peano4/utils/Globals.h" """)
328 peano_project.constants.export_const_with_type(
329 "DomainOffset", offset_string, "tarch::la::Vector<Dimensions,double>"
330 )
331 peano_project.constants.export_const_with_type(
332 "DomainSize", size_string, "tarch::la::Vector<Dimensions,double>"
333 )
334 peano_project.constants.export("MinTerminalTime", str(self._min_terminal_time))
336 peano_project.constants.export(
337 "MaxTerminalTime", str(self._max_terminal_time)
338 )
339 else:
340 peano_project.constants.export(
341 "MaxTerminalTime", "std::numeric_limits<double>::max()"
342 )
343
344 peano_project.constants.export_boolean_sequence("PeriodicBC", self._periodic_BC)
345
346 build_string = "python3 "
347 for i in sys.argv:
348 build_string += " "
349 build_string += i
350 peano_project.constants.export_string("BuildInformation", build_string)
351 peano_project.constants.export_string(
352 "ConfigureInformation", peano_project.output.makefile.configure_call
353 )
354
355 for i in self._solvers:
356 readme_descriptor = i.create_readme_descriptor(self._domain_offset[0], self._domain_size[0])
357 if readme_descriptor is not None:
358 peano_project.output.readme.add_entry(readme_descriptor)
359
361 self,
362 dimensions,
363 offset,
364 size,
365 min_end_time,
366 periodic_BC=[False, False, False],
367 max_end_time=0.0,
368 ):
369 """
370 ! Set the global simulation parameters
371
372 @param dimensions: 2 or 3
373
374 @param offset: [Float]
375 Has to have dimension number of entries.
376
377 @param size: [Float}
378 Has to have dimension number of entries and all of them have to be
379 positive. At this point, we strongly suggest that all size entries
380 are exactly the same. While Peano and ExaHyPE do support anisotropic
381 meshes, most compute kernels do not, so working with something else
382 than a square or cube will likely break all numerics.
383
384 @param max_end_time: Float
385 If you set it zero (or actually any value smaller than min_end_time), then
386 the code will run until the cell that lags behind the most hits the min time.
387 If you specify a valid max time however, you can stop the sim as soon as the
388 most advanced cell exceeds this threshold.
389
390 There are no plot settings here: when and how often to plot is
391 configured per solver on its plotter, e.g.
392 exahype2.api.fv.PlotAsVTKFile.
393 """
394 self._domain_offset = offset
395 self._domain_size = size
396 self._dimensions = dimensions
397
398 assert (
399 len(self._domain_offset) == dimensions
400 ), "domain offset vector and dimensions don't match"
401 assert (
402 len(self._domain_size) == dimensions
403 ), "domain offset vector and dimensions don't match"
404
405 self._max_terminal_time = max_end_time
406 self._min_terminal_time = min_end_time
407
408 self._periodic_BC = []
409 for d in range(0, dimensions):
410 self._periodic_BC.append(periodic_BC[d])
411
412 def set_output_path(self, path):
413 self._output_path = path
414 if not os.path.exists(self._output_path):
415 try:
416 os.makedirs(self._output_path)
417 except:
418 print("Couldn't create the defined output path, please ensure that this path exists")
419 if not self._output_path.endswith("/"):
420 self._output_path += "/"
421
422
423 _EXAHYPE_PACKAGE_DESCRIPTION = """
424
425### ExaHyPE 2
426
427This code uses ExaHyPE in its second generation. The first generation of the
428code was developed through an EU FET HPC project called ExaHyPE. This first
429generation was built on top of Peano in its third generation. The present
430code uses ExaHyPE 2 which is a complete rewrite built on top of Peano 4. We
431do not yet have a release paper for this second generation of ExaHyPE, and
432thus appreciate any citation of the original release paper
433
434 @article{Reinarz:2020:ExaHyPE,
435 title = {ExaHyPE: An engine for parallel dynamically adaptive simulations of wave problems},
436 journal = {Computer Physics Communications},
437 volume = {254},
438 pages = {107251},
439 year = {2020},
440 issn = {0010-4655},
441 doi = {https://doi.org/10.1016/j.cpc.2020.107251},
442 url = {https://www.sciencedirect.com/science/article/pii/S001046552030076X},
443 author = {Anne Reinarz and Dominic E. Charrier and Michael Bader and Luke Bovard and Michael Dumbser and Kenneth Duru and Francesco Fambri and Alice-Agnes Gabriel and Jean-Matthieu Gallard and Sven K\"oppel and Lukas Krenz and Leonhard Rannabauer and Luciano Rezzolla and Philipp Samfass and Maurizio Tavelli and Tobias Weinzierl},
444 keywords = {Hyperbolic, PDE, ADER-DG, Finite volumes, AMR, MPI, TBB, MPI+X},
445 abstract = {ExaHyPE (An Exascale Hyperbolic PDE Engine) is a software engine for solving systems of first-order hyperbolic partial differential equations (PDEs). Hyperbolic PDEs are typically derived from the conservation laws of physics and are useful in a wide range of application areas. Applications powered by ExaHyPE can be run on a student's laptop, but are also able to exploit thousands of processor cores on state-of-the-art supercomputers. The engine is able to dynamically increase the accuracy of the simulation using adaptive mesh refinement where required. Due to the robustness and shock capturing abilities of ExaHyPE's numerical methods, users of the engine can simulate linear and non-linear hyperbolic PDEs with very high accuracy. Users can tailor the engine to their particular PDE by specifying evolved quantities, fluxes, and source terms. A complete simulation code for a new hyperbolic PDE can often be realised within a few hours - a task that, traditionally, can take weeks, months, often years for researchers starting from scratch. In this paper, we showcase ExaHyPE's workflow and capabilities through real-world scenarios from our two main application areas: seismology and astrophysics.
446 Program summary
447 Program title: ExaHyPE-Engine Program Files doi: http://dx.doi.org/10.17632/6sz8h6hnpz.1 Licensing provisions: BSD 3-clause Programming languages: C++, Python, Fortran Nature of Problem: The ExaHyPE PDE engine offers robust algorithms to solve linear and non-linear hyperbolic systems of PDEs written in first order form. The systems may contain both conservative and non-conservative terms. Solution method: ExaHyPE employs the discontinuous Galerkin (DG) method combined with explicit one-step ADER (arbitrary high-order derivative) time-stepping. An a-posteriori limiting approach is applied to the ADER-DG solution, whereby spurious solutions are discarded and recomputed with a robust, patch-based finite volume scheme. ExaHyPE uses dynamical adaptive mesh refinement to enhance the accuracy of the solution around shock waves, complex geometries, and interesting features.
448 }
449 }
450"""
451
452 def generate_Peano4_project(self, verbosity=peano4.api.LoggerVerbosity.OFF):
453 """!
454
455 Construct a Peano 4 project and return it
456
457 Build the Peano 4 project, i.e., all the action sets et al that you require
458 to run this ExaHyPE 2 application. The Peano 4 project is a local variable
459 here - a fresh peano4.api.Project - that is populated over the course of
460 this call and eventually returned.
461
462 This routine generates a Peano project, i.e. the domain-specific ExaHyPE
463 view is translated into a Peano model. As the Peano project is not kept
464 around as an attribute, calling generate_Peano4_project() again after you
465 have altered the ExaHyPE setup gives you an independent, fresh snapshot of
466 the Peano setup rather than an accumulation on top of a stale one.
467 """
468 peano4.api.Logger().verbosity = verbosity
469
470 peano_project = peano4.api.Project(
471 self._namespace, self._project_name, self._directory, self._subdirectory
472 )
473 peano_project.output.readme.add_package_description(self._EXAHYPE_PACKAGE_DESCRIPTION)
474
475 peano_project.output.makefile.set_dimension(self._dimensions)
476 peano_project.output.makefile.set_executable_name(self._executable_name)
477 peano_project.output.makefile.set_mode(self._build_mode)
478 peano_project.output.makefile.parse_configure_script_outcome(self._Peano_src_directory)
479
480 self.__export_constants(peano_project)
481
482 # The task graphs for the four algorithmic phases every ExaHyPE 2
483 # project goes through. They only live for the duration of this call
484 # - each solver contributes its tasks into them as it is realised.
485 # The mesh adaptation phase is optional: It remains empty if no
486 # solver has a Solver.MeshAdaptation, and the generated main never
487 # runs an empty phase.
488 setup_simulation = peano4.api.taskgraph.Graph()
489 time_step = peano4.api.taskgraph.Graph()
491 mesh_adaptation = peano4.api.taskgraph.Graph()
492
493 for solver in self._realisations:
494 solver.generate_solver_realisation(
495 self, peano_project, setup_simulation, time_step, plot, mesh_adaptation
496 )
497
498 # Each solver's construct_output() above visualises the (input)
499 # task graph it just contributed to - Setup, TimeStep, Plot and
500 # MeshAdaptation - via Graph.visualise(), which renders without
501 # blocking so all of them can appear together; this is where we
502 # actually pause and let the user look at them before moving on.
503 peano4.api.taskgraph.wait_for_visualisations()
504
505 #
506 # The steps tied to one phase. This is really a sequence of
507 # observers (aka Peano grid traversals) which the code should
508 # run through for a given phase.
509 #
510 setup_simulation_steps = self.compiler(setup_simulation, "SetupSimulation", peano_project)
511 time_step_steps = self.compiler(time_step, "TimeStep", peano_project)
512 plot_steps = self.compiler(plot, "Plot", peano_project)
513 mesh_adaptation_steps = self.compiler(mesh_adaptation, "MeshAdaptation", peano_project)
514
515 #
516 # Setup runs once, as a prequel to both time stepping and plotting;
517 # time stepping and plotting may then follow one another in either
518 # order, repeatedly (each carries a self-edge for that reason) -
519 # @see peano4.api.taskgraph.compiler.PropagateUseStatements for what
520 # these edges mean and why a repeating sequence needs a self-edge.
521 # This postprocessing runs on the compiled steps, as it counts mesh
522 # traversals, and a compiler might fuse several tasks into one.
523 #
524 # The mesh adaptation only ever runs right after a time step, and
525 # it is followed by either a time step or a plot. It never runs
526 # twice in a row, as its tasks repeat themselves until the mesh is
527 # stationary. It takes part only if any solver has contributed to
528 # it: an empty sequence without incoming edges would otherwise
529 # count as an entry sequence.
530 #
531 sequences = [setup_simulation_steps, time_step_steps, plot_steps]
532 edges = [
533 (setup_simulation_steps, time_step_steps),
534 (setup_simulation_steps, plot_steps),
535 (time_step_steps, plot_steps),
536 (plot_steps, time_step_steps),
537 (time_step_steps, time_step_steps),
538 (plot_steps, plot_steps),
539 ]
540 if mesh_adaptation_steps:
541 sequences.append(mesh_adaptation_steps)
542 edges += [
543 (time_step_steps, mesh_adaptation_steps),
544 (mesh_adaptation_steps, time_step_steps),
545 (mesh_adaptation_steps, plot_steps),
546 ]
547 propagate_use_statements(sequences, edges=edges)
548
549 # Only now do we actually know which Steps this project runs, and
550 # under which qualifier each of them uses a given submodel - the
551 # compiler above is free to fuse, drop or reorder tasks, so this
552 # cannot be derived from the pre-compilation task graphs above -
553 # @see peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag.
554 derive_load_store_compute_flag(
555 setup_simulation_steps + time_step_steps + plot_steps + mesh_adaptation_steps
556 )
557
558 # Symmetric to the wait_for_visualisations() call above, but for
559 # the *compiled* task graphs each self.compiler() call
560 # just reported (@see
561 # peano4.api.taskgraph.compiler.ReportCompiledStepSequence).
562 peano4.api.taskgraph.wait_for_visualisations()
563
564 #
565 # Add these observers to the Peano project, so a main file can
566 # trigger them.
567 #
568 for step in setup_simulation_steps + time_step_steps + plot_steps + mesh_adaptation_steps:
569 peano_project.solversteps.add_step(step)
570
571 #
572 # Create one runner object per phase. A runner object has only one
573 # big routine (run()) and this routine triggers all the observers
574 # (aka Peano grid traversals) that logically make up a simulation phase.
575 #
576 peano4.api.taskgraph.create_runner(peano_project, "SetupSimulation", setup_simulation_steps)
577 peano4.api.taskgraph.create_runner(peano_project, "TimeStep", time_step_steps)
578 peano4.api.taskgraph.create_runner(peano_project, "Plot", plot_steps)
579 peano4.api.taskgraph.create_runner(peano_project, "MeshAdaptation", mesh_adaptation_steps)
580
581 self.solver_repository_generator.construct_output(peano_project)
582
583 self.mainfile_generator.construct_output(peano_project)
584
585 return peano_project
586
587 @property
588 def periodic_BC(self):
589 """!
590 One boolean per axis (dimensions entries) telling whether the domain
591 is periodic along this axis. Read-only copy - @see
592 set_global_simulation_parameters() to change it.
593 """
594 return list(self._periodic_BC)
595
596 @property
597 def subdirectory(self):
598 return self._subdirectory
599
600 @property
602 return self._additional_includes
Base class for the code generation steps that turn an ExaHyPE 2 Project's configuration into actual g...
Definition Project.py:35
__init__(self, "Project" project)
Definition Project.py:49
construct_output(self, peano_project)
Add this generator's output to peano_project (a peano4.api.Project-compatible object,...
Definition Project.py:53
ExaHyPE 2 project.
Definition Project.py:15
set_step_report_class(self, class_name)
Set the C++ class the generated main instantiates to report on steps.
Definition Project.py:236
list _gpus
Set GPUs to be used value is a list of integers or the empty list if you want the code to use all GPU...
Definition Project.py:93
list _periodic_BC
One boolean per axis (dimensions entries) telling whether the domain is periodic along this axis.
Definition Project.py:101
set_multicore_orchestration(self, value)
Set orchestration.
Definition Project.py:193
str _Peano_src_directory
src_path: string Path (relative or absolute) to the src directory of Peano.
Definition Project.py:98
set_global_simulation_parameters(self, dimensions, offset, size, min_end_time, periodic_BC=[False, False, False], max_end_time=0.0)
!
Definition Project.py:368
__export_constants(self, peano_project)
We export ExaHyPE's constants.
Definition Project.py:303
str _log_filter_file
Set a log filter file name.
Definition Project.py:89
set_timeout(self, value)
Set timeout value has to be a number greater or equal to zero, this then sets the timeout in seconds ...
Definition Project.py:223
set_log_filter_file(self, file_name)
Set a log filter file name.
Definition Project.py:161
__init__(self, namespace, project_name, executable, directory=".", subdirectory="", abstract_overwrite=True)
Definition Project.py:67
generate_Peano4_project(self, verbosity=peano4.api.LoggerVerbosity.OFF)
Construct a Peano 4 project and return it.
Definition Project.py:452
str _load_balancer_arguments
Set load balancing scheme.
Definition Project.py:88
str _step_report_class
Set the C++ class the generated main instantiates to report on steps.
Definition Project.py:94
set_gpus(self, value)
Set GPUs to be used value is a list of integers or the empty list if you want the code to use all GPU...
Definition Project.py:250
_build_mode
src_path: string Path (relative or absolute) to the src directory of Peano.
Definition Project.py:99
add_solver(self, solver)
Add a solver, or a host of several coupled solvers.
Definition Project.py:279
set_load_balancing(self, load_balancer_name, load_balancer_arguments="")
Set load balancing scheme.
Definition Project.py:126
set_number_of_threads(self, value)
Set number of threads to use.
Definition Project.py:177
int _timeout
Set timeout value has to be a number greater or equal to zero, this then sets the timeout in seconds ...
Definition Project.py:92
set_Peano4_installation(self, src_path, mode=peano4.api.output.CompileMode.RELEASE)
src_path: string Path (relative or absolute) to the src directory of Peano.
Definition Project.py:267
str _load_balancer_name
Set load balancing scheme.
Definition Project.py:87
str _number_of_threads
Set number of threads to use.
Definition Project.py:90
str _multicore_orchestration
Set orchestration.
Definition Project.py:91
periodic_BC(self)
One boolean per axis (dimensions entries) telling whether the domain is periodic along this axis.
Definition Project.py:588
float _min_terminal_time
include <bitset>
Definition Project.py:85
Singleton logger for the Peano 4 Python API.
Definition Logger.py:37
Represents a Peano 4 project.
Definition Project.py:26
Holds a sequence of Task instances.
Definition Graph.py:9