40
Mario Melara (NERSC) Todd Gamblin (LLNL) Gregory Becker (LLNL) Robert French (ORNL) Matt P. Belhorn (ORNL) Kelly Thompson (LANL) Peter Scheibel (LLNL) Rebecca Hartman-Baker (NERSC) Using Spack to Manage Software on Cray Supercomputers -1- May 9 th , 2017

Using Spack to Manage Software on Cray Supercomputers · Robert French (ORNL)! Matt P. Belhorn (ORNL)! Kelly Thompson (LANL)! Peter Scheibel (LLNL)! ... – Special target flags

  • Upload
    vuliem

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Mario Melara (NERSC)!Todd Gamblin (LLNL)!Gregory Becker (LLNL)!Robert French (ORNL)!Matt P. Belhorn (ORNL)!Kelly Thompson (LANL)!Peter Scheibel (LLNL)!Rebecca Hartman-Baker (NERSC)

Using Spack to Manage Software on Cray Supercomputers

-1-

May9th,2017

State of Software in HPC

•  Scien2ficso6warelargeandcomplex(mul2pledependencies)

•  HPCteamssupportdifferentversionsofso6ware•  Samepackagesinstalledbutbuiltwithdifferentcompilers/libraries/etc

-2-

Tools for HPC Software

•  PackagemanagersforHPC–  Smithy(ORNL)–  SWTools(ORNL)–  EasyBuild(UGhent)– Maali(Pawsey)–  Spack(LLNL)

-3-

The Supercomputing PACKage Manager

-4-

SuperComputing PACKage Manager

•  SpackincludedmanyfeaturesofinteresttousatNERSC–  Easytoinstallanduse–  Packagesareflexible

•  Buildarangeofversionsforeachpackage.•  LLNLourcloseneighbors!•  ToddGamblinandGregBecker(leaddevelopers)

•  Lackedcompa2bilitywithourCraysystems– WorkneededtoadaptSpacktoCraysystems–  OriginallyusedonLLNLLinuxclusters

-5-

Package template files

•  Allowdifferentop2onstobechosen•  Canpickandchoosedependencies,variants,compilers.

•  Automa2cpatching•  Controlovercombinatorialspaceofapackage.•  Wrapperforcommonfileandbuildfunc2ons

–  configure(),make()

•  Canmodifybuildenvironmentforpackageandit’sdependents.

-6-

Package template file

Exampleofapackagetemplatefile

-7-

from spack import *

class Libelf(AutotoolsPackage): """libelf lets you read, modify or create ELF object files in an architecture-independent way. The library takes care of size and endian issues, e.g. you can process a file for SPARC processors on an Intel-based system."""

homepage = "http://www.mr511.de/software/english.html" url = "http://www.mr511.de/software” “libelf-0.8.13.tar.gz"

version('0.8.13', '4136d7b4c04df68b686570afa26988ac') version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7')

provides('elf')

def configure_args(self): args = ["--enable-shared", "--disable-dependency-tracking", "--disable-debug"] return args

def install(self, spec, prefix): make('install', parallel=False)

Spack Spec Syntax SpecType SpecSymbol CLIUsage

package package-name python

version @ [email protected]

compiler % [email protected]%gcc

architecture arch= [email protected]%gccarch=cray-CNL-haswell

variant +/- [email protected]%gcc+tkarch=cray-CNL-haswell

compilerflags ldflags=,cflags=,cxxflags=,cppflags=

[email protected]%gcc+tkarch=cray-CNL-haswellcflags=-02

-8-

EachparameterconstrainsthespecFullcontroloverthecombinatorialspaceofapackage.

$ spack spec blast-plus [email protected]%[email protected]+bzip2+freetype+gnutls+jpeg+lzo+openssl+pcre+perl+png+python~static+zlib arch=cray-CNL-ivybridge ^[email protected]%[email protected]+shared arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected]+pic+shared arch=cray-CNL-ivybridge ^[email protected]%[email protected]+internal_glib arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected]+sigsegv arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^jpeg@9b%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected]+utf arch=cray-CNL-ivybridge ^[email protected]%[email protected]+cpanm arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected]~tk~ucs4 arch=cray-CNL-ivybridge ^[email protected]%[email protected]~symlinks arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge ^[email protected]%[email protected] arch=cray-CNL-ivybridge

•  Specrepresentsadirectedacyclicgraph

•  Concre2za2onalgorithm•  Fixed-point

-9-

Installing Packages w/ Spack

•  Easyas`spackinstallmpileaks`•  Spackcompilerwrappershandlelib,includeandRPATHs,andcompilerflags.

•  EachpackagehasuniqueDAG-hashforprovenance–  Directorytreegeneratedforyou

•  Generatesmodulefilesinapost-hooka6erinstallmethodcompleted.–  SupportsLmod,Dotkit,TCL

