ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features...

Preview:

Citation preview

Photos placed in horizontal position with even amount

of white spacebetween photos

and header

Photos placed in horizontal position

with even amount of white space

between photos and header

Sandia National Laboratories is a multi-mission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525.

ISO/C++17andBeyond:ParallelismandConcurrency

(breakoutsession)

DOECOEPerformancePortability

August22-24,2017Denver,CO

SAND2017-8950PE

1

Agenda

§ DOELabparticipationinISO/C++StandardCommittee§ Whyweareinvolved– HPCperformanceportability!§ Yourlab’spoint-of-contact§ Howthe”sausageismade”

§ OverviewofHPCrelevantC++11&17features

§ Overviewofpotential(in-the-works)C++20features§ Whatin-the-worksfeaturesaremostimportanttoyou?§ Whathigh-priorityfeaturesnotin-the-works?

2

ISO/C++Committee:YourLab’sPoint-of-Contact§ Eachlabisanindependentcorporatememberofcommittee

§ Oneprimaryrepresentativeexercisesformalvotingrights§ Annualdues,listedinISOdirectory,participateregularly

§ Alternaterepresentativevotingrightsintheabsenceofprimary§ AlsolistedinISOdirectory

§ Anyonefrommemberorgcanparticipateinmeetings

§ Yourlab’sprimaryrepresentative(somealternates?)§ SNL– CarterEdwards§ LANL– StuartHerring§ LLNL– JimReus§ ANL– HalFinkel§ LBNL– BryceLelbach§ ORNL– GrahamLopez

§ FYI:SNLhostingnextISO/C++CommitteeWorkingMeeting§ Nov6-11@Albuquerque

3

ISO/C++Committee:HowSausageisSlowlyMade

Language EvolutionWorkingGroup(EWG)

CoreWorkingGroup(CWG)

ProposalPaper

DraftStandard

LibraryEvolutionWorkingGroup(LEWG)

LibraryWorkingGroup(LWG)

ConcurrencyandParallelismStudyGroup(SG1)

ConcurrencyTS

DomainExpertStudyGroups

SubjectTechnicalSpecifications(TS)

FULLCOMMITTEEOFFICIALVOTING

4

ISO/C++Committee:Roles&Responsibilities§ ProposalPapers§ Anyonemaysubmitatracked proposalsfor§ Additionsormodificationsto draftstandardortechnicalspecifications

§ DomainExpertStudyGroups§ Applydomainspecific(beyondlanguage/library)expertise;e.g.,§ Concurrency&Parallelism(SG1),FileSystem(SG3),Networking(SG4),...

§ Library(LEWG)andLanguage(EWG)Evolution§ Prioritizationamongalways-too-manyproposalpapers...§ Broadenoughimpacttobeworthsupporting?§ Well-specifiedscope,semantics,interactions,anddomain-expertreview?

§ Library(LWG)andLanguage(CWG)§ Well-specifiedstandardese (wordingforstandard)?§ “QualityAssurance”– mypersonalview§ Typically theonlygroupstobring“strawpoll”motionstothefullcommittee

§ Badformanddramaensuesattemptingtobypassqualityassurance

5

HPC-RelevantC++11&17Features§ Parallelalgorithms(C++17)§ Allow functors tobeexecutedinparallelonunspecifiedresources§ ...importantincrementalprogress,C++20improvementsintheworks

§ AtomicOperationsandMemoryModel(C++11,improvedC++17)§ Efficientinter-threadcommunication/synchronization§ Scalableconcurrentlymodifieddatastructures

§ Threads,Mutexes,andConditionsVariables§ C++11pulledpthreads intothestandard w/namechanges&reducedscope

§ Futures,Promises,andAsync L§ ...infamous,whisperedaboutC++11“Konacompromise”§ ...avoidusingthesefornow;atleastbeverycautious

6

Productivity-RelevantC++11&17Features

§ LambdaExpressions– inlinefunctors§ C++11:Introduced,dramaticimprovementtoproductivity§ C++17:Languageflawfixedfor[*this]§ NVIDIACUDA8:OffloadlambdaexpressionstoGPU§ Essentialforease-of-useinKokkos,RAJA,...

§ Templatemeta-programmingimprovements§ C++11:Variadic templatearguments§ C++11:<type_traits>§ C++17:constexpr conditionalstatementsJJJJ

7

HPC-RelevantPotentialC++20Features§ AtomicOperationsEnhancements§ Floatingpointfetch_add andatomicoperationsonnon-atomictypesØ Buildingblocksenablingscalableparallelscatter-addalgorithms

§ LatchesandBarriers§ Atomic-likethreadsynchronizationmechanisms

§ ExecutorsandExecutionContext§ Executor– specifyhow concurrent/parallelworkisdispatched§ Context– specifywhere concurrent/parallelworkisdispatched§ Fixfuturesandasync

§ Wavefront extensionstoparallelalgorithms§ ”Staggered”or“pipelined”parallelexecutionofloops

8

HPC-RelevantPotentialC++20Features§ Coroutines (TS)§ Functionsdesignedtobecallediteratively/concurrently§ Well-definedsuspension/resumption

§ SIMDTypes– PortableVectorIntrinsics§ Guarantee arithmeticoperationsmaptointrinsics forvectorhardware§ Addressvectorwidth,intra-laneoperations,conditionalcontrolflow,...

§ MultidimensionalArrays(finally!)with PolymorphicLayout§ MotivatedbyKokkosmultidimensionalarrays§ Arraytypeincludesrowmajor,columnmajor,...layoutspecification

§ Modules(TS)– improvecompilationperformance§ Concepts“light”– improvetemplatemeta-programming§ Many,manyyearsinthemaking,withsomereputationsontheline...§ ...questionhasbeenraisedif,givenC++17features,thisisstilluseful😲

9

OpenDialogue/DeepDiveasRequested

§ C++11spec,C++17draft,proposalpapers§ cppreference.com forC++11,C++14,C++17,andTStowardC++20§ alsohavesomein-hand

§ Prioritiesforpotentialfeaturesmentioned?§ Mayneedtobechampionedbyyou/yourDOELabreps

§ Importantneededfeaturesnotmentioned?§ Mayhavefailedtomention§ Mayneedtobeaddedandchampionedbyyou/yourDOELabreps

§ Deeperlookatexisting/proposedfeatures?§ Sufficientnumberpresentwanttodeep-dive?doitnow§ Otherwiseanoff-linesmallgroupactivity

Recommended