Closed stubbiali closed 6 months ago
Hi @stubbiali ! Thanks for all the work - looks good! I'll try to give you extended feedback today or tomorrow. Could you maybe merge with master and resolve conflicts?
allows to customize the build process using environment variables and so allows to e.g. enable GPU support and specify the transport backend;
Is there any other/additional way to customize the build process? Environment variables are fine, but maybe command line arguments would be more ergonomic/more explicit.
A small thing that rubs me the wrong way is that the build directory is created in the source tree next to setup.py
(build_dir = os.path.abspath(os.path.join(this_dir, "build"))
) - do you think we can change this? Not sure where it should be, maybe in tmp or somewhere else (or be configurable)?
Is there any other/additional way to customize the build process? Environment variables are fine, but maybe command line arguments would be more ergonomic/more explicit.
I tend to agree that command line arguments would be more elegant. The only way I know to accomplish this would be through config settings. To be honest, I've never used this feature, but to me it doesn't look like it makes the customization of the build process either more explicit or easier to read. So I would stick to environment variables, which is a more common approach.
A small thing that rubs me the wrong way is that the build directory is created in the source tree next to
setup.py
(build_dir = os.path.abspath(os.path.join(this_dir, "build"))
) - do you think we can change this? Not sure where it should be, maybe in tmp or somewhere else (or be configurable)?
We could use a temporary folder as the build directory with build_dir = tempfile.mkdtemp()
. Configuration via env variable is also possible, e.g. the build directory could be created under GHEX_BUILD_ROOT
, rather than in the system-wide temporary directory.
closing this as it is superseded by #156
Profound restructuring and refining of the Python bindings. Since this effort is driven by the needs of the FVM model, the focus has primarily been on structured grids so far.
bindings/python/src/ghex
andbindings/python/src/_pyghex
;pyghex
toghex
, and all package-level configurations are dumped intopyproject.toml
;scikit-build-core
tosetuptools.build_meta
; this is mainly motivated by the flexibility provided by the latter, which allows to customize the build process using environment variables and so allows to e.g. enable GPU support and specify the transport backend;__hip_array_interface__
(introduced by https://github.com/GridTools/gridtools/pull/1759 and https://github.com/GridTools/gt4py/pull/1278);black
formatter to all Python source files and add annotations;The code has been tested on Mac (M2 processor), Piz Daint and LUMI.