www OASUS ca Grid The Evolution from Parallel

  • Slides: 61
Download presentation
www. OASUS. ca Grid The Evolution from Parallel Processing to Modern Day Computing Greg

www. OASUS. ca Grid The Evolution from Parallel Processing to Modern Day Computing Greg Mc. Lean Vecdet Mehmet-Ali

Agenda www. OASUS. ca v. Introduction to Parallel Processing §SAS/CONNECT §MP/CONNECT (example) v. Grid

Agenda www. OASUS. ca v. Introduction to Parallel Processing §SAS/CONNECT §MP/CONNECT (example) v. Grid Computing §Type of Grids §Why and When to Use Grid §Early Findings §Grid Components v. Considerations When using SAS Grid v. Questions / Comments

Introduction to Parallel Processing www. OASUS. ca Illustration Unsorted Deck Sorted Deck

Introduction to Parallel Processing www. OASUS. ca Illustration Unsorted Deck Sorted Deck

Introduction to Parallel Processing www. OASUS. ca Illustration Unsorted Deck Sorted Deck

Introduction to Parallel Processing www. OASUS. ca Illustration Unsorted Deck Sorted Deck

Introduction to Parallel Processing www. OASUS. ca Unsorted Deck Sorted Deck 1 Minute 30

Introduction to Parallel Processing www. OASUS. ca Unsorted Deck Sorted Deck 1 Minute 30 Seconds Standard Approach

www. OASUS. ca Introduction to Parallel Processing Unsorted Deck Sorted Deck 45 Seconds Parallel

www. OASUS. ca Introduction to Parallel Processing Unsorted Deck Sorted Deck 45 Seconds Parallel Approach

www. OASUS. ca Introduction to Parallel Processing Card Experiment vs. Parallel / Grid Computing

www. OASUS. ca Introduction to Parallel Processing Card Experiment vs. Parallel / Grid Computing v. Parallel Processing Can Reduce Elapsed Time v“Pipeline Parallelism” Can Reduce Elapsed Time Even Further v. Optimal Number of Processes Can Reduce Elapsed Time v. Some “Processors” Are Faster Than Others v. Data / Software Preparation Is Almost Always Required

SAS/CONNECT www. OASUS. ca Machine X i M a c Data

SAS/CONNECT www. OASUS. ca Machine X i M a c Data

SAS/CONNECT www. OASUS. ca %LET server=F 8 DEV 01; OPTIONS REMOTE=server; SIGNON; RSUBMIT; data

SAS/CONNECT www. OASUS. ca %LET server=F 8 DEV 01; OPTIONS REMOTE=server; SIGNON; RSUBMIT; data work. test; A = 10; run; ENDRSUBMIT; SIGNOFF;

SAS/CONNECT (Pre SAS Version 8) www. OASUS. ca Synchronous Processing i. M ac

SAS/CONNECT (Pre SAS Version 8) www. OASUS. ca Synchronous Processing i. M ac

SAS/CONNECT www. OASUS. ca (Pre SAS Version 8) LIBNAME IN ‘\Server 1Input’; LIBNAME OUT

SAS/CONNECT www. OASUS. ca (Pre SAS Version 8) LIBNAME IN ‘\Server 1Input’; LIBNAME OUT ‘\Server 1Output’; PROC SORT DATA=IN. DATA 1; BY KEY; RUN; PROC SORT DATA=IN. DATA 2; BY KEY; RUN; DATA OUT. FINAL; MERGE IN. DATA 1 IN. DATA 2; BY KEY; RUN;

SAS/CONNECT www. OASUS. ca Sort Data 1 Sort Data 2 (Pre SAS Version 8)

SAS/CONNECT www. OASUS. ca Sort Data 1 Sort Data 2 (Pre SAS Version 8) Sort Data 1 Sort Data 2 Merge Both i M Merge Both a c Results

SAS/CONNECT www. OASUS. ca (Starting In SAS Version 8) Asynchronous Processing i. M ac

SAS/CONNECT www. OASUS. ca (Starting In SAS Version 8) Asynchronous Processing i. M ac i M ac MP/CONNECT

SAS/CONNECT www. OASUS. ca (Starting In SAS Version 8) LIBNAME IN ‘\Server 1Input’; LIBNAME

