SCSUG-2017 SAS Grid Job Search Performance Piyush Singh, Ghiyasuddin Mohammed Faraz Khan, Prasoon Sangwan TATA Consultancy Services Ltd.

Similar documents
SASGSUB for Job Workflow and SAS Log Files Piyush Singh, Prasoon Sangwan TATA Consultancy Services Ltd. Indianapolis, IN

Key Reasons for SAS Data Set Size Difference by SAS Grid Migration Prasoon Sangwan, Piyush Singh, Tanuj Gupta TATA Consultancy Services Ltd.

Key Requirements for SAS Grid Users Paper

Effective Usage of SAS Enterprise Guide in a SAS 9.4 Grid Manager Environment

Best Practice for Creation and Maintenance of a SAS Infrastructure

Parallelizing Windows Operating System Services Job Flows

SAS Certified Deployment and Implementation Specialist for SAS Grid Manager 9.4

Enhancing SAS Piping Through Dynamic Port Allocation

Cheat sheet: Data Processing Optimization - for Pharma Analysts & Statisticians

Release Notes for Platform Process Manager. Platform Process Manager Version 8.2 May 2012

Guide Users along Information Pathways and Surf through the Data

BI-09 Using Enterprise Guide Effectively Tom Miron, Systems Seminar Consultants, Madison, WI

Introduction Into Linux Lecture 1 Johannes Werner WS 2017

SAS ENTERPRISE GUIDE USER INTERFACE

Upgrading Platform LSF on UNIX

Life Cycle of SAS Intelligence Platform Project

Improving Your Relationship with SAS Enterprise Guide Jennifer Bjurstrom, SAS Institute Inc.

SAS Studio: A New Way to Program in SAS

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

Grid Computing in SAS 9.4

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Useful Tips When Deploying SAS Code in a Production Environment

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Scheduling in SAS 9.4, Second Edition

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

JMP and SAS : One Completes The Other! Philip Brown, Predictum Inc, Potomac, MD! Wayne Levin, Predictum Inc, Toronto, ON!

SESUG Paper SD ETL Load performance benchmarking using different load transformations in SAS Data Integration Studio.

High-availability services in enterprise environment with SAS Grid Manager

Introduction To. Barry Grant

Part 1: Basic Commands/U3li3es

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ

Grid Computing in SAS 9.2. Second Edition

Using Data Transfer Services

SAS System Powers Web Measurement Solution at U S WEST

Siemens PLM Software. HEEDS MDO Setting up a Windows-to- Linux Compute Resource.

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Business Insight Authoring

SAS Data Integration Studio 3.3. User s Guide

Jet Data Manager 2014 SR2 Product Enhancements

The Unix Shell & Shell Scripts

Interface Reference topics

Table of Contents. User Manual

Antraff traffic analysis software User Manual

SAS Scalable Performance Data Server 4.3

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

A Linux Shell Script to Automatically Compare Results of Statistical Analyses

Lasso Your Business Users by Designing Information Pathways to Optimize Standardized Reporting in SAS Visual Analytics

Perceptive Process Enterprise - UNIX Installation Guide

Release Notes for Platform Process Manager. Platform Process Manager Version 8.1 January 2011 Last modified: January 2011

Administration guide. PRISMAdirect Configuration

Moving You Forward A first look at the New FileBound 6.5.2

Hands-Off SAS Administration Using Batch Tools to Make Your Life Easier

M2PGER FORTRAN programming. General introduction. Virginie DURAND and Jean VIRIEUX 10/13/2013 M2PGER - ALGORITHME SCIENTIFIQUE

Alan Davies and Sarah Perry

OLAP Drill-through Table Considerations

Are Your SAS Programs Running You? Marje Fecht, Prowerk Consulting, Cape Coral, FL Larry Stewart, SAS Institute Inc., Cary, NC

Wonderful Unix SAS Scripts: SAS Quickies for Dummies Raoul Bernal, Amgen Inc., Thousand Oaks, CA

Release Notes

BASH SHELL SCRIPT 1- Introduction to Shell

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT

SAS IT Resource Management Forecasting. Setup Specification Document. A SAS White Paper

Fixed Bugs for IBM Spectrum LSF Version 10.1 Fix Pack 1

CS160A EXERCISES-FILTERS2 Boyd

UNIX Shell Programming

SAS Environment Manager A SAS Viya Administrator s Swiss Army Knife

WKn Chapter. Note to UNIX and OS/390 Users. Import/Export Facility CHAPTER 9

Fixed Bugs for IBM Platform LSF Version

Asset Management Migration Guide

UMass High Performance Computing Center

Network Administration/System Administration (NTU CSIE, Spring 2018) Homework #1. Homework #1

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

SAS AIX. Please Read Before Beginning Installation

