SC Kiran portability - press3.mcs.anl.govpress3.mcs.anl.gov/hpcport/files/2015/11/Kiran... ·...

Post on 03-Aug-2020

6 views 0 download

Transcript of SC Kiran portability - press3.mcs.anl.govpress3.mcs.anl.gov/hpcport/files/2015/11/Kiran... ·...

MultiplePlatforms:PortingAgent-BasedSimulationfromGridstoGraphicscardsD r. Ma r iamK i ran

Un iv ers i ty o f B radfordPresentedat:WorkshoponPortabilityAmongHPCArchitecturesforScientificApplicationsSuperComputing2015

AgendafortheTalkIntroduction

Settingthestage:Agent-basedmodelling

IntroducingFLAMEanditsportabilityfromHPCtoGPU

Portabilityproblems– rewritingmodelstomakesurethey‘run’

PossiblefuturedirectionsofusingClouds

Researchchallenges

Conclusions

MARIAMKIRAN 2

Computingworkingwithotherdisciplines

MARIAMKIRAN 3

Distributedandscalablecomputing

ScientificComputing

Complexsystemmodels(economic,biological,social

networks)Emergentbehaviourusingagent-basedmodelling

Agent-basedmodellingonHPCandGPU

(FLAME)www.flame.ac.uk

ModellingandSimulationon

Cloud

Agent-basedModellingEachindividual isapacketofprogrammingcodeallowedtosimulatetogether

Granularity

Interactions

Overcomemostassumptionsinthemodel

Examples innature– birdflockingbehaviour (boids),crowdbehaviour inhumans

MARIAMKIRAN 4

IntroducingFLAMEforbuildingagent-basedmodelsProducedattheUniversityofSheffield,UK.

Flexible Large-scaleAgent-basedModellingenvironment.

BasedonX-machinearchitecture foragents.

Beingusedinawidenumberofprojects(Modellingofcells, tissues,biologicalandeconomicscenariosornetworkingmodels)

Automaticallyproducesparallelisable codeformodels.

Easeofprogrammingfornon-computerexperts.

MARIAMKIRAN 5

FLAMEfilesThis file helps with parallelisation on HPC

MARIAMKIRAN 6

FLAMEadvantagesProducesautomaticallyparallelisable code.

Defaultitrunsinserial.

Butbyjustaddingaflag–p,whilecompiling, itproducesaparallelisable modelcode.

Communicationishandledusinganintelligentmessageboardlibrarywhichcanpooloutrelevantmessages,sort,randomise orfilterthemonanycriteria.

MARIAMKIRAN 7

Libmboard– FLAMEmessageboardlibrary

MARIAMKIRAN 8

SoftwareEngineeringperspective…FlamefollowsastrictX-machinearchitecture foritsagentsallowingittocontain◦ Memory◦ Functions◦ States◦ Messagesinandout

MARIAMKIRAN 9

Portingmodels:fromHPCtoGraphicsCards

MARIAMKIRAN 10

MultiplatformcapabilityYoucanwritemodelseasily

Softwareworksouthowtodistribute

Allyouhavetodoisrun

Needsomeknowledgeofthesystem

Preallocationandmemoryrequirements

Sometimesyouneedtorewritethecompletemodel

Howtotestthemodelrewrittenincorrect?

MARIAMKIRAN 11

FromFLAME

Softwaredoestherest

Samemodelsrunningon(a)differentdistributionsand(b)numberofnodes

MARIAMKIRAN 12

Changingplacementofprocessesonprocessors- samemodelChangingnumberofprocessors- samemodel

Note:FutureworkonCloudsmayintroduceamultitudeofmorefactors–Energy,Cost,OptimalVMplacement,networks,andmanymore

WhataretheperformancecharacteristicsMainperformancewasTime

Doweneedanymore?

-Modelchecking

-Costs

-Eco-efficiency

-Datapatterns– verifyingresults

MARIAMKIRAN 13

HPCversusGPUConsiderablechangesinthesoftwaretoensureitexecutesonGPU:

◦ WritingtheAgents– differentmodeldescriptions

◦ Pre-allocationofAgentmemory– GPUneedsalladvanceknowledge– nodynamicallocationofmemoryispossible