-10-

Spack Configuration

•  Spackallowsflexibilityandcustomiza2on•  Configura2onfiles

–  packages.yaml–  modules.yaml–  compilers.yaml–  config.yaml

-11-

Spack Community •  WhenpresentedatSC’15Spacksupportedonly300packages.Nowover

1,400packagesaresupported.•  SpackisinUSExascaleCompu2ngProject.•  Over75%ofpackagesarecontributedexternally.

-12-

Cray Programming Environment

-13-

Cray Programming Environment

•  NERSChousestwoCray-XCs(EdisonandCori)•  Corinamedtop5mostpowerfulsupercomputer

–  asofNovember2016

•  CoriArchitecture–  IntelXeon(Haswell)andIntelXeonPhi(Knight’sLanding)–  BurstBuffer–  250Uniquepackagesmaintainedonthesesystems

-14-

TCL Modules Environment

•  Dynamicallymodifytheuser’senvironment•  Vitalforcompilingcodes

–  SwapinandoutofProgrammingEnvironments–  LoadnecessaryCrayopgmizedlibraries.–  Loadtargetprocessorsforcross-compiling.

-15-

NERSC default modules

-16-

Default Modules Found on Cori 1) modules/3.2.10.5 12) xpmem/2.1.1_gf9c9084-2.38 2) nsg/1.2.0 13) job/2.1.1_gc1ad964-2.175 3) intel/17.0.2.174 14) dvs2.7_2.1.6

4) craype-network-aries 15) alps/6.3.4-2.21 5) craype/2.5.7 16) rca/2.1.6_g2c60fbf-2.265

6) cray-libsci/16.09.1 17) atp/2.0.3 7) udreg/2.3.2-7.54 18) PrgEnv-intel/6.0.3 8) ugni/6.0.15-2.2 19) craype-haswell

9) pmi/5.0.10-1.0000 20) cray-shmem/7.4.4 10) dmapp/7.1.1-39.37 21) cray-mpich/7.4.4

11) gni-headers/5.0.11-2.2

Programming Environment Modules

•  ThreetypesofPrgEnvmodules–  PrgEnv-intel–  PrgEnv-gnu–  PrgEnv-cray

•  Loadcorrespondingcompiler:Intel,GCC,CCE•  Compilermodulecontrolscompilerversion.

-17-

Target Modules

•  Craymachinesareheterogeneousstructures–  Front-end(loginnode)andback-end(computenodes)varyinprocessorandoperagngsystem.

•  Front-end(loginnodes)–  Basictasks(I/O,filesystemtasks,loadingdata,compiling)

•  Back-end(computenodes)–  Highperformancetasks–  Whatyoursoiwareshouldbeopgmizedagainst–  Specialtargetflagsincraycompilersplacedbasedonloadedtarget.

•  Targetmodulesexistsoyoucancross-compilewithoutsubmihngajob.

-18-

Cray and Third-Party Software

•  Crayprovidesop2mizedso6warelibraries– MPI(cray-mpich)–  I/OLibraries(cray-netcdf,cray-hdf5)– Mathlibraries(cray-petsc,cray-trilinos)–  Numericalrougnes(BLAS/LAPACK/SCALAPACK)

•  Cray-libsci,Intel-MKL

•  Monthlyupgrades•  Librariesnecessaryforcompiledso6ware.

-19-

Cray Compiler Wrappers

•  Longcomplexlineof–Land–Iflags.•  Containop2miza2onflagsforarchitectureandtargetprocessor.

•  Recommendedtocompilecodeforcomputenodes.•  RequirescompilingwithCrayprovidedexecutables

–  cc,CC,in

-20-

Spack on Cray

-21-

Spack on Cray

•  NERSCandLLNLcollabora2ontoportSpackontoCray.§  Modulesupport§  ArchitectureSpec§  CompilerDetecgon/WrapperHandling§  UseofCraypackages§  MPIsupport§  StagcandDynamicLinking

-22-

Modules Support

•  Priortov0.10Spackcouldloadownmodulesbutnotsystemmodules.

•  Pythonwrapperformodulecmd–  Takesasargumentasshellnamei.ePython,Ruby,Bash–  Outputcanbeparsedbythatshell

•  Canloadandunloadmodules–  PrgEnv-gnu/intel/cce–  Targetmodules.

-23-

Architecture Spec •  Previousversionsofarchspecwerejuststrings

•  Spackuniquelyprovidessupportforcompilingagainstdifferentarchitectures.

•  Auto-detected•  Coridefaults:–  arch=cray-CNL-haswell

•  Genepooldefaults:–  arch=linux-debian6-x86_64

-24-

Cori Archclass

Plalormclass•  CraysubclassOSclass•  sles_12subclass•  CNLsubclass

Targetclass•  Haswellmodule•  mic_knlmodule

Genepool Archclass