SAS Federation Server 4.2: Migration Guide

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Batch Systems. Running calculations on HPC resources

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Automatic Detection of Section Membership for SAS Conference Paper Abstract Submissions: A Case Study

SAS/Warehouse Administrator Usage and Enhancements Terry Lewis, SAS Institute Inc., Cary, NC

Scheduling in SAS 9.2

EECS2301. Lab 1 Winter 2016

Tips and Tricks for Organizing and Administering Metadata

Using the SQL Editor. Overview CHAPTER 11

Microsoft Office SharePoint Server 2007 with EBS Best Practices Guide

SAS Grid Manager and Kerberos Authentication

EG 4.1. PC-SAS users. for. I C T EG 4.1 for PC-SAS Users. Thursday - May 7 th, 2009

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA

Transformer Looping Functions for Pivoting the data :

Oracle Financial Consolidation and Close Cloud

Paper William E Benjamin Jr, Owl Computer Consultancy, LLC

Going Under the Hood: How Does the Macro Processor Really Work?

Chapter-3. Introduction to Unix: Fundamental Commands

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

sottotitolo A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi

2012 Microsoft Corporation. All rights reserved. Microsoft, Active Directory, Excel, Lync, Outlook, SharePoint, Silverlight, SQL Server, Windows,

Informatica Developer Tips for Troubleshooting Common Issues PowerCenter 8 Standard Edition. Eugene Gonzalez Support Enablement Manager, Informatica

My SAS Grid Scheduler

I KNOW HOW TO PROGRAM IN SAS HOW DO I NAVIGATE SAS ENTERPRISE GUIDE?

New Features Guide Sybase ETL 4.9

Transcription:

SCSUG-2017 SAS Grid Job Search Performance Piyush Singh, Ghiyasuddin Mohammed Faraz Khan, Prasoon Sangwan TATA Consultancy Services Ltd. ABSTRACT Have you ever tried to find the job execution information in SAS Grid? Though, you can use SASGSUB to check the job status but if you really need detailed information then you can use LSF command bacct. It provides the detailed information about total job execution but it is quiet slow and usually takes around 15 sec or more to search for jobs executed by a single user. If Grid platform has more than 100 users, which is quiet common in any medium to big sized organization, then bacct may take more than 25 minutes (100*15 sec) to list jobs for all users. If there are around 500 to 1000 users, then bacct may take hours to bring the list of executed jobs. This paper explains the method to extract the job execution reports (or job search performance) for 1000s of users in just few minutes. It also explains how we can automate the entire process and we can create different kind of reports in a few minutes. INTRODUCTION SAS Grid Job Execution Information can be retrieved by using the LSF command bacct. This command provides the standard statistics of all the jobs executed by a single user in around 10-15 seconds. However, generating a detailed report of Job Statistics of all the users in an environment becomes a tedious task. This type of reports are generally used for business analysis and planning. This paper demonstrates a way to extract the grid usage report in a time efficient manner.. WHAT IS BACCT COMMAND AND HOW DOES IT WORK? By default, LSF stores the job execution information in /LSB_SHAREDIR/cluster_name/logdir/lsb.acct. It stores the information for each job executed on Grid. This file contains one record per job, per user with the entire job accounting information. LSB_SHAREDIR is defined in lsf.conf and cluster name is the name of the LSF cluster, as returned by lsid. A lot goes on when LSF BACCT command executes. It reads the lsb.acct file along with other lsb.events* files and depending on the command options collects them into readable format with adjusted date and time information, etc. If you go through this process even for one user at a time, for a very active user base and job submission rate, it takes 10-15sec (again based on user base and activity) to format and extract a month s account data. Consider the situation where you have thousands of active users with SAS Grid. It would take an average of 5 hours to complete. Not only this, if you run bacct for all user in such type of environment -bash-4.1$ bacct -u <user> Accounting information about jobs that are: - submitted by users student, - accounted on all projects. - completed normally or exited - executed on all hosts. - submitted to all queues. - accounted on all service classes.

