Data Locality On Shared Memory Computers Under Two Programming Models

DataLo calityOnSharedMemoryComputersUnderTwoProgrammingMo delsTonA. NgoLawrence SnyderDept.ofComputer Science and EngineeringUniversity ofWashingtonSeattle, WA98195AbstractData locality is a wel l-reognized rquirement for the development of any paral lel application, but the emphasis ondatalocalityvaries withtheprogramming model.Inthis paper,we examinetwomodelsatextreme endsofthe spectrumwith respct to onegeneral class of paral lel machines.Wepresent experiments onshard-memorymachines that indicate that programs written in the nonshared-memory pramming model general ly o er betterdatalocality andthusbetterperformance.WestudytheLUdeompositionproblemandaMolecular Dynamicssimulationon veshared-memorymachineswithwidelydi eringarchitectures,andanalyzethee ectofprogramming models on data locality.The comparison is done through a simple analytical model and measurementson the machines.1Intro ductionBecause of the wide variety of parallel machines, p erhaps the single most imp ortant issue in the development ofparallel software is program p ortability. Such variety exists b ecause given the current technology, no single archi-tecture can claim a clear sup eriority:while bus-based machines o er shared-memory eciently and economically,large scale machines are only viable with nonshared-memory. On the other hand, the intermediate range consistsof b oth shared and nonshared-memory machines.Ap ortableprogrambyde nitioncanexecutecorrectlyonanewmachinewithlittleprogramming e ort.However,suchrequirementsarenotsucient.Tob emeaningful, ap ortableprogram mustalsop erformellacrossthe sp ectrumof machines:theprogram must not only run,but must also run well.To achieve scalablep erformance in a parallel program, a critical factor is data lo cality.Although lo cality may have little e ectona small scale machine that presentsa uniform accesstime to all memory, it can b e critical on intermediate andlarge scale machines which by necessity have distributed memory with di erent access latencies.Thememorymo delintrinsictoaparallellanguagehasgreatinuenceonthep erformanceofprogramswritten in this language b ecauseit dictates how thedata lo cality that exists in the algorithm can b e exploitedon a parallel machine.While exploiting data lo cality can b e done at many di erent levels, this pap er fo cuses onhow programming mo dels a ect the p erformance of parallel programs through data lo cality.One'sinterestthee ectsofdatalo cality will likelydi erdep endingonwhetheroneispredisp osedtoasharedoranonsharedmemory mo del ofparallel computation.From thememory mo delviewp oint,programmer might ask, \How much is lost by ignoring lo cality? "Here the assumption is that although physical(sharedmemory) machines presentasharedmemory totheuser,mechanisms thathidefactthatmemory is actually distributed di erin their p erformance.When they work well, thereshould b eno loss, andwhen they work p o orly, the loss will b e reected by the degree to which the nonlo cal data referencescould haveb eenmade lo cal had lo cality not b eenignored.Conversely,from thenonsharedmemory mo del viewp oint onemight wonder, \How much is lost from the overhead intro duced to exploit lo cality? " Here the assumption is thatto exploit lo cality, the program p erforms explicit data movement op erations, e.g.sends and receives, that incurcostssuchas bu ermanagement which do notexistin a truly sharedmemory architecture.Theb ene tsof a