Skip to content

Commit

Permalink
BLD: add ewah-bool-utils as a buildtime and runtime dependency
Browse files Browse the repository at this point in the history
Co-authored-by: Navaneeth Suresh <navaneeths1998@gmail.com>
  • Loading branch information
themousepotato authored and neutrinoceros committed Dec 22, 2022
1 parent 2770642 commit ecab37d
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 5,906 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ yt/utilities/lib/cyoctree.c
yt/utilities/lib/depth_first_octree.c
yt/utilities/lib/distance_queue.c
yt/utilities/lib/element_mappings.c
yt/utilities/lib/ewah_bool_wrap.cpp
yt/utilities/lib/fnv_hash.c
yt/utilities/lib/fortran_reader.c
yt/utilities/lib/freetype_writer.c
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ requires = [
# we forbid it until we can properly test against it
"Cython>=0.29.21,<3.0",
"oldest-supported-numpy",
"ewah-bool-utils>=1.0.2",
]

[tool.black]
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ project_urls =
packages = find:
install_requires =
cmyt>=1.1.2
ewah-bool-utils>=1.0.2
ipywidgets>=8.0.0
matplotlib!=3.4.2,>=3.2 # keep in sync with tests/windows_conda_requirements.txt
more-itertools>=8.4
Expand Down Expand Up @@ -100,6 +101,7 @@ mapserver =
bottle
minimal =
cmyt==1.1.2
ewah-bool-utils==1.0.2
ipywidgets==8.0.0
matplotlib==3.2
more-itertools==8.4
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
check_for_openmp,
check_for_pyembree,
create_build_ext,
get_ewah_bool_utils_path,
install_ccompiler,
)

Expand Down Expand Up @@ -41,14 +42,14 @@

cythonize_aliases = {
"LIB_DIR": "yt/utilities/lib/",
"LIB_DIR_EWAH": ["yt/utilities/lib/", "yt/utilities/lib/ewahboolarray/"],
"LIB_DIR_GEOM": ["yt/utilities/lib/", "yt/geometry/"],
"LIB_DIR_GEOM_ARTIO": [
"yt/utilities/lib/",
"yt/geometry/",
"yt/frontends/artio/artio_headers/",
],
"STD_LIBS": std_libs,
"EWAH_LIBS": std_libs + [get_ewah_bool_utils_path()],
"OMP_ARGS": omp_args,
"FIXED_INTERP": "yt/utilities/lib/fixed_interpolator.cpp",
"ARTIO_SOURCE": glob.glob("yt/frontends/artio/artio_headers/*.c"),
Expand Down
6 changes: 5 additions & 1 deletion setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from distutils.sysconfig import customize_compiler
from subprocess import PIPE, Popen
from sys import platform as _platform

import ewah_bool_utils
from pkg_resources import resource_filename
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
Expand Down Expand Up @@ -200,6 +200,9 @@ def check_CPP14_flags(possible_compile_flags):
)
return []

def get_ewah_bool_utils_path():
fullpath = resource_filename("ewah_bool_utils", "ewah_bool_wrap.pxd")
return os.path.dirname(os.path.abspath(fullpath))

def check_for_pyembree(std_libs):
embree_libs = []
Expand Down Expand Up @@ -396,6 +399,7 @@ def finalize_options(self):
import numpy

self.include_dirs.append(numpy.get_include())
self.include_dirs.append(ewah_bool_utils.get_include())

def build_extensions(self):
self.check_extensions_list(self.extensions)
Expand Down
2 changes: 1 addition & 1 deletion yt/geometry/particle_geometry_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from glob import glob

import numpy as np
from ewah_bool_utils.ewah_bool_wrap import BoolArrayCollection

from yt.data_objects.index_subobjects.particle_container import ParticleContainer
from yt.funcs import get_pbar, only_on_root
from yt.geometry.geometry_handler import Index, YTDataChunk
from yt.geometry.particle_oct_container import ParticleBitmap
from yt.utilities.lib.ewah_bool_wrap import BoolArrayCollection
from yt.utilities.lib.fnv_hash import fnv_hash
from yt.utilities.logger import ytLogger as mylog
from yt.utilities.parallel_tools.parallel_analysis_interface import parallel_objects
Expand Down
29 changes: 15 additions & 14 deletions yt/geometry/particle_oct_container.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# distutils: include_dirs = LIB_DIR_EWAH
# distutils: language = c++
# distutils: extra_compile_args = CPP14_FLAG
# distutils: libraries = STD_LIBS
# distutils: include_dirs = LIB_DIR
# distutils: libraries = EWAH_LIBS
"""
Oct container tuned for Particles
Expand All @@ -11,17 +11,16 @@ Oct container tuned for Particles
"""


from libc.math cimport ceil, log2
from libc.stdlib cimport free, malloc
from libcpp.map cimport map as cmap
from libcpp.vector cimport vector

from yt.utilities.lib.ewah_bool_array cimport (
from ewah_bool_utils.ewah_bool_array cimport (
bool_array,
ewah_bool_array,
ewah_bool_iterator,
ewah_word_type,
)
from libc.math cimport ceil, log2
from libc.stdlib cimport free, malloc
from libcpp.map cimport map as cmap
from libcpp.vector cimport vector

import numpy as np

Expand Down Expand Up @@ -56,11 +55,17 @@ from .selection_routines cimport AlwaysSelector, SelectorObject

from yt.funcs import get_pbar

from ..utilities.lib.ewah_bool_wrap cimport BoolArrayCollection
from ewah_bool_utils.ewah_bool_wrap cimport BoolArrayCollection

import os
import struct

from ewah_bool_utils.ewah_bool_wrap cimport (
BoolArrayCollectionUncompressed as BoolArrayColl,
FileBitmasks,
SparseUnorderedRefinedBitmaskSet as SparseUnorderedRefinedBitmask,
)

# If set to 1, ghost cells are added at the refined level regardless of if the
# coarse cell containing it is refined in the selector.
# If set to 0, ghost cells are only added at the refined level if the coarse
Expand All @@ -69,11 +74,7 @@ DEF RefinedExternalGhosts = 1

_bitmask_version = np.uint64(5)

from ..utilities.lib.ewah_bool_wrap cimport (
BoolArrayCollectionUncompressed as BoolArrayColl,
FileBitmasks,
SparseUnorderedRefinedBitmaskSet as SparseUnorderedRefinedBitmask,
)


ctypedef cmap[np.uint64_t, bool_array] CoarseRefinedSets

Expand Down
103 changes: 0 additions & 103 deletions yt/utilities/lib/ewah_bool_array.pxd

This file was deleted.

Loading

0 comments on commit ecab37d

Please sign in to comment.