Elemental cublas (#4889)

* Added a package for the MDAnalysis toolkit.

* Added a patch that allows Elemental to use cuBLAS internally.

* Added support for LBANN to use the new cuBLAS extension in Elemental.

* Added a proper variant for when LBANN does not want to use cuBLAS in
elemental.

* Added a package for the cnpy project and used it in the lbann package.

* Removed unnecessary comment lines.

* Removed blank lines

* Removed debug variant

* Add support for libjpeg-turbo

* Added additional variants for OpenCV features. Fixed bug when linking
in TIFF support, where libtiff used the regular JPEG library and
OpenCV used libjpeg-turbo.  Now libtiff can use libjpeg-turbo.

* Removed the variant for getting Elemental to use the cublas variant.
Updated the requirements for OpenCV to add new options.

* Fixed a flake8 error in OpenCV and added a path to find cnpy in lbann.

* Fixed line too long flake8 error.

* Added a flag to specify the datatype size in lbann and fixed a flake8 error.

* Added a debug build variant using hte new build_type

* Fixed flake8

* Fixed how the debug build is pushed to Elemental

* Fixed a bug in the Elemental package where the blas search flags were
being overridden by the blas link flags.  Changed how the sequential
initialization variant is implemented in LBANN.

* Added support via a variant to explicitly use mkl or openblas.  This
helps work around variant forwarding problems.

* Updated package files to address pull request comments.
This commit is contained in:
Brian Van Essen
2017-08-07 11:41:13 -07:00
committed by Adam J. Stewart
parent 755081968f
commit 8ca7c77008
6 changed files with 804 additions and 42 deletions

View File

@@ -39,37 +39,49 @@ class Lbann(CMakePackage):
variant('gpu', default=False, description='Builds with support for GPUs via CUDA and cuDNN')
variant('opencv', default=True, description='Builds with support for image processing routines with OpenCV')
variant('seq_init', default=False, description='Force serial initialization of weight matrices.')
variant('dtype', default=4, description='Size (bits) of floating point representation for weights')
variant('build_type', default='Release',
description='The build type to build',
values=('Debug', 'Release'))
depends_on('elemental +openmp_blas +scalapack +shared +int64')
depends_on('elemental +openmp_blas +scalapack +shared +int64 build_type=Debug',
when=('build_type=Debug'))
depends_on('cuda', when='+gpu')
depends_on('mpi')
depends_on('opencv@3.2.0', when='+opencv')
depends_on('opencv@3.2.0: +openmp +core +highgui +imgproc +jpeg +png +tiff +zlib', when='+opencv')
depends_on('protobuf@3.0.2:')
depends_on('cnpy')
def cmake_args(self):
spec = self.spec
# Environment variables
CPPFLAGS = []
CPPFLAGS.append('-DLBANN_SET_EL_RNG')
if '~seq_init' in spec:
CPPFLAGS.append('-DLBANN_PARALLEL_RANDOM_MATRICES')
CPPFLAGS.append('-DLBANN_DATATYPE={0}'.format(
int(spec.variants['dtype'].value)))
args = [
'-DCMAKE_INSTALL_MESSAGE=LAZY',
'-DCMAKE_CXX_FLAGS=%s' % ' '.join(CPPFLAGS),
'-DWITH_CUDA:BOOL=%s' % ('+gpu' in spec),
'-DWITH_CUDNN:BOOL=%s' % ('+gpu' in spec),
'-DELEMENTAL_USE_CUBLAS:BOOL=%s' % (
'+cublas' in spec['elemental']),
'-DWITH_TBINF=OFF',
'-DWITH_VTUNE=OFF',
'-DElemental_DIR={0}'.format(self.spec['elemental'].prefix),
'-DElemental_DIR={0}'.format(spec['elemental'].prefix),
'-DCNPY_DIR={0}'.format(spec['cnpy'].prefix),
'-DELEMENTAL_MATH_LIBS={0}'.format(
self.spec['elemental'].libs),
spec['elemental'].libs),
'-DSEQ_INIT:BOOL=%s' % ('+seq_init' in spec),
'-DVERBOSE=0',
'-DLBANN_HOME=.',
'-DLBANN_VER=spack']
if '+opencv' in self.spec:
if '+opencv' in spec:
args.extend(['-DOpenCV_DIR:STRING={0}'.format(
self.spec['opencv'].prefix)])
spec['opencv'].prefix)])
return args