iso/c++17 and beyond: parallelism and concurrency€¦ · 7 hpc-relevant potential c++20 features...
TRANSCRIPT
![Page 1: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/1.jpg)
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
![Page 2: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/2.jpg)
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?
![Page 3: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/3.jpg)
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
![Page 4: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/4.jpg)
3
ISO/C++Committee:HowSausageisSlowlyMade
Language EvolutionWorkingGroup(EWG)
CoreWorkingGroup(CWG)
ProposalPaper
DraftStandard
LibraryEvolutionWorkingGroup(LEWG)
LibraryWorkingGroup(LWG)
ConcurrencyandParallelismStudyGroup(SG1)
ConcurrencyTS
DomainExpertStudyGroups
SubjectTechnicalSpecifications(TS)
FULLCOMMITTEEOFFICIALVOTING
![Page 5: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/5.jpg)
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
![Page 6: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/6.jpg)
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
![Page 7: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/7.jpg)
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
![Page 8: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/8.jpg)
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
![Page 9: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/9.jpg)
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😲
![Page 10: ISO/C++17 and Beyond: Parallelism and Concurrency€¦ · 7 HPC-Relevant Potential C++20 Features §Atomic Operations Enhancements §Floating point fetch_addand atomic operations](https://reader035.vdocuments.us/reader035/viewer/2022070915/5fb5e9bfa295ac71ab20c5cb/html5/thumbnails/10.jpg)
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