◦ Messagecommunication:needtobreakdownbigger functionsintosimpleronemessagefuntions

◦ SimplerversusComplex– Removedynamicarrays- memoryneedstobesimple

◦ LoopingthroughMessages– Looptraversalisdifferent,rewrite functions

◦ Agentbirthanddeath– Advancememoryallocation

◦ Realtimevisualization– HPCdoesnotallowthis

MARIAMKIRAN 14

LoopingthroughMessagesCodeforHPCneedstointroduceaflag‘finished’toleave thewhile loop.

Elsesimulationhangs!

MARIAMKIRAN 15

GPUimplementation:int MyFunction(xmahine_memory*agent,xmachine_message_list*list){

boolfinished=false;xmachine_message*message=get_first_message(list);while(message){

if(!finished){if(message->id==agent->id){

agent->state+=message->state;finished=true;

}}

message=get_next_message(message,list);}return0;

}

HPCimplementation:int MyFunction (xmahine_memory*agent,xmachine_message_list*list){

xmachine_message*message=get_first_message(list);while(message){

if(message->id==agent->id){agent->state+=message->state;return0;

}message=get_next_message(message,list);}return0;

}

Whataboutcloud?OPENLABS

GIV INGACCESSEVERYWHERE

MARIAMKIRAN 16

Computationally- whymovetowardsCloud?

Issues High performance computing Cloud computingKind of modelsand processing

Processing is limited is somearchitectures

Can introduce dynamicscalability for more complexprocessing.

Cost Access to expensive hardware tomodel and simulate systems.

Resources can be hired asneeded.

Failurerecovery

No fault recovery when disk spaceruns out.

Applications can burst to moreClouds if needed, automatically.

Dynamicchanges in themodel

No real time processing, jobs aresubmitted to a queue, whichmeans real time changes cannotbe incorporated in themodels.

Can execute jobs on the flywhich can read real time datafeeding to the models directly.(very useful for sensor relatedmodels)

MARIAMKIRAN 17

CloudComputationalchallengesrelevanttoABMMemory constraints savedasbigdatasetsService levelagreements

Optimise computationReducetime

ReducecostsEnergyefficientcode

Hideawayasmuchcomputation aspossible

- VMdoing processing- Databeingsaved indataservers

MARIAMKIRAN 18

Researchchallengesstillrelevant1.Languagetocommunicatemodelsbetweenmultiplegroups

2.Automaticallyparsethistooptimaldistributionforprocessing◦ RewritemodelsforGPU,HPC,Cloud?◦ Whataretheperformancemetricsneededbymodellers?

3.Justsavinginformationneeded,globalaverages,specificeventsforverification

‘Openlab’toexecuteandsharemodelsandresults?

Modeldescription

(1)

Particularmodellingtechnique(e.g.ABM)

Parsetoproduceautomatic

parallelisation(2)

Codeexecutes

Resultsaresaved,analysed,visualise(real-time,batch)(3)

Architecturedependency(HPC,GPU,Cloud)

whatisneeded?Globalparameters,

memoryconstraints,additionalprocessing?

Performancemetrics(whattoconsider?)

MARIAMKIRAN 19

ConclusionsSimulationsaregettinglargerandmorecomplex.

Realistic simulationsrequire largerpopulations,ormultiple typesofpopulation,asthevalidityofemergentcharacteristic dependentonboth:theaccuracyofthebehaviour modelledandpopulationsizes.Forecastbehaviours ofsystemsfasterthanthewall-clock time.

Run-timecostsarepresentlyinhibiting theeffectiveuseofABMasforecastingtool.

Agent-basedmodelshavesuccessfullybeenabletouncovernewaspectsofeconomicsystemssuchastheeffectofmigrationonEUlabormarketsoruncoveringsomeunderlying factsinbiological systemsandneedHPC,GPUsandnewertechnologies.

ManymodelswrittenforHPCandGPUshouldportraysimilarcharacteristics, hidingawaymuchofthesoftwarecomplexity fromthenoncomputingscientistsusingthetoolstowritetheirmodelswhichisachallenge initsownright.

MARIAMKIRAN 20

ThankyouandAnyquestions?

MARIAMKIRAN 21