/
REPASTSIMPHONYBATCHRUNSGETTINGSTARTEDNICKCOLLIER,JONATHANOZIK-REPASTDE REPASTSIMPHONYBATCHRUNSGETTINGSTARTEDNICKCOLLIER,JONATHANOZIK-REPASTDE

REPASTSIMPHONYBATCHRUNSGETTINGSTARTEDNICKCOLLIER,JONATHANOZIK-REPASTDE - PDF document

debby-jeon
debby-jeon . @debby-jeon
Follow
375 views
Uploaded On 2015-10-10

REPASTSIMPHONYBATCHRUNSGETTINGSTARTEDNICKCOLLIER,JONATHANOZIK-REPASTDE - PPT Presentation

DemoModeltolaunchthedemomodelYoumayhavemoreentriesthanthesingleoneshowninthe 1httprepastsourceforgenetdownloadhtml2httpwwworaclecomtechnetworkjavajavasedownloadsindexhtml1 2NICKCOL ID: 155934

DemoModel"tolaunchthedemomodel.Youmayhavemoreentriesthanthesingleoneshowninthe 1http://repast.sourceforge.net/download.html2http://www.oracle.com/technetwork/java/javase/downloads/index.html1 2NICKCOL

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "REPASTSIMPHONYBATCHRUNSGETTINGSTARTEDNIC..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