SAS/CONNECT www. OASUS. ca (Starting In SAS Version 8) LIBNAME IN ‘\Server 1Input’; LIBNAME OUT ‘\Server 1Output’; PROC SORT DATA=IN. DATA 1; BY KEY; RUN; PROC SORT DATA=IN. DATA 2; BY KEY; RUN; DATA OUT. FINAL; MERGE IN. DATA 1 IN. DATA 2; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; PROC SORT DATA=IN. DATA 1; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; PROC SORT DATA=IN. DATA 2; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; LIBNAME OUT ‘\Server 1Output’; DATA OUT. FINAL; MERGE IN. DATA 1 IN. DATA 2; BY KEY; RUN; 14

MP/CONNECT www. OASUS. ca Sort Data 1 i. M ac Merge Both Sort Data

MP/CONNECT www. OASUS. ca Sort Data 1 i. M ac Merge Both Sort Data 2 i. M ac Sort Results Sort Data 2 Merge Both Sort Results i. M ac Results

MP/CONNECT www. OASUS. ca /****** SORT DATA 1 ******/ %LET remote 1=F 8 DEV

MP/CONNECT www. OASUS. ca /****** SORT DATA 1 ******/ %LET remote 1=F 8 DEV 01; OPTIONS AUTOSIGNON=YES; RSUBMIT PROCESS=remote 1 WAIT=NO; LIBNAME data 1 "\F 8 DEV 01PFM-SystemTools"; proc sort data=data 1; by city; run; ENDRSUBMIT; /****** SORT DATA 2 ******/ %LET remote 2=F 8 TEST 01; OPTIONS AUTOSIGNON=YES; RSUBMIT PROCESS=remote 2 WAIT=NO; LIBNAME data 2 "\F 8 DEV 01PFM-SystemTools"; proc sort data=data 2; by city; run; ENDRSUBMIT;

MP/CONNECT www. OASUS. ca WAITFOR _all_ remote 1 remote 2 /****** MERGE DATA 1

MP/CONNECT www. OASUS. ca WAITFOR _all_ remote 1 remote 2 /****** MERGE DATA 1 & DATA 2 ******/ %LET remote 3=F 8 PROD 01; OPTIONS AUTOSIGNON=YES; RSUBMIT PROCESS=remote 3; LIBNAME both "\F 8 DEV 01PFM-SystemTools"; data both. sorted; merge both. data 1 both. data 2; by city; run; ENDRSUBMIT;

Grid Computing www. OASUS. ca “A parallel processing architecture in which computer resources are

Grid Computing www. OASUS. ca “A parallel processing architecture in which computer resources are shared across a network and all machines function as one large supercomputer. ”

Grid Computing www. OASUS. ca v. Utility Grid §Multiple users that require processing §Multiple

Grid Computing www. OASUS. ca v. Utility Grid §Multiple users that require processing §Multiple machines available to process §Dynamic allocation of process to available machine v. Compute Grid §Task that can be decomposed into sub-units §Sub-units dynamically allocated to available machines §Sub-units able to run in parallel

Grid Computing www. OASUS. ca Why Use v. Budget constraints v. Higher volume of

Grid Computing www. OASUS. ca Why Use v. Budget constraints v. Higher volume of Data v. Tighter processing schedules v. Idle processing power of existing hardware v. Centrally Managed Hardware & Infrastructure

Grid Computing www. OASUS. ca When To Use v. Applications requiring hours / days

Grid Computing www. OASUS. ca When To Use v. Applications requiring hours / days to process v. Applications that are more processing intensive v. Applications that can be decomposed into sub-tasks

Grid Computing www. OASUS. ca Early Findings Case 1 v. Optimization in a grid

Grid Computing www. OASUS. ca Early Findings Case 1 v. Optimization in a grid of PC Laptops v 60 laptops (266 - 400 Mhz) v 600 Sales Territories Total Elapsed Time 92% Improvement 87% Improvement

Grid Computing www. OASUS. ca Early Findings Case 2 – NIEHS - Heterogeneous Grid

Grid Computing www. OASUS. ca Early Findings Case 2 – NIEHS - Heterogeneous Grid v 100 nodes running mixture of W 2 K, WXP, variety of Unix OS’s v. Combination of SAS v 8 and SAS v 9 on nodes Total Elapsed Time 99% Improvement

ct ur e ® s Da am og r st ru Pr fra ®

ct ur e ® s Da am og r st ru Pr fra ® In S rid SA G Grid Controller / Manager www. OASUS. ca ta Grid Computing SAS Grid Solution