--------------------------------------------------------------------------- --- SUMMARY: ( time unit: second ) Total number of done jobs: 190 Total number of exited jobs: 74 Total CPU time consumed: 12473.5 Average CPU time consumed: 47.2 Maximum CPU time of a job: 4279.0 Minimum CPU time of a job: 0.0 Total wait time in queues: 17920.0 Average wait time in queue: 67.9 Maximum wait time in queue:17177.0 Minimum wait time in queue: 0.0 Average turnaround time: 6904 (seconds/job) Maximum turnaround time: 743210 Minimum turnaround time: 0 Average hog factor of a job: 0.19 ( cpu time / turnaround time ) Maximum hog factor of a job: 1.00 Minimum hog factor of a job: 0.00 Total Run time consumed: 1801496 Average Run time consumed: 6823 Maximum Run time of a job: 743209 Minimum Run time of a job: 0 Total throughput: 0.02 (jobs/hour) during13193.62 hours Beginning time: Mar 8 14:55 Ending time: Sep 9 09:32 -bash-4.1$ Output 1. Output from a BACCT LSF Command LSB.ACCT FILE STRUCTURE LSF stores the statistics of every job in a separate line. The statistics are stored in this file in a predefined format separated by blank spaces. Empty Quotations (" ") are placed in the fields when LSF is unable to store any job field information. Each field in this file represents different attribute of job execution. Below is the sample format of lsb.acct file: "JOB_FINISH" "8.0.1" 1494959689 102 40615 33816579 1 1494959678 0 0 1494959682 "<UserId>" "normal" "<ApplicationContextServer>" "" "" "<Server Name>" "<sasconfig>/lev1/sasapp94" "" "" "" "1494959678.102" 0 1 "<Server Name>" 64 60.0 "SASGrid:4517" "<sasconfig>/lev1/sasapplicationserver/gridserver/sasgrid SASDAEMONHOST:<ServerName> SASDAEMONPORT:42887 SASCLIENTPORT:1" 0.157975 0.216967 24016 0-1 0 0 41097 0 0 0 136-1 0 0 0 1260 88-1 "" "default" 0 1 "" "" 0 3552 50236 "" "" "" "" 0 "" 0 "" -1 "" "" "" "" -1 "" "" 16 "" 1234567890 "" "" 0 0 Output 2. Sample lsb.acct File For detailed information about BACCT and each field of a record in lsb.acct file, please refer http://support.sas.com/rnd/scalability/platform/pss9.1/lsf9.1.3_config_ref.pdf documentation or contacting the SAS Technical Support.

USE LSB.ACCT TO RETRIVE THE USER S JOB As mentioned above, bacct command can be used to find job execution information in SAS Grid but this is a time consuming process. It can take hours to get the reports for all of your users. The job records in lsb.acct file contains many date/time stamp fields that each are in "Posix" format. These date/time fields are 10 digit numbers representing the number of seconds since the UNIX "epoch". Job search processing with bacct will be a lot faster if you can specify your start, end time range values in this format, and compare directly with lsb.acct file. This provides you following flexibilities: You can ignore the jobs from this file if you do not want to count like unfinished jobs. You can select the jobs (file record) if you want to see only ZERO exit code jobs. Lsb.acct file can be used as data source to create different reports based on your business need. Generally, it is advisable to be very careful when you are dealing with lsb.acct file. This contains lot of Grid information and is being used by many LSF commands. To avoid any conflict, you can first copy the file and then do your processing Each field in this file represent a different metric and each line consists of all the metrics of a separate job. Below is a sample script, which is used to extract the below metrics using the lsb.acct file. This script is supposed to calculate following metrics: 1. The total number of jobs executed by users 2. The CPU time used by different users #!/bin/bash #Section 1 lsbacct_file=<lsb_sharedir>/cluster_name/logdir/lsb.acct workloc=/top/usr/metrics userlist=/top/usr/userlist.txt starttime=1234567000 endtime=1234569000 #Section 2 cp -p $lsbacct_file $workloc/lsb.acct_bck chmod 777 $workloc/lsb.acct_bck awk '$3>'$starttime' && $3<='$endtime'' $workloc/lsb.acct_bck > $workloc/lsf_extract.txt #Section3 for var in `cat $userlist`;do finaljobs=`awk '$12 ~ /\<'$var'\>/' $workloc/lsf_extract.txt wc -l` echo -e "$var \t $finaljobs" >> $workloc/total_jobs.xls done #Section 4 cat $workloc/lsf_extract.txt awk '{print $12}' tr -d '"' > $workloc/uids cat $workloc/lsf_extract.txt awk '{n = 51; for (--n; n >= 0; n--){ printf "%s\t",$(nf-n)} print ""}' awk '{print $1, "\t" $2}' > $workloc/cputimes pr -m -t -s\ $workloc/uids $workloc/cputimes gawk '{print $1,"\t" $2, "\t" $3}' > $workloc/final.csv #Section 5