2NICKCOLLIER,JONATHANOZIK-REPASTDEVELOPMENTTEAMscreenshot,inwhichcase,justbesuretoselectJZombies DemoModel.DonotselectZombies DemoModel. Figure1.JZombiesModelLauncher2.TheBatchRunConfigurationGUITheBatchRunCon gurationGUIisusedtocon gureandlaunchthebatchrun.Tostartthecon gurationGUI,starttheJZombiesdemomodel(seesection1)andclickonthelightningboltinthetoolbar( g.2).NotethatyoucanalsostarttheGUIasastand-aloneapplication.Seesection6.4forthedetails. Figure2.BatchRunCon gurationGUILaunchTheGUIisusedtocon gureabatchrun.Thiscon gurationcanbesavedandthenloadedatafuturetime.Thecon gurationGUIconsistsofatoolbarandfourtabbedpanels( g.3).The rstfourtoolbarbuttons areusedtocreateanewcon guration,openanexistingcon guration,savethecurrentcon guration,andsavethecurrentcon gurationinanew le.Hoveringoverthebuttonswiththemousewillshowatooltipexplainingthebuttonsfunction.The fthbutton willreloadthepropertiesinthemodelpanelfromthecurrentmodel.Theremainingtwobuttonshavetodowithperformingthebatchrunsitself.Regardlessoftypeofbatchrun(local,distributed,andsoforth),thebatchrunrequiresenoughofRepastSimphonyaswellasthemodeltoberuninordertowork.Thesepartsarebundled 6NICKCOLLIER,JONATHANOZIK-REPASTDEVELOPMENTTEAMtherighthandside\HostProperties"displaysthepropertiesforthehostselectedonthelefthandside.Newhostscanbecreatedusingthe\AddHost" button.Acopyofanexistinghostcanbemadewiththe\CopyHost" button.Existinghostscanbedeletedbyselectingthehosttodeleteandpressingthe\DeleteHost" button. Figure5.HostsPanelTheHostPropertiesare:Type:Thetypeofhost:localorremote.User:Theusernameoftheaccountontheremotemachine.Thisisonlyusedforaremotehost.Host:Thenameoripaddressoftheremotemachine.Thisisonlyusedforaremotehost.SSHKeyFile:ThenameoftheprivateSSHkey leusedtoauto-loginontheremotehost.Thisisonlyusedforaremotehost.Instances:Thenumberofinstancestorunonthehost.Eachinstancewillbeas-signedachunkoftheparameterspacetorun.Eachofthehostsde nedonthehostpanelwillbeusedtoperformthebatchruns.Forexample,ifonelocalhostandoneremotehostisde nedandthelocalhosthastwo REPASTSIMPHONYBATCHRUNSGETTINGSTARTED7instancesandtheremotehosthasasingleinstance,thenthebatchparameterspacewillbedividedinthirds.Two-thirdswillberunlocallyinparallel:eachinstanceonthelocalmachinewillrunathirdofthespace.Theremainingthirdwillberunontheremotemachine.Thenumberofinstancestorunonamachineshouldberoughlythenumberofhardwarethreadsavailableonthemachine.Ofcourse,yourmilagemayvary,especiallyifthemachineisperformingothercomputationallyexpensivetasks.2.3.1.LocalRuns.Localrunsaretheeasiestrunstoperform,requiringtheleastamountofexternalsetup.Tocon gurealocalrun,createahost(orchoseanexistingone)andsetitstypetoLOCAL.YouwillseethehostlabeledassomethinglikeX@localhostwhereXistheusernameoftheaccountrunningtheGUI.Whenyouperformalocalrun,theGUIcopiesthearchivepayloadmentionedabovetoatemporarylocationonthemachine'shard-drive.Thispayloadisunzippedandtheparameterspaceisdividedamongtheinstancestoberunlocallyandtherunsarebegun.Oncetherunshaveended,theoutputgeneratedbyeachinstanceisconcatenatedtogetherandplacedintheoutputdirectoryspeci edinthemodelpanel.2.3.2.RemoteRuns.Remoterunsaremorecomplicatedandyoumayhavetodosomesetuponthelocalandremotemachine.Remotemachinescanbeanythingfrommiscel-laneoussparemachinesthatyoumighthaveuptoamazon'scloudcomputingservices.RemoterunsworkoverSecureShell(SSH).SSHisacryptographicnetworkprotocolforsecuredatacommunication,remoteshellservicesorcommandexecutionandothersecurenetworkservicesbetweentwonetworkedcomputersthatconnect,viaasecurechanneloveraninsecurenetwork,aserverandaclient(runningSSHserverandSSHclientprograms,respectively).AnymachinethatallowsyoutoconnecttoitviaSSHandcanrunajavavirtualmachinecanbeusedtoperformaremoterun.Seesection6onhowtosetuptheremotemachines.Onthelocalside,thatis,onthemachineyouarerunningthebatchcon gurationGUIon,youwillneedtobesetuptoauto-logintotheremotemachineusingpublickeyauthentication.Thisconsistsofcreatingasshpublic/privatekeypaironyourmachine,ifthosedon'talreadyexist,copyingthatkeytotheremotemachineandthenappendingthekeytothelistofauthorizedkeysontheremotemachine.Someusefulreferencesthatdescribethisare:OSX-http://smbjorklund.no/ssh-login-without-password-using-os-xWindows-Seebelow.Linux-https://hkn.eecs.berkeley.edu/dhsu/ssh public key howto.htmlOthersitesexistaswell,google\sshpublickeyauthentication"formoreinformation.Thesituationonwindowsismorecomplicated.OSXandLinuxcomewithsshandthusthebuilt-inabilitytogeneratepublic/privatekeypairs.Unfortunately,thisisnotthecaseforWindowsandthussomesetupisrequired.ThefollowingstepsdescribeonewaytogeneratethekeypairandcopyittotheremotemachineunderWindows.(1)DownloadandinstalltheGitClientfromhttp://git-scm.com/download/win. REPASTSIMPHONYBATCHRUNSGETTINGSTARTED9nameoripaddressofthemachinetologinintoandtheSSHKeyFileistheprivatekey leonthelocalmachineusedtoauto-logintotheremotemachine.This leistypicallycalledid rsaina.sshdirectoryintheuser'shomedirectory,butitmaybedi erent.Whenperformingabatchrunusingaremotehost,theactivepayloadwillbecopiedtotheaccountoftheuserspeci edinthehostproperties.Afterthat,therunoccursasitdoesinthelocalversion.Thearchiveisunzippedandtheparameterspaceisdividedamongtheinstancestoberunonthatremotehost.WhentheinstancerunshaveendedtheoutputiscopiedbacktothemachinewheretheGUIwasrun,concatenatedandwrittentotheoutputdirectory.3.PreparingYourModelforBatchRunsThe rstrequirementforabatchrunisthatyourmodelmustterminateeachrun.WhenrunningthemodelviatheGUIthisistypicallydonebyclickingthestopbutton.Inthebatchruncase,youmustsetandchecksometerminationconditionandthenstopthemodelifthatconditionismet.Or,setthemodeltoterminateatsomespeci ctick.IntheJZombiescase,the rstofthesemightlooklike:if(context.getObjects(Human.class).size()==0){RunEnvironment.getInstance().endRun();}ThischeckstoseeifthereareanymoreHumansandifnotthenitcallsRunEnvironmenttoendtherun.Contexthereisthemodel'smastercontext.Somethinglikethiscouldbescheduledtoexecuteonceeverytickeithermanuallyorviaascheduledmethodonthecontextbuilder.Thesecondoptionlookslike:RunEnvironment.getInstance().endAt(30);Thisschedulesthesimulationtoendattick30.ItcanbeplacedintheContextBuilderforyourmodel.Thesecondrequirementconcernsthemodel's leoutput.ThebatchmechanismassumesthattheoutputiscapturedusingRepastSimphony'sFileSinksandthatthe leswillbewrittensomewhereinthe\instance"directorywherethemodelruns.Thebestwaytoinsurethatthisoccurstospecifythe lewithonlythe lenamewithoutanypathinformation.Makesurethatthe lenamedoesnotbeginwitha\/"(underOSX,Linux)or\X:n"or\n"(underwindowswhereXisanydriveletter).Thenameitselfcanbeanything.Figure7isanexampleofanacceptable le.4.BatchRunModelOutputAsmentionedabovetheoutputfromeachinstancewillbeconcatenatedandcopiedintotheoutputdirectoryspeci edintheGUI.The lesinkoutputwilllookthesameasanormalnon-batchrunexceptthattherunnumberswilllikelynotbeinnumericordergiventhattheconcatenationmakesnoaccountfororder.Forexample,theoutputfromrun11mayappearbeforethatfromrun2. 12NICKCOLLIER,JONATHANOZIK-REPASTDEVELOPMENTTEAM Figure8.ModelPanelForRunusingthatinformation.(Inwhatfollows,the lepathshavebeenshortenedforformattingpurposes.Youwillseethefull lepath).INFO[AWT-EventQueue-0]16:55:18,582repast.simphony.batch.gui.BatchConfigMediator-Writingbatchrunconfigfileto:JZombies_Demo/output/config.propsThesecondstatusmessagesaysthatthebatch params.xml lethatwascreatedviatheGUIis\unrolled"andwrittentoatemporarydirectory.\Unrolling"herereferstoexplicitlyproducingandwritingeachindividualparametercombinationtoa le.Itisthisunrolledparameter lethatisdividedanddistributedtothehostsforrunning.INFO[AWT-EventQueue-0]16:55:18,588repast.simphony.batch.gui.BatchConfigMediator-Unrollingbatchparameterfile:JZombies_Demo/batch/batch_params.xmlto/var/folders/31/yd0l22kx35zgy1wbnc8p7gbr0000gr/T/unrolledParamFile.txtThenextsectionistheoutputoftheAntscript(seehttp://ant.apache.org)thatcreatesthearchivepayload.Herewecanseethecreationofaworkingdirectoryunderneathatemporarydirectory.ThisworkingdirectorywillcontainthemodelitselfandtheRepastSimphonycodenecessarytorunthemodel.The[copy]and[jar]sectionsreportmodelcodeand lesbeingcopiedintotheworkingdirectoryandthecreationofjararchives REPASTSIMPHONYBATCHRUNSGETTINGSTARTED13 Figure9.BatchPanelForRuncontainingthenecessaryrepastcode.(I'vereplacedpartofthetemporarypathwith\..."andtruncatedthejarsectionabittoimprovethereadabilityhere.)make_zip:[delete]Deletingdirectory/private/var/folders/.../working[mkdir]Createddir:/private/var/folders/.../working[mkdir]Createddir:/private/var/folders/.../working/bin[mkdir]Createddir:/private/var/folders/.../working/scenario.rs[copy]Copying2filesto/private/var/folders/.../working[copy]Copying3resourcesto/private/var/folders/.../working[copy]Copying1resourceto/private/var/folders/.../working/binmake_pre_reqs:[mkdir]Createddir:/private/var/folders/.../working/data[mkdir]Createddir:/private/var/folders/.../working/lib...[jar]Buildingjar:/private/var/folders/.../working/lib/repast.simphony.batch.jar[jar]Buildingjar:/private/var/folders/.../working/lib/repast.simphony.statecharts.jar[copy]Copying69filesto/private/var/folders/.../working/lib[jar]Buildingjar:/private/var/folders/.../working/lib/model.jar[copy]Copying10filesto/private/var/folders/.../working/scenario.rs 14NICKCOLLIER,JONATHANOZIK-REPASTDEVELOPMENTTEAM Figure10.HostsPanelForRun[move]Moving1fileto/private/var/folders/.../working/scenario.rs[jar]Buildingjar:JZombies_Demo/output/complete_model.jar[echo]Completedbuildingmodelarchive.Thearchivepayloadisthencopiedtothelocalandremotehosts.Theprocesshereisthataziparchiveiscreatedcontainingthearchivepayloadaswellassomeadditionalcon gurationdata.Thisziparchiveisnamedwiththeusernamefollowedbythehosttogetherwithatimestamp(e.g.nick localhost4106394375716993975.zip).Inthecaseofalocalhost,theziparchiveiscopiedtoalocaltemporarydirectorywhosenamebeginswithsimphony model followedbyatimestamp(e.g.simphony model 1368219324898).INFO[SwingWorker-pool-1-thread-2]16:56:26,990repast.simphony.batch.ssh.LocalSession-Copyinglocally/var/folders/.../nick_localhost4106394375716993975.zipto/var/folders/.../simphony_model_1368219324898INFO[SwingWorker-pool-1-thread-2]16:56:27,411repast.simphony.batch.ssh.LocalSession-CopyingFinished.Theremotehostworkssimilarly.Theziparchiveiscopiedtoasimphony model plustimestampdirectoryontheremotehost.Inthiscase,theziparchiveisnamedubuntu ec2-107-20-23-221.compute-1.amazonaws.com8807870753490178805.zipandtheremotedirec-toryis/simphony model 1368219324898/.INFO[SwingWorker-pool-1-thread-2]16:56:09,829 16NICKCOLLIER,JONATHANOZIK-REPASTDEVELOPMENTTEAMPolledsimphony_model_1368219324898onec2-107-20-23-221.compute-1.amazonaws.comforDONE:yesINFO[pool-3-thread-1]16:56:52,796repast.simphony.batch.ssh.RemoteDonePoller-Polledsimphony_model_1368219324898onXXX.XXX.XXX.XXXforDONE:yesIftherewaserrorduringtherun,thatshouldbereportedhereaspartofthepolling.Assumingtherewasn'tthenthelocalandremoteoutputiscopiedandconcatenatedintotheoutputdirectorythatwasspeci edintheGUI.INFO[SwingWorker-pool-1-thread-2]16:56:55,630repast.simphony.batch.ssh.RemoteSession-Findingandcopyingremoteoutputfromsshtesting@XXX.XXX.XXX.XXX:simphony_model_1368219324898to/var/folders/.../sshtesting_XXX.XXX.XXX.XXXINFO[SwingWorker-pool-1-thread-2]16:56:58,412repast.simphony.batch.ssh.RemoteSession-Findingandcopyingremoteoutputfromubuntu@ec2-107-20-23-221.compute-1.amazonaws.com:simphony_model_1368219324898to/var/folders/.../ubuntu_ec2-107-20-23-221.compute-1.amazonaws.comINFO[SwingWorker-pool-1-thread-2]16:57:00,247repast.simphony.batch.ssh.LocalSession-Findingoutputonlocalhostin/var/folders/.../simphony_model_1368219324898INFO[SwingWorker-pool-1-thread-2]16:57:00,266repast.simphony.batch.ssh.SessionsDriver-AggregatingoutputintoJZombies_Demo/outputINFO[SwingWorker-pool-1-thread-2]16:57:00,267repast.simphony.batch.ssh.SessionsDriver-Finished.ElapsedTime:1.5906 Figure11.PassphraseDialog REPASTSIMPHONYBATCHRUNSGETTINGSTARTED176.RemoteMachineSetupInordertoperformarunonaremotemachinethatmachinemustbesetuptoacceptansshconnectionandyoumusthaveanaccountontheremotemachine.Oncethere-motemachinehasbeensetupforsshlogins,youthenneedtoaddyourpublickeytoitsauthorized keys leasdescribedinsection2.3.2.TheremotemachinemusthaveJava7installedanditmustbebethedefaultJava.6.1.OSX.AllowingremoteloginsonOSXisdoneusingtheSystemPreferencesonthemachineyouwanttoremotelyloginto.StartSystemPreferencesanddoubleclickonthesharingicon.SelecttheRemoteLoginasseenin gure12.Makesureyouallowaccessfortheuseryouwillbelogginginas.Youshouldnowbeabletosshintotheremotemachineandcopyyourpublickeystotheserverasdescribedinlinksgiveninsection2.3.2. Figure12.EnablingSSHDonOSX6.2.Linux/Unix.ChancesareiftheremotemachineisrunningLinuxoranotherUnixvariantitisalreadysetuptoallowsshlogins.Ifnot,followyourdistributionsinstructionsforturningonthesshdservice.Youshouldnowbeabletosshintotheremotemachineandcopyyourpublickeystotheserverasdescribedinsection2.3.2. REPASTSIMPHONYBATCHRUNSGETTINGSTARTED23Wehavecoveredthe rstoftheseinsection2.Theremainingtwoallowyoutolaunchthecon gurationGUIandthusbatchrunswithoutlaunchingtherepastruntime.7.1.LaunchingfromEclipse.TolaunchthebatchGUIfromtheeclipselauncher,openthelaunchersfolderinyourmodel'seclipseprojectandrightclickonthelaunch lethatbeginswith\Batch"( g20).Select\RunAs"fromthepopupmenuandthentheBatchmodelentry.ThiswilllaunchthebatchGUIandloadtheselectedmodelintoit.NotethatwhenrunningviathelaunchersomeoftheoutputthatwouldnormallybeintheBatchRunGUIConsolewillshowupinEclipse'sconsole. Figure20.EclipseLauncherforBatchRunGUI7.2.LaunchingasaStandaloneApplication.TolaunchthebatchGUIasastandaloneapplicationnavigatetowhereRepastSimphonyisinstalled.Doubleclickthebatch runner.jar.8.RunningonaClusterorHPCMachineItisalsopossibletoperformbatchrunsonaclusterorahighperformancecomputing(HPC)typemachine.Suchmachinearecomposedofmanyprocessorseachofwhichcanrunoneormorebatchruninstancesandallofwhichhaveaccesstoashared lesystem.Cluster/HPCrunswillusethepayloadarchiveproducedbytheGUIbutarenotthemselvesrunviatheGUI.Thesebatchrunswillusethejobsubmissionparadigmthatisstandardonthesetypesofmachines.The rststepforrunningamodelonanHPCmachineistocopythepayloadcom-plete model.jartotheremotemachine.Thepayloadislocatedinthemodel'soutputdirectoryandcanbecreatedusingtheBatchCon gurationGUIwiththecreatearchivebutton( ).Thetransferisoftendoneviascporsimilarsecurecopymethods.Aftercopyingthepayloadtothedesiredlocation,thenextstepistounzipthepayload:unzipcomplete_model.jar

Related Contents


Next Show more