Plalormclass•  LinuxclassOSclass•  debian6class

Targetclass•  x86_64module

Improved Compiler Detection and Wrapper Handling

•  Detec2onpreviouslymadethrough$PATH.•  modulecmdpythonavail(gcc/intel/cce)•  Pointwrapperstocc,CC,6nratherthandirectcompilerpath.

•  Addopera2ngsystem/targettocompilermeta-data.

-25-

Spack Compiler Wrappers

-26-

Support for Cray Packages

•  Exis2nglogicalreadypresentinpackages.yaml•  Declarepackagesasmodules

–  Spackcanloadtherequiredmodule–  Deducepathfrommodules

-27-

packages.yaml packages:

mpich:buildable: falsemodules:

[email protected]%[email protected]: cray-mpich/7.3.2 [email protected]%[email protected]: cray-mpich/7.4.1

[email protected]%[email protected]: cray-mpich/7.4.1

python:buildable: falsepaths:

[email protected]%[email protected]: /global/common/software/python

[email protected]%[email protected]: /global/common/software/python [email protected]%[email protected]: /global/common/software/python

-28-

Message Passing Interface

•  CrayprovidesModulePassingToolkit(MPT)–  cray-mpich,cray-shmem

•  MPICompiler:cc,CC,6n.•  Userchooseshowtocompile

–  RegisterMPIcray-mpichinpackages.yaml.–  UseSpackbuiltMPI

•  Packagewri2ngforMPIismadesimple–  env[‘CC’]=spec[‘mpi’].mpicc–  env[‘CXX’]=spec[‘mpi’].mpicxx

-29-

Static and Dynamic Linking

•  Defaultsta2clinking–  Causesproblemswithmostbuildsystemassumpgons.

•  $CRAYPE_LINK_TYPE=dynamic–  CraybuildsworklikeLinuxbuilds–  Spackdoesn’tprecludestagclinking

•  Stagcflagsaddedbybuildsystem.

-30-

Spack at NERSC and ORNL

-31-

NERSC Usage

•  Pseudo-userSWOWNER–  Loginaspseudo-userandinstallpackages–  Specialreadandwrite

•  NERSCowngithubrepo–  ForkedfromLLNLbranch–  Changeourforkandmergechangesintomainrepo

•  CanuseSWOWNERSpackoryourown•  FutureplanstoofferSpackasmoduletousers

-32-

ORNL Usage

•  MainlyusedatOLCFandNCRC•  NumberofpackagesinstalledwithSpack

–  7/193Titan(CrayXK7)–  5/73Eos

•  Onnon-Cray48/59packagesinstalledw/Spack.•  SingleSpackinstanceusedperhost.•  FutureusetoallowuserstouseSpackwithlimitedpermissions.

-33-

Results at NERSC

•  SehngupSpackcanbeburdensome–  Hardtomakeconfiguragonsforallplalorms

•  Plaoormspecificcompilersneeded–  Mostsitessupportmulgpleplalorms

•  Modulefilesneedsbepercustomiza2on–  Nologictoswitchbetweenprogrammingenvironments

•  Installa2ondirectorytreeneedscustomiza2on–  Mostsiteshavecanonicalpathforinstalls

•  MinimalstackonEdison/Cori–  Notreadyforproducgon.Yet!

•  ORNLwantstomovetoproduc2onaswell!

-34-

Results at ORNL

•  Spackmostlyusedonnon-Craysystems•  MovetowardsSpackonCrayisslow.•  LowernumberofpackagespresentonTitanandEos.

-35-

Related Package Managers

•  EasyBuild–GhentUniversity(UsedatmostCUGsites)–  Easyconfigs,easyblocks

•  Maali– PawseySupercompu2ng–  Collecgonofbashscripts

•  Smithy–ORNL–  PortbasedpackagemanagerspecificallyforCrays

-36-

Comparison EasyBuild Spack Maali Smithy

Installsdependencies

Y Y N N

CombinatorialStack

Y Y N N

ProgrammingLanguage

Python Python Bash Ruby

Generatesmodulefiles

Y Y Y Y

ManipulatesCraymodules

Y Y Y Y

DependencyResolugon

N Y N N

Version v3.2.0(stable) V0.10(alpha) release_1.x v1.6.5

-37-

Conclusions

-38-

Conclusions

•  Spackisalphaso6ware•  Futureworks2llneededonSpacktoaccommodateour

needs–  Defaultsystempackageconfiguragon–  ModulefilelogicforswappingPrgEnvs–  Custominstallnamingscheme(PRsubmired!)–  Gesngstagcbuildsishard!

•  Packagebuildsareunstable–  NERSCplansonnightlytestsonCray

•  SpacksupportforcontainersinShi6er.–  UseSpackasapackagemanagerinimages

•  Adop2nganewtoolisaslowprocess!

-39-

National Energy Research Scientific Computing Center

-40-