Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Change default encoding for stringtochar/chartostring functions from 'utf-8' to 'utf-8'/'ascii' for dtype.kind='U'/'S'
(issue #1464).
* Fix DeprecationWarning for assigning to numpy.ndarray.shape for numpy >= 2.5.0 (issue #1468).
* Disable parallel support even if libs support it via DISABLE_PARALLEL_SUPPORT env var (issue #1389).

version 1.7.4 (tag v1.7.4rel)
================================
Expand Down
4 changes: 4 additions & 0 deletions _build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def get_netcdf4_include_dir():


def netcdf4_has_parallel_support() -> bool:
# disable parallel support even if libs support it (issue #1389)
DISABLE_PARALLEL_SUPPORT = bool(int(os.environ.get('DISABLE_PARALLEL_SUPPORT', 0)))
if DISABLE_PARALLEL_SUPPORT:
return False
netcdf4_incdir = get_netcdf4_include_dir()
if os.path.exists(ncmetapath := os.path.join(netcdf4_incdir, "netcdf_meta.h")):
with open(ncmetapath) as f:
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def extract_version(CYTHON_FNAME):
USE_NCCONFIG = bool(int(os.environ.get('USE_NCCONFIG', 0)))
# override use of setup.cfg with env var.
USE_SETUPCFG = bool(int(os.environ.get('USE_SETUPCFG', 1)))
# disable parallel support even if libs support it (issue #1389)
DISABLE_PARALLEL_SUPPORT = bool(int(os.environ.get('DISABLE_PARALLEL_SUPPORT', 0)))

setup_cfg = 'setup.cfg'
# contents of setup.cfg will override env vars, unless
Expand Down Expand Up @@ -412,9 +414,13 @@ def _populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs):
(netcdf_lib_version > "4.4" and netcdf_lib_version < "4.5"):
has_cdf5_format = True

has_parallel_support = check_has_parallel_support(inc_dirs)
has_has_not = "has" if has_parallel_support else "does not have"
print(f"netcdf lib {has_has_not} parallel functions")
if DISABLE_PARALLEL_SUPPORT:
has_parallel_support = False
print("parallel support disabled via DISABLE_PARALLEL_SUPPORT env var")
else:
has_parallel_support = check_has_parallel_support(inc_dirs)
has_has_not = "has" if has_parallel_support else "does not have"
print(f"netcdf lib {has_has_not} parallel functions")

if has_parallel_support:
# note(stubbiali): mpi4py is not available when using the in-tree build backend
Expand Down