Grid Computing Grid Infrastructure www. OASUS. ca v. SASCONNECT® i M ac i. M

Grid Computing Grid Infrastructure www. OASUS. ca v. SASCONNECT® i M ac i. M ac Asynchronous Connections v. SASMPCONNECT®

Grid Computing www. OASUS. ca Grid Controller / Manager (Then)

Grid Computing www. OASUS. ca Grid Controller / Manager (Then)

Grid Computing www. OASUS. ca Grid Controller / Manager (Then)

Grid Computing www. OASUS. ca Grid Controller / Manager (Then)

Grid Computing www. OASUS. ca Grid Controller / Manager (Now)

Grid Computing www. OASUS. ca Grid Controller / Manager (Now)

Grid Computing ® www. OASUS. ca SAS ProgramsData (Then & Now) LIBNAME IN ‘\Server

Grid Computing ® www. OASUS. ca SAS ProgramsData (Then & Now) LIBNAME IN ‘\Server 1Input’; LIBNAME OUT ‘\Server 1Output’; PROC SORT DATA=IN. DATA 1; BY KEY; RUN; PROC SORT DATA=IN. DATA 2; BY KEY; RUN; DATA OUT. FINAL; MERGE IN. DATA 1 IN. DATA 2; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; PROC SORT DATA=IN. DATA 1; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; PROC SORT DATA=IN. DATA 2; BY KEY; RUN; LIBNAME IN ‘\Server 1Input’; LIBNAME OUT ‘\Server 1Output’; DATA OUT. FINAL; MERGE IN. DATA 1 IN. DATA 2; BY KEY; RUN;

Considerations When Using SAS Grid www. OASUS. ca Vecdet Mehmet-Ali SAS Grid Now @

Considerations When Using SAS Grid www. OASUS. ca Vecdet Mehmet-Ali SAS Grid Now @ Statistics Canada!

www. OASUS. ca From Dream to Reality – Introducing the SAS Grid v Presented

www. OASUS. ca From Dream to Reality – Introducing the SAS Grid v Presented to: Informatics Branch v May 6, 2014 Yves De. Guire Section Chief SAS Technology Center System Engineering Division Statistics Canada

www. OASUS. ca What is Grid Computing? • Emerged in the academic research community

www. OASUS. ca What is Grid Computing? • Emerged in the academic research community with 2 primary goals: • Reduce overall elapsed processing time • Leverage commodity hardware • • Became mainstream with the SETI@Home project Today: a sophisticated computer infrastructure for the Enterprise with scalability, load balancing and high availability.

www. OASUS. ca Use Case #3: Parallel Processing v Long running jobs broken into

www. OASUS. ca Use Case #3: Parallel Processing v Long running jobs broken into smaller tasks and dispatched to the grid. v Likely submitted as a batch job. v SAS programs must be modified first using MP Connect directives: v Manually v or Using SAS SCAPROC v Another option: the SAS Data Integration loop transformation v The easiest: directly from EG process flow! v Myth: a SAS program will execute in parallel without any modifications!

www. OASUS. ca Parallel Processing & Grid Computing with SAS

www. OASUS. ca Parallel Processing & Grid Computing with SAS

G-Tab www. OASUS. ca (Generalized Tabulation System) v. Input: – Table specifications(xml) – Micro

G-Tab www. OASUS. ca (Generalized Tabulation System) v. Input: – Table specifications(xml) – Micro Data

G-Tab www. OASUS. ca (Generalized Tabulation System) Xml file G-Tab Input data Tabulated Output

G-Tab www. OASUS. ca (Generalized Tabulation System) Xml file G-Tab Input data Tabulated Output

G-Tab www. OASUS. ca (Generalized Tabulation System) v Table specifications(xml) q q q Domain

