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

fix --sanity-check-only and --module-only for UCX plugins #3007

Merged
Merged
Changes from 4 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
39 changes: 26 additions & 13 deletions easybuild/easyblocks/u/ucx_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
@author: Mikael Öhman (Chalmers University of Techonology)
"""
from collections import defaultdict
from itertools import chain
import os

from easybuild.easyblocks.generic.configuremake import ConfigureMake
Expand All @@ -43,16 +44,37 @@ class EB_UCX_Plugins(ConfigureMake):
"""Support for building additional plugins for a existing UCX module"""

def __init__(self, *args, **kwargs):
"""Custom initialization for UCX: set correct module name."""
"""Custom initialization for UCX-Plugins."""
super(EB_UCX_Plugins, self).__init__(*args, **kwargs)
self.plugins = {}
self._plugins = None
self.makefile_dirs = []

@property
def plugins(self):
boegel marked this conversation as resolved.
Show resolved Hide resolved
"""Property to determine list of plugins based on loaded dependencies, or return cached list of plugins."""
if self._plugins is None:
plugins = defaultdict(list)
dep_names = set(dep['name'] for dep in self.cfg.dependencies())
boegel marked this conversation as resolved.
Show resolved Hide resolved

if 'CUDAcore' in dep_names or 'CUDA' in dep_names:
for key in ('ucm', 'uct', 'ucx_perftest'):
plugins[key].append('cuda')

if 'GDRCopy' in dep_names:
plugins['uct_cuda'].append('gdrcopy')

if 'ROCm' in dep_names:
for key in ('ucm', 'uct', 'ucx_perftest'):
plugins[key].append('rocm')

self._plugins = dict(plugins)
self.log.info("Creating plugins for %s", ", ".join(sorted(set(chain(*plugins.values())))))
return self._plugins

def configure_step(self):
"""Customize configuration for building requested plugins."""
# make sure that required dependencies are loaded
ucxroot = get_software_root('UCX')
if not ucxroot:
if not get_software_root('UCX'):
raise EasyBuildError("UCX is a required dependency")

self.cfg['configure_cmd'] = 'contrib/configure-release'
Expand All @@ -62,30 +84,21 @@ def configure_step(self):
# omit the lib subdirectory since we are just installing plugins
configopts += '--libdir=%(installdir)s '

plugins = defaultdict(list)
cudaroot = get_software_root('CUDAcore') or get_software_root('CUDA')
if cudaroot:
configopts += '--with-cuda=%s ' % cudaroot
for key in ('ucm', 'uct', 'ucx_perftest'):
plugins[key].append('cuda')

gdrcopyroot = get_software_root('GDRCopy')
if gdrcopyroot:
plugins['uct_cuda'].append('gdrcopy')
configopts += '--with-gdrcopy=%s ' % gdrcopyroot

self.makefile_dirs.extend(os.path.join(x, 'cuda') for x in ('uct', 'ucm', 'tools/perf'))

# To be supported in the future:
rocmroot = get_software_root('ROCm')
if rocmroot:
for key in ('ucm', 'uct', 'ucx_perftest'):
plugins[key].append('rocm')
configopts += '--with-rocm=%s ' % rocmroot
self.makefile_dirs.extend(os.path.join(x, 'rocm') for x in ('uct', 'ucm', 'tools/perf'))

self.plugins = dict(plugins)

self.cfg.update('configopts', configopts)

super(EB_UCX_Plugins, self).configure_step()
Expand Down
Loading