Configuration#
Build Configuration#
SweepGen learns its configuration from the waLBerla build system
and passes it on to the pystencils code generation system.
This includes information about the target architecture (CPU, CUDA, HIP, …)
and optimization options (OpenMP, vectorization).
For all options passed this way, refer to WalberlaBuildConfig.
The configuration object controlling a running generator script
is maintained in the pystencils-sfg session context.
You can get a reference to the configuration using WalberlaBuildConfig.from_sfg
and use it to override certain configuration options,
such as the code generation target.
- class sweepgen.build_config.WalberlaBuildConfig(c_compiler_id, cxx_compiler_id, use_double_precision, optimize_for_localhost, mpi_enabled, openmp_enabled, cuda_enabled, hip_enabled, likwid_enabled, override=<factory>)#
Represents a waLBerla build system configuration.
Objects of this class represent the build settings which the waLBerla CMake system was configured with. It provides the appropriate code generator settings for pystencils via
get_pystencils_config.The following settings can be overridden for the current code generation script:
target, to generate code for a different than the default hardware target
- Parameters:
- override: ConfigOverrides#
Override code generator options that would otherwise be inferred from the build system.
- static from_sfg(sfg)#
Retrieve the build configuration object from the pystencils-sfg session context.
- Parameters:
sfg (SfgContext | SfgIComposer)
- Return type:
- get_pystencils_config()#
Get the pystencils code generator configuration from this build configuration.
- Return type:
Mock the Build System for Debugging#
When run outside of waLBerla’s build system for debugging,
SweepGen falls back to a mockup build configuration set through the
sweepgen.build_config.DEBUG class:
- class sweepgen.build_config.DEBUG#
Settings for debugging generator script outside of the waLBerla build system
- BUILD_CONFIG: WalberlaBuildConfig | None = None#
The mockup build config to be used when running outside of the build system.
- static use_cpu_default()#
Mimic a default CPU build configuration
- static use_cuda_default()#
Mimic a default build configuration with CUDA enabled
- static use_hip_default()#
Mimic a default build configuration with HIP enabled