G-Tab www. OASUS. ca (Generalized Tabulation System) v Table specifications(xml) q q q Domain variable list (Ex: Region, Province, Age. Group, Sex, etc. ) Analysis variable list (Ex: (Income, Expense, etc. ) Weight variable (Ex: SWeight) Bootstrap weight variable specification (Ex: BSW 1 -BSW 1000) Statistics: • Level-1: (MEAN, MAX, MIN, SUM, N, SUMWGT, MEDIAN, P 1, P 5, . . , P 99) – Calculated by PROC MEANS on Micro Data • Level-2: (GINI, GEOMEAN) – Calculated by special algorithm on Micro Data • Level-3: (DISTRIBUTION, PROPORTION, RATIO) – Calculated by using the results of Level-1 statistics – Example (RATIO): MEAN(Income) / MEAN(Expense)

G-Tab www. OASUS. ca (Generalized Tabulation System) v Precision Measures (Bootstrap Variance Method) q

G-Tab www. OASUS. ca (Generalized Tabulation System) v Precision Measures (Bootstrap Variance Method) q VAR (Variance) q STD (Standard Deviation) q CV (Coefficient of Variation) q CILB (Confidence Interval Lower Bound) q CIUB (Confidence Interval Upper Bound) q QI (Quality Indicator)

G-Tab (Sequential Processing) www. OASUS. ca Process Flow Level-1 Level-2 Level-3 Precision Measures

G-Tab (Sequential Processing) www. OASUS. ca Process Flow Level-1 Level-2 Level-3 Precision Measures

G-Tab (Sequential Processing) www. OASUS. ca Data Flow Level-1 Statistics Input data Level-2 GINI

G-Tab (Sequential Processing) www. OASUS. ca Data Flow Level-1 Statistics Input data Level-2 GINI Level-2 GEOMEAN Level-3 Statistics Precision Measures

www. OASUS. ca Considerations for Parallel Processing v Can your job be divided into

www. OASUS. ca Considerations for Parallel Processing v Can your job be divided into independent tasks? § Many SAS programs contain modules that are independent. § On a single server these tasks are performed sequentially. § On the Grid they can be processed in parallel sessions. v Identify dependent and independent tasks § A task is dependent if it requires output from another task v Finally consider the length of time required to process each task. § If the tasks are short and take little time to process, you might not be able to offset the time required to start up multiple Grid sessions.

G-Tab (Task Dependency) www. OASUS. ca Data Flow Level-1 Statistics Input data Level-2 GINI

G-Tab (Task Dependency) www. OASUS. ca Data Flow Level-1 Statistics Input data Level-2 GINI Level-2 GEOMEAN Level-3 Statistics Precision Measures

G-Tab Processing on the Grid www. OASUS. ca G-Tab Level-1 Statistics Level-2 Gini split

G-Tab Processing on the Grid www. OASUS. ca G-Tab Level-1 Statistics Level-2 Gini split Partial result Grid node Partial result Precision Measures Level-2 Geo. Mean Input Data Grid node Level-3 Statistics Grid node Partial result Final Result

G-Tab Level-1 Statistics www. OASUS. ca G-Tab split Input Data Level-1 Statistics Grid node

G-Tab Level-1 Statistics www. OASUS. ca G-Tab split Input Data Level-1 Statistics Grid node Partial result Precision Measures

G-Tab www. OASUS. ca (Generalized Tabulation System) v Table specifications(xml) q q q Domain

G-Tab www. OASUS. ca (Generalized Tabulation System) v Table specifications(xml) q q q Domain variable list (Ex: Region, Province, Age. Group, Sex, etc. ) Analysis variable list (Ex: (Income, Expense, etc. ) Weight variable (Ex: SWeight) Bootstrap weight variable specification (Ex: BSW 1 -BSW 1000) Statistics: • Level-1: (MEAN, MAX, MIN, SUM, N, SUMWGT, MEDIAN, P 1, P 5, . . , P 99) – Calculated by PROC MEANS on Micro Data • Level-2: (GINI, GEOMEAN) – Calculated by special algorithm on Micro Data • Level-3: (DISTRIBUTION, PROPORTION, RATIO) – Calculated from the results of Level-1 statistics – Example (RATIO): MEAN(Income) / MEAN(Expense)

G-Tab Sample Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW

G-Tab Sample Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW 1 BSW 2 … … BSW 1000

G-Tab www. OASUS. ca Level-1 Statistics Proc means data=. . noprint; Class province agegroup

G-Tab www. OASUS. ca Level-1 Statistics Proc means data=. . noprint; Class province agegroup sex; Var income / sweight; /* (BSW 1 – BSW 1000) */ Output out=. . Mean= ; Run; v Repetitive task v Split data for parallel processing

Level-1 Statistics Sub-task(1) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight

Level-1 Statistics Sub-task(1) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW 1 BSW 2 … … BSW 250

Level-1 Statistics Sub-task(2) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight

Level-1 Statistics Sub-task(2) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW 251 BSW 252 … … BSW 500

Level-1 Statistics Sub-task(3) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight

Level-1 Statistics Sub-task(3) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW 501 BSW 502 … … BSW 750

Level-1 Statistics Sub-task(4) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight

Level-1 Statistics Sub-task(4) Input Data www. OASUS. ca Province Age. Group Sex Income SWeight BSW 751 BSW 752 … … BSW 1000

Level-1 Statistics Sub-task(1) Results www. OASUS. ca Province Age. Group Sex Income_Mean Income 1_Mean

Level-1 Statistics Sub-task(1) Results www. OASUS. ca Province Age. Group Sex Income_Mean Income 1_Mean Income 2_Mean … Income 250_Mean

Level-1 Statistics Sub-task(2) Results www. OASUS. ca Province Age. Group Sex Income 251_Mean Income

Level-1 Statistics Sub-task(2) Results www. OASUS. ca Province Age. Group Sex Income 251_Mean Income 252_Mean … Income 500_Mean

Level-1 Statistics Sub-task(3) Results www. OASUS. ca Province Age. Group Sex Income 501_Mean Income

Level-1 Statistics Sub-task(3) Results www. OASUS. ca Province Age. Group Sex Income 501_Mean Income 502_Mean … Income 750_Mean

Level-1 Statistics Sub-task(4) Results www. OASUS. ca Province Age. Group Sex Income 751_Mean Income

Level-1 Statistics Sub-task(4) Results www. OASUS. ca Province Age. Group Sex Income 751_Mean Income 752_Mean … Income 1000_Mean

Level-1 Statistics Results www. OASUS. ca Province Age. Group Sex Income_Mean Income 1_Mean Income

Level-1 Statistics Results www. OASUS. ca Province Age. Group Sex Income_Mean Income 1_Mean Income 2_Mean … Income 1000_Mean

G-Tab Parallel Processing www. OASUS. ca G-Tab Level-1 SWeight BSW 1 -BSW 250 split

G-Tab Parallel Processing www. OASUS. ca G-Tab Level-1 SWeight BSW 1 -BSW 250 split Level-1 BSW 251 -BSW 500 Level-1 BSW 751 -BSW 1000 Partial result Grid node Partial result Level-1 Results Level-1 BSW 501 -BSW 750 Input Data Grid node Partial result

www. OASUS. ca G-Tab Precision Measures Let Y be the statistic to be considered.

www. OASUS. ca G-Tab Precision Measures Let Y be the statistic to be considered. For example Ŷ can be a mean, a median, a sum, etc. The variance of Ŷ is given by: Where Ŷj is the statistic calculated using the jth Bootstrap weight, B is the number of Bootstrap weights, Ŷ is the estimate produced using the Survey weight. Standard Deviation: Coefficient of Variation: Quality Indicator of the statistic is set based on the above calculations.

www. OASUS. ca Notes In the example: v The input data was sliced vertically

www. OASUS. ca Notes In the example: v The input data was sliced vertically into 4. v This gave the BEST elapsed processing time for average surveys. v Slicing it into 5 sessions(200 BSW each) took longer to run. v For bigger volume, 5 sessions could give better results. Other Considerations: v Slice the input data horizontally § Time cycles Warning: Maintain data integrity

www. OASUS. ca Conclusion v Grid is a sophisticated computer infrastructure for the Enterprise

www. OASUS. ca Conclusion v Grid is a sophisticated computer infrastructure for the Enterprise with scalability, load balancing and high availability. v A SAS program will NOT execute in parallel without any modifications! § It must be modified first using MP Connect directives to run in parallel. v Long running jobs should be broken into smaller tasks and dispatched to the grid. v Parallel processing will reduce the overall elapsed processing time. The Future Of Grid Computing Is Now Here!

Questions / Comments www. OASUS. ca Greg Mc. Lean Vecdet Mehmet-Ali Project Leader System

Questions / Comments www. OASUS. ca Greg Mc. Lean Vecdet Mehmet-Ali Project Leader System Engineering Division Statistics Canada Jean Talon Building 5 th Floor Section A 6 170, Tunney’s Pasture driveway Ottawa, Ont. , K 1 A 0 T 6 Project Leader System Engineering Division Statistics Canada Jean Talon Building 5 th Floor Section A 2 170, Tunney’s Pasture driveway Ottawa, Ont. , K 1 A 0 T 6 (613) 951 -2390 Greg. Mc. Lean@statcan. gc. ca Vecdet. Mehmet-Ali@statcan. gc. ca