Peano
Loading...
Searching...
No Matches
performance_testbed.py
Go to the documentation of this file.
1import os
2import argparse
3import dastgen2
4import shutil
5import numpy as np
6
7import peano4
8import exahype2
11
12
13from Probe_file_gene import tracer_seeds_generate
14from ComputeFirstDerivatives import ComputeFirstDerivativesFD4RK
15
16modes = {
17 "release": peano4.output.CompileMode.Release,
18 "trace": peano4.output.CompileMode.Trace,
19 "assert": peano4.output.CompileMode.Asserts,
20 "stats": peano4.output.CompileMode.Stats,
21 "debug": peano4.output.CompileMode.Debug,
22}
23
24floatparams = {
25 "GLMc0": 1.5,
26 "GLMc": 1.2,
27 "GLMd": 2.0,
28 "GLMepsA": 1.0,
29 "GLMepsP": 1.0,
30 "GLMepsD": 1.0,
31 "itau": 1.0,
32 "k1": 0.1,
33 "k2": 0.0,
34 "k3": 0.5,
35 "eta": 1.0,
36 "f": 0.75,
37 "g": 0.0,
38 "xi": 1.0,
39 "e": 1.0,
40 "c": 1.0,
41 "mu": 0.2,
42 "ds": 1.0,
43 "sk": 1.0,
44 "bs": 1.0,
45 "domain_r": 1.5,
46 "smoothing": 0.0,
47 "KOSigma": 8.0 # , \
48 # "itau":1.0, "k1":0.1, "k2":0.0, "k3":0.5, "eta":1.0,
49 # "f":1.0, "g":0.0, "xi":1.0, "e":1.0, "c":1.0, "mu":0.2, "ds":1.0,
50 # "sk":1.0, "bs":1.0#, \
51 # "par_b":666.0, "center_offset_x":-1.0, "center_offset_y":0.0, "center_offset_z":0.0, \
52 # "target_m_plus":1.0, "par_p_plus_x":0.0, "par_p_plus_y":0.0, "par_p_plus_z":0.0, \
53 # "par_s_plus_x":0.0, "par_s_plus_y":0.0, "par_s_plus_z":0.0, \
54 # "target_m_minus":1.0, "par_p_minus_x":0.0, "par_p_minus_y":0.0, "par_p_minus_z":0.0, \
55 # "par_s_minus_x":0.0, "par_s_minus_y":0.0, "par_s_minus_z":0.0, \
56 # "tp_epsilon":1e-6
57}
58
59intparams = {
60 "BBHType": 2,
61 "LapseType": 1,
62 "tp_grid_setup": 0,
63 "swi": 99,
64 "ReSwi": 1,
65 "SO": 0,
66}
67# sss
68if __name__ == "__main__":
69 parser = argparse.ArgumentParser(description="ExaHyPE 2 - CCZ4 script")
70 parser.add_argument(
71 "-maxh",
72 "--max-h",
73 dest="max_h",
74 type=float,
75 default=0.05,
76 help="upper limit for refinement. Refers to volume size, i.e. not to patch size",
77 )
78 parser.add_argument(
79 "-minh",
80 "--min-h",
81 dest="min_h",
82 type=float,
83 default=0.02,
84 help="lower limit for refinement (set to 0 to make it equal to max_h - default). Refers to volume size, i.e. not to patch size",
85 )
86 parser.add_argument(
87 "-ps",
88 "--patch-size",
89 dest="patch_size",
90 type=int,
91 default=9,
92 help="Patch size, i.e. number of volumes per patch per direction",
93 )
94 parser.add_argument(
95 "-plt",
96 "--plot-step-size",
97 dest="plot_step_size",
98 type=float,
99 default=0,
100 help="Plot step size (0 to switch it off)",
101 )
102 parser.add_argument(
103 "-m", "--mode", dest="mode", default="release", help="|".join(modes.keys())
104 )
105 parser.add_argument(
106 "--gpu",
107 dest="GPU",
108 default=False,
109 action="store_true",
110 help="Run with accelerator support",
111 )
112 parser.add_argument(
113 "-impl",
114 "--implementation",
115 dest="implementation",
116 default="fd4-rk1-adaptive",
117 choices=["fd4-rk1-adaptive", "fd4-rk1-adaptive-enclave"],
118 help="Pick solver type",
119 )
120 parser.add_argument(
121 "-no-pbc",
122 "--no-periodic-boundary-conditions",
123 dest="periodic_bc",
124 action="store_false",
125 default=True,
126 help="switch on or off the periodic BC",
127 )
128 parser.add_argument(
129 "-sommerfeld",
130 "--sommerfeld-boundary-conditions",
131 dest="sommerfeld_bc",
132 action="store_true",
133 default=False,
134 help="switch on or off the Sommerfeld radiative BC",
135 )
136 parser.add_argument(
137 "-AMRMarker",
138 "--AMR-marker",
139 dest="marker",
140 choices=["none", "poisson"],
141 default="none",
142 help="switch on or off the AMR boundary marker",
143 )
144 parser.add_argument(
145 "-et",
146 "--end-time",
147 dest="end_time",
148 type=float,
149 default=0.01,
150 help="End (terminal) time",
151 )
152 parser.add_argument(
153 "-pst",
154 "--plot-start-time",
155 dest="plot_start_time",
156 type=float,
157 default=0.0,
158 help="start time for plot",
159 )
160 parser.add_argument(
161 "-s",
162 "--scenario",
163 dest="scenario",
164 default="single-puncture",
165 choices=[
166 "gauge",
167 "dia_gauge",
168 "linear",
169 "single-puncture",
170 "two-punctures",
171 "flat",
172 ],
173 help="Scenario",
174 )
175 parser.add_argument(
176 "-cfl", "--CFL-ratio", dest="cfl", type=float, default=0.1, help="Set CFL ratio"
177 )
178 parser.add_argument(
179 "-tracer",
180 "--add-tracer",
181 dest="add_tracer",
182 type=int,
183 default=0,
184 help="Add tracers and specify the seeds. 0-switch off, 1-static point tracer, 2-moving point tracer",
185 )
186 parser.add_argument(
187 "-tn",
188 "--tracer-name",
189 dest="tra_name",
190 type=str,
191 default="de",
192 help="name of output tracer file (temporary)",
193 )
194 parser.add_argument(
195 "-exn",
196 "--exe-name",
197 dest="exe_name",
198 type=str,
199 default="test",
200 help="name of output executable file",
201 )
202 parser.add_argument(
203 "-outdir",
204 "--output-directory",
205 dest="path",
206 type=str,
207 default="./",
208 help="specify the output directory, include the patch file and tracer file",
209 )
210 parser.add_argument(
211 "-interp",
212 "--interpolation",
213 dest="interpolation",
214 choices=[
215 "constant",
216 "order-2",
217 "linear-constant-extrap",
218 "linear-linear-extrap",
219 "linear-con-extrap-lin-normal-interp",
220 "linear-lin-extrap-lin-normal-interp",
221 "matrix",
222 "second_order",
223 "third_order",
224 ],
225 default="linear-lin-extrap-lin-normal-interp",
226 help="interpolation scheme for AMR",
227 )
228 parser.add_argument(
229 "-restrict",
230 "--restriction",
231 dest="restriction",
232 choices=["average", "inject", "matrix", "second_order"],
233 default="average",
234 help="restriction scheme for AMR",
235 )
236 parser.add_argument(
237 "-so",
238 "--second-order",
239 dest="SO_flag",
240 default=True,
241 action="store_true",
242 help="enable double communication per timestep, used in the soccz4 formulation.",
243 )
244
245 for k, v in floatparams.items():
246 parser.add_argument(
247 "--{}".format(k),
248 dest="CCZ4{}".format(k),
249 type=float,
250 default=v,
251 help="default: %(default)s",
252 )
253 for k, v in intparams.items():
254 if k == "ReSwi":
255 parser.add_argument(
256 "--{}".format(k),
257 dest="CCZ4{}".format(k),
258 type=int,
259 default=v,
260 help="default: %(default)s, choose refinement criterion, 0-no refinement, 1-radius based, 2-SBH phi gradient based, 3-BBH phi gradient based. Notice: 2 and 3 only work with -ext Full",
261 )
262 else:
263 parser.add_argument(
264 "--{}".format(k),
265 dest="CCZ4{}".format(k),
266 type=int,
267 default=v,
268 help="default: %(default)s",
269 )
270
271 args = parser.parse_args()
272
273 SuperClass = None
274
275 print(args.implementation)
276 if (
277 args.implementation == "fd4-rk1-adaptive"
278 or args.implementation == "fd4-rk4-adaptive"
279 ):
281 if args.implementation == "fd4-rk1-adaptive-enclave":
283 args.SO_flag = False
284 if args.implementation == "fd4-rk1-fixed" or args.implementation == "fd4-rk4-fixed":
286
287 class CCZ4Solver(SuperClass):
289 self, name, patch_size, min_volume_h, max_volume_h, cfl, domain_r, KOSig
290 ):
291 unknowns = {
292 "G": 6, # 0-5
293 "K": 6, # 6-11
294 "theta": 1, # 12
295 "Z": 3, # 13-15
296 "lapse": 1, # 16
297 "shift": 3, # 17-19
298 "b": 3, # 20-22
299 "dLapse": 3, # 23-25
300 "dxShift": 3, # 26-28
301 "dyShift": 3, # 29-31
302 "dzShift": 3, # 32-34
303 "dxG": 6, # 35-40
304 "dyG": 6, # 41-46
305 "dzG": 6, # 47-52
306 "traceK": 1, # 53
307 "phi": 1, # 54
308 "P": 3, # 55-57
309 "K0": 1, # 58
310 }
311
312 number_of_unknowns = sum(unknowns.values())
313
315#include "../CCZ4Kernels.h"
316"""
318 if (
319 args.implementation == "fd4-rk1-adaptive"
320 or args.implementation == "fd4-rk1-adaptive-enclave"
321 ):
322 rk_order = 1
323 else:
324 rk_order = 4
325 SuperClass.__init__(
326 self,
327 name=name,
328 patch_size=patch_size,
329 rk_order=rk_order,
330 unknowns=number_of_unknowns,
331 auxiliary_variables=0,
332 min_meshcell_h=min_volume_h,
333 max_meshcell_h=max_volume_h,
334 time_step_relaxation=cfl,
335 KOSigma=KOSig,
336 reconstruction_with_rk=args.SO_flag,
337 )
338 elif (
339 SuperClass
341 ):
342 if (
343 args.implementation == "fd4-rk1-adaptive"
344 or args.implementation == "fd4-rk1-adaptive-enclave"
345 ):
346 rk_order = 1
347 else:
348 rk_order = 4
349 SuperClass.__init__(
350 self,
351 name=name,
352 patch_size=patch_size,
353 rk_order=rk_order,
354 unknowns=number_of_unknowns,
355 auxiliary_variables=0,
356 min_meshcell_h=min_volume_h,
357 max_meshcell_h=max_volume_h,
358 time_step_relaxation=cfl,
359 KOSigma=KOSig,
360 pde_terms_without_state=True,
361 )
362 elif (
364 or SuperClass
365 == exahype2.solvers.rkfd.fd4.GlobalFixedTimeStepWithEnclaveTasking
366 ):
367 if args.implementation == "fd4-rk1-fixed":
368 rk_order = 1
369 else:
370 rk_order = 4
371 SuperClass.__init__(
372 self,
373 name=name,
374 patch_size=patch_size,
375 rk_order=rk_order,
376 unknowns=number_of_unknowns,
377 auxiliary_variables=0,
378 min_meshcell_h=min_volume_h,
379 max_meshcell_h=max_volume_h,
380 normalised_time_step_size=0.01,
381 KOSigma=KOSig,
382 )
383 else:
384 SuperClass.__init__(
385 self,
386 name=name,
387 patch_size=patch_size,
388 unknowns=number_of_unknowns,
389 auxiliary_variables=0,
390 min_volume_h=min_volume_h,
391 max_volume_h=max_volume_h,
392 time_step_relaxation=cfl
393 # use_gpu =args.GPU #=="fv-fixed-gpu" else False
394 # use_gpu = True if args.implementation=="fv-adaptive-gpu" else False
395 )
396
397 self._patch_size = patch_size
398 self._domain_r = domain_r
399
400 self.set_implementation(
401 boundary_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
402 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
403 flux=exahype2.solvers.PDETerms.None_Implementation,
404 source_term=exahype2.solvers.PDETerms.User_Defined_Implementation,
405 refinement_criterion=exahype2.solvers.PDETerms.User_Defined_Implementation,
406 eigenvalues=exahype2.solvers.PDETerms.User_Defined_Implementation,
407 )
408
409 if (
410 SuperClass
412 ):
417 compute_max_eigenvalue_of_next_time_step=True,
418 solver_variant=exahype2.solvers.rkfd.kernels.SolverVariant.Multicore,
419 kernel_variant=exahype2.solvers.rkfd.kernels.KernelVariant.BatchedAoSHeap,
420 KOSigma=self._KO_Sigma,
421 )
422
424{
425"""
426
427 if (
430 or SuperClass
432 # or SuperClass==exahype2.solvers.rkfd.fd4.GlobalFixedTimeStepWithEnclaveTasking no fixed enclave version yet
433 ):
434 self.postprocess_updated_patch += """
435 #if Dimensions==2
436 constexpr int itmax = {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}} * {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}};
437 #endif
438
439 #if Dimensions==3
440 constexpr int itmax = {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}} * {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}} * {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}};
441 #endif
442"""
443 # elif SuperClass == exahype2.solvers.rkdg.rusanov.GlobalAdaptiveTimeStep: fix it after rkdg is back
444 # self.postprocess_updated_patch = """
445 # constexpr int itmax = ({{ORDER}}+1) * ({{ORDER}}+1) * ({{ORDER}}+1); // only support 3d
446 # """
447 else:
448 self.postprocess_updated_patch += """
449 #if Dimensions==2
450 constexpr int itmax = {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}};
451 #endif
452
453 #if Dimensions==3
454 constexpr int itmax = {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}};
455 #endif
456"""
457
458 self.postprocess_updated_patch += """
459 int index = 0;
460 for (int i=0;i<itmax;i++)
461 {
462 applications::exahype2::ccz4::enforceCCZ4constraints( newQ+index );
463 index += {{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}};
464 }
465 }
466"""
467
469 SuperClass.create_action_sets(self)
470 self._action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement.additional_includes += """
471#include "../CCZ4Kernels.h"
472 """
473
475 """
476 We take this routine to add a few additional include statements.
477 """
478 return (
479 SuperClass.get_user_action_set_includes(self) + self._my_user_includes
480 )
481
482
485 userinfo = []
486 exe = "peano4"
487
488 if args.exe_name != "":
489 exe += "_"
490 exe += args.exe_name
491 if not args.tra_name == "de":
492 exe += "_" + args.tra_name
494 ["benchmarks", "exahype2", "ccz4"], "ccz4", executable=exe
495 )
496
497
500 is_aderdg = False
501 is_rkdg = False
502 solver_name = "CCZ4"
503 try:
504 if (
505 SuperClass
506 == exahype2.solvers.aderdg.NonFusedGenericRusanovFixedTimeStepSize
507 ):
508 is_aderdg = True
509 order = 3
510 unknowns = 59
511 time_step_size = 0.001
512 except Exception as e:
513 pass
514 # msg = "Warning: ADER-DG no supported on this machine"
515 # print(msg)
516 # userinfo.append((msg,e))
517
518 try:
520 is_rkdg = True
521 except Exception as e:
522 pass
523 msg = "Warning: RKDG not supported on this machine"
524 print(msg)
525 userinfo.append((msg, e))
526
527 if is_aderdg:
528 solver_name = "ADERDG" + solver_name
529 elif is_rkdg:
530 solver_name = "RKDG" + solver_name
531 else:
532 solver_name = solver_name
533
534 # if args.SO_flag==True:
535 # args.cfl=args.cfl/2
536
537 min_h = args.min_h
538 if min_h <= 0.0:
539 print("No minimal mesh size chosen. Set it to max mesh size (regular grid)")
540 min_h = args.max_h
541
542 if is_aderdg:
543 my_solver = exahype2.solvers.aderdg.NonFusedGenericRusanovFixedTimeStepSize(
544 solver_name,
545 order,
546 unknowns,
547 0, # auxiliary_variables
548 exahype2.solvers.aderdg.Polynomials.Gauss_Legendre,
549 min_h,
550 args.max_h,
551 time_step_size,
552 flux=None,
553 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
554 sources=exahype2.solvers.PDETerms.User_Defined_Implementation,
555 )
556 else:
557 my_solver = CCZ4Solver(
558 solver_name,
559 args.patch_size,
560 min_h,
561 args.max_h,
562 args.cfl,
563 args.CCZ4domain_r,
564 args.CCZ4KOSigma,
565 )
566 userinfo.append(("CFL ratio set as " + str(args.cfl), None))
567
568 userinfo.append(("The solver is " + args.implementation, None))
569
570
573
574 if args.interpolation == "order-2":
575 my_solver.overlap = 2
576
577 if args.interpolation == "constant":
578 my_solver.interpolation = "piecewise_constant"
579 print("Interpolation rule: piecewise_constant")
580 if args.interpolation == "linear-constant-extrap":
581 my_solver.interpolation = "linear_with_constant_extrapolation"
582 print("Interpolation rule: linear constant extrapolation")
583 if args.interpolation == "linear-linear-extrap":
584 my_solver.interpolation = "linear_with_linear_extrapolation"
585 print("Interpolation rule: linear extrapolation")
586 if args.interpolation == "linear-con-extrap-lin-normal-interp":
587 my_solver.interpolation = (
588 "linear_with_constant_extrapolation_and_linear_normal_interpolation"
589 )
590 print(
591 "Interpolation rule: linear+constant extrapolation and linear normal interpolation"
592 )
593
594 if args.interpolation == "order-2":
595 my_solver.interpolation = "linear"
596
597 tem_interp = ["TP_constant", "TP_linear_with_linear_extrap_normal_interp"]
598 tem_restrict = ["TP_inject_normal_extrap", "TP_average_normal_extrap"]
599 if "fd4-rk" in args.implementation:
600 if args.interpolation == "matrix":
601 exahype2.solvers.rkfd.fd4.switch_to_FD4_matrix_interpolation(my_solver)
602 elif args.interpolation == "second_order":
603 exahype2.solvers.rkfd.fd4.switch_to_FD4_second_order_interpolation(
604 my_solver
605 )
606 elif args.interpolation == "third_order":
607 exahype2.solvers.rkfd.fd4.switch_to_FD4_third_order_interpolation(my_solver)
608 else:
609 exahype2.solvers.rkfd.fd4.switch_to_FD4_tensor_product_interpolation(
610 my_solver, tem_interp[1]
611 )
612 userinfo.append(("FD4 Interpolation: " + tem_interp[1], None))
613
614 if args.restriction == "matrix":
615 exahype2.solvers.rkfd.fd4.switch_to_FD4_matrix_restriction(my_solver)
616 elif args.restriction == "second_order":
617 exahype2.solvers.rkfd.fd4.switch_to_FD4_second_order_restriction(my_solver)
618 # elif args.restriction == "third_order":
619 # exahype2.solvers.rkfd.fd4.switch_to_FD4_third_order_restriction( my_solver )
620 else:
621 exahype2.solvers.rkfd.fd4.switch_to_FD4_tensor_product_restriction(
622 my_solver, tem_restrict[1]
623 )
624 userinfo.append(("FD4 Restriction: " + tem_restrict[1], None))
625
626 # userinfo.append(("FD4 Interpolation: " + tem_interp[1] + " & Restriction: " + tem_restrict[1], None))
627
628
631 for k, v in intparams.items():
632 intparams.update({k: eval("args.CCZ4{}".format(k))})
633 for k, v in floatparams.items():
634 floatparams.update({k: eval("args.CCZ4{}".format(k))})
635
636 if args.SO_flag == True:
637 intparams.update({"SO": 1})
638
639 if args.scenario == "two-punctures":
640 msg = "Periodic BC deactivated because you pick Puncture scenario\nInitialize binary black holes"
641 print(msg)
642 periodic_boundary_conditions = [False, False, False]
643 intparams.update(
644 {"swi": 2}
645 ) # notice it may change, see according function in CCZ4.cpp
646 print(intparams)
647 userinfo.append((msg, None))
648 elif args.scenario == "single-puncture":
649 msg = "Periodic BC deactivated because you pick Puncture scenario\nInitialize single black hole"
650 print(msg)
651 periodic_boundary_conditions = [False, False, False]
652 intparams.update({"swi": 0})
653 userinfo.append((msg, None))
654 elif args.periodic_bc == True:
655 msg = "Periodic BC set"
656 print(msg)
657 periodic_boundary_conditions = [True, True, True] # Periodic BC
658 userinfo.append((msg, None))
659 else:
660 msg = "WARNING: Periodic BC deactivated by hand"
661 print(msg)
662 periodic_boundary_conditions = [False, False, False]
663 userinfo.append((msg, None))
664
665 solverconstants = ""
666
667 if args.scenario == "gauge":
668 solverconstants += "static constexpr int Scenario=0; /* Gauge wave */ \n "
669 userinfo.append(("picking gauge wave scenario", None))
670 floatparams.update({"sk": 0.0})
671 floatparams.update({"bs": 0.0})
672 intparams.update({"LapseType": 0})
673 elif (args.scenario == "two-punctures") or (args.scenario == "single-puncture"):
674 solverconstants += "static constexpr int Scenario=2; /* Two-puncture */ \n"
675 userinfo.append(("picking black hole scenario", None))
676 else:
677 raise Exception("Scenario " + args.scenario + " is now unknown")
678
679 for k, v in floatparams.items():
680 solverconstants += "static constexpr double {} = {};\n".format(
681 "CCZ4{}".format(k), v
682 )
683 for k, v in intparams.items():
684 solverconstants += "static constexpr int {} = {};\n".format(
685 "CCZ4{}".format(k), v
686 )
687 my_solver.add_solver_constants(solverconstants)
688
689 project.add_solver(my_solver)
690
691 build_mode = modes[args.mode]
692
693 dimensions = 3
694
695
698 floatparams.update({"domain_r": args.CCZ4domain_r})
699 dr = floatparams["domain_r"]
700 offset = [-dr, -dr, -dr]
701 domain_size = [2 * dr, 2 * dr, 2 * dr]
702 msg = "domain set as " + str(offset) + " and " + str(domain_size)
703 print(msg)
704 userinfo.append((msg, None))
705
706 project.set_global_simulation_parameters(
707 dimensions, # dimensions
708 offset,
709 domain_size,
710 args.end_time, # end time
711 args.plot_start_time,
712 args.plot_step_size, # snapshots
713 periodic_boundary_conditions,
714 8, # plotter precision
715 )
716 userinfo.append(
717 (
718 "plot start time: "
719 + str(args.plot_start_time)
720 + ", plot step size: "
721 + str(args.plot_step_size),
722 None,
723 )
724 )
725 userinfo.append(("Terminal time: " + str(args.end_time), None))
726
727 project.set_Peano4_installation("../../../..", build_mode)
728
729
732 path = "./"
733 if not args.path == "./":
734 path = args.path
735 # path="/cosma5/data/durham/dc-zhan3/bbh-c5-1"
736 # path="/cosma6/data/dp004/dc-zhan3/exahype2/sbh-fv3"
737 project.set_output_path(path)
738 probe_point = [-12, -12, 0.0]
739 project.add_plot_filter(probe_point, [24.0, 24.0, 0.01], 1)
740
741 # project.set_load_balancing("toolbox::loadbalancing::strategies::RecursiveBipartition","(new ::exahype2::LoadBalancingConfiguration(0.95))" )
742 # project.set_load_balancing("toolbox::loadbalancing::strategies::SplitOversizedTree","(new ::exahype2::LoadBalancingConfiguration(0.95,500,16))" )
743 # project.set_load_balancing("toolbox::loadbalancing::strategies::SpreadOut","(new ::exahype2::LoadBalancingConfiguration(0.95))" )
744 project.set_load_balancing(
745 "toolbox::loadbalancing::strategies::SpreadOutHierarchically",
746 "(new ::exahype2::LoadBalancingConfiguration(0.95,1000,16))",
747 )
748 # project.set_load_balancing("toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates","(new ::exahype2::LoadBalancingConfiguration(0.98,1000,16))" )
749 # project.set_load_balancing("toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates","(new ::exahype2::LoadBalancingConfiguration(0.95))" )
750 # project.set_load_balancing("toolbox::loadbalancing::strategies::cascade::SpreadOut_RecursiveBipartition","(new ::exahype2::LoadBalancingConfiguration(0.95))" )
751 # project.set_load_balancing("toolbox::loadbalancing::strategies::cascade::SpreadOutOnceGridStagnates_SplitOversizedTree","(new ::exahype2::LoadBalancingConfiguration(0.95))" )
752 # project.set_load_balancing("toolbox::loadbalancing::strategies::cascade::SpreadOut_SplitOversizedTree",
753 # "new ::exahype2::LoadBalancingConfiguration(0.98, 1, 8,::exahype2::LoadBalancingConfiguration::UseNumberOfThreads), new toolbox::loadbalancing::metrics::CellCount()",)
754
755
758 peano4_project = project.generate_Peano4_project(verbose=True)
759 peano4_project.output.makefile.add_header_search_path(
760 "../../../../applications/exahype2/ccz4/"
761 )
762
763 if (
764 args.scenario == "gauge"
765 or args.scenario == "linear"
766 or args.scenario == "dia_gauge"
767 or args.scenario == "flat"
768 ):
769 pass
770 elif args.scenario == "two-punctures" or args.scenario == "single-puncture":
771 peano4_project.output.makefile.add_linker_flag("-lm -lgsl -lgslcblas")
772 peano4_project.output.makefile.add_cpp_file(
773 "../../../../applications/exahype2/ccz4/libtwopunctures/TP_Utilities.cpp"
774 )
775 peano4_project.output.makefile.add_cpp_file(
776 "../../../../applications/exahype2/ccz4/libtwopunctures/TP_Parameters.cpp"
777 )
778 peano4_project.output.makefile.add_cpp_file(
779 "../../../../applications/exahype2/ccz4/libtwopunctures/TP_Logging.cpp"
780 )
781 peano4_project.output.makefile.add_cpp_file(
782 "../../../../applications/exahype2/ccz4/libtwopunctures/TwoPunctures.cpp"
783 )
784 peano4_project.output.makefile.add_cpp_file(
785 "../../../../applications/exahype2/ccz4/libtwopunctures/CoordTransf.cpp"
786 )
787 peano4_project.output.makefile.add_cpp_file(
788 "../../../../applications/exahype2/ccz4/libtwopunctures/Equations.cpp"
789 )
790 peano4_project.output.makefile.add_cpp_file(
791 "../../../../applications/exahype2/ccz4/libtwopunctures/FuncAndJacobian.cpp"
792 )
793 peano4_project.output.makefile.add_cpp_file(
794 "../../../../applications/exahype2/ccz4/libtwopunctures/Newton.cpp"
795 )
796 peano4_project.output.makefile.add_CXX_flag("-DIncludeTwoPunctures")
797 else:
798 raise Exception("Scenario " + args.scenario + " is now unknown")
799
800 peano4_project.output.makefile.add_CXX_flag("-DCCZ4EINSTEIN")
801
802 peano4_project.output.makefile.add_cpp_file(
803 "../../../../applications/exahype2/ccz4/InitialValues.cpp"
804 )
805 peano4_project.output.makefile.add_cpp_file(
806 "../../../../applications/exahype2/ccz4/CCZ4Kernels.cpp"
807 )
808
809 peano4_project.generate(throw_away_data_after_generation=False)
810 peano4_project.build(make_clean_first=True)
811
812 # Report the application information
813 userinfo.append(("the executable file name: " + exe, None))
814 userinfo.append(("output directory: " + path, None))
815 print("=========================================================")
816 if not args.add_tracer == 0:
817 userinfo.append(("tracer output file: " + args.path + "Tracer-test", None))
818 if len(userinfo) > 0:
819 print("The building information:")
820 for msg, exception in userinfo:
821 if exception is None:
822 print(msg)
823 else:
824 print(msg, "Exception: {}".format(exception))
825 print(intparams)
826 print(floatparams)
827 print("=========================================================")
ExaHyPE 2 project.
Definition Project.py:14
RKDG solver with Rusanov Riemann solver employing global adaptive time stepping.
This class assumes that you have an 2MxNxN patch on your faces.
Definition DynamicAMR.py:9
__init__(self, name, patch_size, min_volume_h, max_volume_h, cfl, domain_r, KOSig)
get_user_action_set_includes(self)
We take this routine to add a few additional include statements.
create_compute_kernel_for_FD4(flux_implementation, ncp_implementation, source_implementation, compute_max_eigenvalue_of_next_time_step, solver_variant, kernel_variant, KOSigma)
I return only the unqualified function call, i.e.
Definition kernels.py:20