OpenSpeedShop package: add support for building on cray (#7338)

This commit is contained in:
Jim Galarowicz
2018-03-07 16:26:07 -06:00
committed by scheibelp
parent f393a2c146
commit 7f3a72fb33
10 changed files with 233 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
@@ -23,7 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
##############################################################################
# Copyright (c) 2015-2017 Krell Institute. All Rights Reserved.
# Copyright (c) 2015-2018 Krell Institute. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -41,6 +41,10 @@
##############################################################################
from spack import *
import spack
import spack.store
import os
import os.path
@@ -63,7 +67,7 @@ class Openspeedshop(CMakePackage):
url = "https://github.com/OpenSpeedShop"
# Use when the git repository is available
version('2.3', branch='master',
version('2.3.1', branch='master',
git='https://github.com/OpenSpeedShop/openspeedshop.git')
variant('offline', default=False,
@@ -72,7 +76,9 @@ class Openspeedshop(CMakePackage):
description="build with cbtf instrumentor enabled.")
variant('runtime', default=False,
description="build only the runtime libraries and collectors.")
variant('frontend', default=False,
variant('cti', default=False,
description="Build MRNet with the CTI startup option")
variant('crayfe', default=False,
description="build only the FE tool using the runtime_dir \
to point to target build.")
variant('cuda', default=False,
@@ -117,6 +123,7 @@ class Openspeedshop(CMakePackage):
depends_on("sqlite")
depends_on("boost@1.50.0:1.59.0")
depends_on("dyninst@9.3.2")
depends_on("python")
depends_on("libxml2+python")
depends_on("qt@3.3.8b+krellpatch", when='gui=qt3')
# Actively working on adding this gui package
@@ -136,6 +143,8 @@ class Openspeedshop(CMakePackage):
# Dependencies only for the openspeedshop cbtf package.
depends_on("cbtf", when='+cbtf')
depends_on('cbtf-krell', when='+cbtf')
depends_on('cbtf-krell+crayfe', when='+crayfe')
depends_on('cbtf-krell+cti', when='+cti')
depends_on('cbtf-krell+mpich', when='+cbtf+mpich')
depends_on('cbtf-krell+mpich2', when='+cbtf+mpich2')
depends_on('cbtf-krell+mpt', when='+cbtf+mpt')
@@ -144,19 +153,45 @@ class Openspeedshop(CMakePackage):
depends_on('cbtf-krell+openmpi', when='+cbtf+openmpi')
depends_on("cbtf-argonavis", when='+cbtf+cuda')
depends_on("mrnet@5.0.1:+lwthreads", when='+cbtf')
depends_on("mrnet@5.0.1:+cti", when='+cti+cbtf')
parallel = False
build_directory = 'build_openspeedshop'
def set_CrayLoginNode_cmakeOptions(self, spec, cmakeOptions):
# Appends to cmakeOptions the options that will enable the appropriate
# Cray login node libraries
CrayLoginNodeOptions = []
rt_platform = "cray"
# How do we get the compute node (CNL) cbtf package install
# directory path?
# spec['cbtf'].prefix is the login node value for this build, as
# we only get here when building the login node components and
# that is all that is known to spack.
be_ck = spack.store.db.query_one('cbtf-krell arch=cray-CNL-haswell')
# Equivalent to install-tool cmake arg:
# '-DCBTF_KRELL_CN_RUNTIME_DIR=%s'
# % <base dir>/cbtf_v2.3.1.release/compute)
CrayLoginNodeOptions.append('-DCBTF_KRELL_CN_RUNTIME_DIR=%s'
% be_ck.prefix)
CrayLoginNodeOptions.append('-DRUNTIME_PLATFORM=%s'
% rt_platform)
cmakeOptions.extend(CrayLoginNodeOptions)
def cmake_args(self):
spec = self.spec
compile_flags = "-O2 -g"
if '+offline' in spec:
if spec.satisfies('+offline'):
# Indicate building offline vers (writes rawdata files)
instrumentor_setting = "offline"
if '+runtime' in spec:
if spec.satisfies('+runtime'):
cmake_args = [
'-DCMAKE_CXX_FLAGS=%s' % compile_flags,
'-DCMAKE_C_FLAGS=%s' % compile_flags,
@@ -173,7 +208,6 @@ def cmake_args(self):
# Appends base options to cmake_args
self.set_defaultbase_cmakeOptions(spec, cmake_args)
cmake_args.extend(
['-DCMAKE_CXX_FLAGS=%s' % compile_flags,
'-DCMAKE_C_FLAGS=%s' % compile_flags,
@@ -187,11 +221,14 @@ def cmake_args(self):
# Add any MPI implementations coming from variant settings
self.set_mpi_cmakeOptions(spec, cmake_args)
elif '+cbtf' in spec:
elif spec.satisfies('+cbtf'):
cmake_args = []
# Indicate building cbtf vers (transfer rawdata files)
instrumentor_setting = "cbtf"
if '+runtime' in spec:
if spec.satisfies('+runtime'):
# Appends base options to cmake_args
self.set_defaultbase_cmakeOptions(spec, cmake_args)
@@ -204,7 +241,6 @@ def cmake_args(self):
'-DMRNET_DIR=%s' % spec['mrnet'].prefix])
else:
cmake_args = []
# Appends base options to cmake_args
self.set_defaultbase_cmakeOptions(spec, cmake_args)
@@ -229,6 +265,13 @@ def cmake_args(self):
['-DQTLIB_DIR=%s'
% spec['qt'].prefix])
if spec.satisfies('+crayfe'):
# We need to build target/compute node
# components/libraries first then pass
# those libraries to the openspeedshop
# login node build
self.set_CrayLoginNode_cmakeOptions(spec, cmake_args)
return cmake_args
def set_defaultbase_cmakeOptions(self, spec, cmakeOptions):
@@ -263,22 +306,22 @@ def set_mpi_cmakeOptions(self, spec, cmakeOptions):
MPIOptions = []
# openmpi
if '+openmpi' in spec:
if spec.satisfies('+openmpi'):
MPIOptions.append('-DOPENMPI_DIR=%s' % spec['openmpi'].prefix)
# mpich
if '+mpich' in spec:
if spec.satisfies('+mpich'):
MPIOptions.append('-DMPICH_DIR=%s' % spec['mpich'].prefix)
# mpich2
if '+mpich2' in spec:
if spec.satisfies('+mpich2'):
MPIOptions.append('-DMPICH2_DIR=%s' % spec['mpich2'].prefix)
# mvapich
if '+mvapich' in spec:
if spec.satisfies('+mvapich'):
MPIOptions.append('-DMVAPICH_DIR=%s' % spec['mvapich'].prefix)
# mvapich2
if '+mvapich2' in spec:
if spec.satisfies('+mvapich2'):
MPIOptions.append('-DMVAPICH2_DIR=%s' % spec['mvapich2'].prefix)
# mpt
if '+mpt' in spec:
if spec.satisfies('+mpt'):
MPIOptions.append('-DMPT_DIR=%s' % spec['mpt'].prefix)
cmakeOptions.extend(MPIOptions)
@@ -308,26 +351,13 @@ def setup_environment(self, spack_env, run_env):
run_env.prepend_path('LD_LIBRARY_PATH',
os.path.dirname(oss_libdir.joined()))
run_env.set('OPENSS_RAWDATA_DIR', '.')
# Settings specific to the version, checking here
# for the cbtf instrumentor
if '+cbtf' in self.spec:
cbtf_mc = '/sbin/cbtf_mrnet_commnode'
cbtf_lmb = '/sbin/cbtf_libcbtf_mrnet_backend'
run_env.set('XPLAT_RSH', 'ssh')
run_env.set('MRNET_COMM_PATH',
join_path(self.spec['cbtf-krell'].prefix + cbtf_mc))
run_env.set('CBTF_MRNET_BACKEND_PATH',
join_path(self.spec['cbtf-krell'].prefix + cbtf_lmb))
run_env.prepend_path('PATH', self.spec['mrnet'].prefix.bin)
run_env.prepend_path('PATH', self.spec['cbtf-krell'].prefix.bin)
run_env.prepend_path('PATH', self.spec['cbtf-krell'].prefix.sbin)
elif '+offline' in self.spec:
# for the offline instrumentor, otherwise use cbtf instrumentor
# settings. MPI for the cbtf instrumentor is setup in cbtf-krell
if '+offline' in self.spec:
# Had to use this form of syntax self.prefix.lib and
# self.prefix.lib64 returned None all the time
run_env.set('OPENSS_RAWDATA_DIR', '.')
run_env.set('OPENSS_PLUGIN_PATH',
join_path(oss_libdir + '/openspeedshop'))
run_env.prepend_path('PATH', self.spec['papi'].prefix.bin)
@@ -341,3 +371,14 @@ def setup_environment(self, spack_env, run_env):
run_env.set('OPENSS_MPI_IMPLEMENTATION', 'mvapich2')
if '+openmpi' in self.spec:
run_env.set('OPENSS_MPI_IMPLEMENTATION', 'openmpi')
else:
cbtf_mc = '/sbin/cbtf_mrnet_commnode'
cbtf_lmb = '/sbin/cbtf_libcbtf_mrnet_backend'
run_env.set('XPLAT_RSH', 'ssh')
run_env.set('MRNET_COMM_PATH',
join_path(self.spec['cbtf-krell'].prefix + cbtf_mc))
run_env.set('CBTF_MRNET_BACKEND_PATH',
join_path(self.spec['cbtf-krell'].prefix + cbtf_lmb))
run_env.prepend_path('PATH', self.spec['mrnet'].prefix.bin)
run_env.prepend_path('PATH', self.spec['cbtf-krell'].prefix.bin)
run_env.prepend_path('PATH', self.spec['cbtf-krell'].prefix.sbin)