Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gloo python bindings #585

Merged
merged 17 commits into from
May 20, 2022
12 changes: 7 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ def build_python():
elif os.name == 'nt':
env["ARROW_PREFIX"] = str(Path(os.environ["CONDA_PREFIX"], "Library"))

env['CYLON_GLOO'] = str(CYLON_GLOO)
env['GLOO_PREFIX'] = GLOO_PREFIX
env['CYLON_UCX'] = str(CYLON_UCX)
env['CYLON_UCC'] = str(CYLON_UCC)
env['UCC_PREFIX'] = UCC_PREFIX
if CYLON_GLOO:
env['CYLON_GLOO'] = str(CYLON_GLOO)
env['GLOO_PREFIX'] = GLOO_PREFIX
if CYLON_UCC and CYLON_UCX:
env['CYLON_UCX'] = str(CYLON_UCX)
env['CYLON_UCC'] = str(CYLON_UCC)
env['UCC_PREFIX'] = UCC_PREFIX

logger.info("Arrow prefix: " + str(Path(os.environ["CONDA_PREFIX"])))
res = subprocess.run(python_build_command, shell=True, env=env, cwd=PYTHON_SOURCE_DIR)
Expand Down
45 changes: 36 additions & 9 deletions python/pycylon/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,34 @@

compiler_directives = {"language_level": 3, "embedsignature": True}

cython_files = ["pycylon/*/*.pyx"]
print("CYTHON: " + str(cython_files))
cython_files = ['pycylon/net/channel.pyx',
'pycylon/net/comm_type.pyx',
'pycylon/net/communicator.pyx',
'pycylon/net/comm_config.pyx',
'pycylon/net/mpi_config.pyx',
'pycylon/net/txrequest.pyx',
'pycylon/net/comm_ops.pyx',
'pycylon/_libs/index.pyx',
'pycylon/data/scalar.pyx',
'pycylon/data/groupby.pyx',
'pycylon/data/arrow_util.pyx',
'pycylon/data/aggregates.pyx',
'pycylon/data/column.pyx',
'pycylon/data/csv.pyx',
'pycylon/data/compute.pyx',
'pycylon/data/table.pyx',
'pycylon/data/data_type.pyx',
'pycylon/api/lib.pyx',
'pycylon/api/types.pyx',
'pycylon/indexing/cyindex.pyx',
'pycylon/indexing/index_utils.pyx',
'pycylon/ctx/context.pyx',
'pycylon/io/csv_write_config.pyx',
'pycylon/io/csv_read_config.pyx',
'pycylon/common/status.pyx',
'pycylon/common/join_config.pyx',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay. We can modularize it later on.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pycylon/data/**, pycylon/api./** something like this, but I am not sure, what is the best way to capture the modularized ones. But the existing one is satisfactory for the moment.

'pycylon/common/code.pyx',
'pycylon/util/logging.pyx']

if not CYLON_PREFIX:
raise ValueError("CYLON_PREFIX not set")
Expand Down Expand Up @@ -135,9 +161,10 @@
mpi_include_dir = [mpi4py.get_config()['include_dirs']]
_include_dirs.extend(mpi_include_dir)


macros = []
if CYLON_GLOO:
cython_files.append('pycylon/net/gloo_config.pyx')

libraries.append('gloo')
library_directories.append(os.path.join(GLOO_PREFIX, 'lib'))
_include_dirs.append(os.path.join(GLOO_PREFIX, 'include'))
Expand All @@ -151,11 +178,11 @@
macros.append(('BUILD_CYLON_UCX', '1'))
macros.append(('BUILD_CYLON_UCC', '1'))


print('Libraries:', libraries)
print("Lib dirs:", library_directories)
print("Include dirs:", _include_dirs)
print("Macros:", macros)
print("CYTHON files : " + str(cython_files))
print('Libraries :', libraries)
print("Lib dirs :", library_directories)
print("Include dirs :", _include_dirs)
print("Macros :", macros)

# Adopted the Cudf Python Build format
# https://github.com/rapidsai/cudf
Expand All @@ -170,7 +197,7 @@
extra_link_args=extra_link_args,
libraries=libraries,
library_dirs=library_directories,
define_macros=macros
define_macros=macros,
)
]

Expand Down