cat $workloc/final.csv awk '{print $2+$3}' > $workloc/timecal echo -e "userid \t time1 \t time2 \t cpu_tm" > $workloc/cpu_tm.xls pr -m -t -s\ $workloc/final.csv $workloc/timecal gawk '{print $1,"\t" $2, "\t" $3, "\t" $4}' >> $workloc/cpu_tm.xls #Section 6 rm $workloc/uids $workloc/cputimes $workloc/final.csv $workloc/timecal $workloc/lsb.acct_bck Sample Code 1. Script to Read lsb.acct File The above script can be modified to retrieve various metrics based on business need. The three main sections of the script are explained as below: 1. This section assigns the required variable used in the script. You can changed these variables as per your environment. lsbacct_file is the full path to lsb.acct file. workloc is a temporary working directory for script execution. Userlist is the list of users on SAS Grid. starttime and endtime are the upper and lower limits of time period for the script query. Please note that LSF stores the time statistics in POSIX/EPOCH time format. Hence, the time variable starttime and endtime need to be entered in Epoch time format. 2. This section takes a backup of the original lsb.acct file in the temporary working directory. This helps in preventing the original files from any corruption/ damage. LSB.ACCT file contains all the job records from the initial SAS Grid installation. 3. This section consolidates all the job records, calculates the total number of jobs executed by users in a new file, which can be used to create business reports. The output generate from this section of the script would be in the below format. userid finaljobs usr1 0 usr2 0 usr3 166 usr4 22 usr5 0 usr6 0 Table 1: Sample output file created from Section 3 of script 4. This section creates a subset from the original lsb.acct file which contains the jobs execited in given time duration with start and end time. Reading the required fields from job records in lsb.acct file is little difficult since jobs can be invoked on SAS Grid either by using SAS Enterprise Guide or by SASGSUB and the number of fields in a single job records depend on the client used to submit the job. This is not fixed format file so while reading you need to first read the clients used to submit the job and then read the fields for the job execution.

The section generates an excel file which contains the total CPU time used by all the per user creates the temporary files. You can write your SAS code to read the excel file and create your own report. Next topic in this paper, explains how you can create different report. userid time1 time2 cpu_tm usr1 6.324038 3.114023 9.438061 usr2 7.524111 1.624001 9.148112 usr3 0.41301 0.29302 0.70603 usr4 40.324038 6.674098 46.998136 usr5 120.415027 12.555072 132.970099 usr6 152.223137 21.053156 173.276293 Table 2: Sample Output from Section 5 5. This section deletes the temporary files created during the intermediate execution. This clean the unnecessary files once execution completed. REPORT FOR USER S GRID UTILIZATION As discussed earlier, you can create different reports once you have all the user data from lsb.acct file. If you want to create report for Grid utilization per group (defined in SAS Management Console). List of the users and corresponding group can be found from SAS Management Console. Then you can merge the data from lsb.acct and SAS management console by users/ group to group the utilization data. Above given script create the job information in excel file. You can read this file in SAS to work with the user and Group list from SAS Management Console. proc import datafile="/home/usr/cpu_tm.xlsx" out=cpu_tm dbms=xlsx replace; getnames=yes; proc sort data= cpu_tm; by userid; proc sql; create table users_cput as select userid as UserId, sum(cputime2) as Total_cputime from cpu_tm group by userid; proc export data=users_cputime outfile='/home/usr/user_cpu.xlsx' dbms=xlsx replace; Sample Code 2. SAS Code to Create Report Below is the flow chart which demonstrate, how lsb.acct file data can be merged with SAS Management Console user list. This helps you create the report for Grid utilization based on different Groups or user.

Figure 1. Caption for Sample Figure CONCLUSION This paper provides an alternative method to retrieve SAS Grid Job execution information in a much faster and time efficient manner. This method can be utilized to extract a wide range of job metrics like CPU time used, Job Execution node name etc. based on the business requirement. The metrics when extracted using the LSF command bacct can take hours to complete. The method mentioned in this paper can be automated as well and scheduled such that reports are generated automatically. REFERENCES Sangwan, Prasoon. Gupta, Tanuj. and Singh, Piyush. Apr-2016. Key Requirements for SAS Grid Users Proceedings SAS Global Forum. Las Vegas, NV, USA: SAS Institute. Available at: http://support.sas.com/resources/papers/proceedings16/7140-2016.pdf Singh, Piyush. Sangwan, Prasoon. Kumar. SASGSUB for Job Workflow and SAS Log Files Proceedings of South Central SAS User Group 2016. San Antonio, TX, USA: SCSUG. Available at: http://www.lexjansen.com/scsug/2016/sasgsub-for-job-workflow-and-sas-log-files.pdf Piyush Singh, Prasoon Sangwan, Steven D Randolph, Read SAS Metadata in SAS Enterprise Guide Proceedings of SAS Global Forum 2017. Orlando, FL, USA http://support.sas.com/resources/papers/proceedings17/1275-2017.pdf RECOMMENDED READING Platform LSF Version 9 Release 1.3 SAS 9.4 Language Interfaces to Metadata

CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Piyush Singh Ghiyasuddin Mohammed Faraz Khan Prasoon Sangwan piyushkumar.singh@tcs.com ghiyasuddin.farazkhan@tcs.com prasoon.sangwan@tcs.com SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies.