The system options THREADS, NOTHREADS, and CPUCOUNT influence threading
throughout SAS where threading is not automatic. Some products have additional
options for controlling threading such as DBSLICE in SAS/ACCESS. The system option
THREADS is the default in all products so that threading can occur wherever use of
threading is possible and performance is improved. NOTHREADS disables threading in
Base SAS or SAS clients and in products that execute in a symmetric multi-processor
environment. Procedure statement options are provided to override the system options
when necessary.
Certain procedures in SAS products such as SAS/STAT, SAS/OR, SAS/ETS, SAS
Enterprise Miner, and SAS High-Performance Analytics Server procedures can execute
in either SMP mode on a SAS client, or in massively parallel processing mode in the
distributed computing environment. In SMP mode, NOTHREADS is honored, if set; if
THREADS is set, CPUCOUNT defaults to the number of threads available for
processing on the client, but can be adjusted. In MPP mode, threads are always assumed.
NOTHREADS is ignored and threading is always enabled (unless you execute from the
client SAS session or SAS Enterprise Miner). However, in MPP mode, NOTHREADS
has no effect. In most of these products, thread controls and execution mode are
specified in the PERFORMANCE statement. Refer to the SAS System Options:
Reference along with the specific SAS product documentation for information about the
threading technologies used in that product or component.
Threading in Base SAS
Some threading is automatic in Base SAS. In addition, the THREADS option is the
default for all Base SAS components that support threaded reads or threaded application
processing.
Base Language
SAS uses threading technology to build indexes on SAS data files. An index can
speed performance in SAS Language WHERE processing, BY-group processing,
SET and MODIFY statements, and ARRAY processing in a DO loop. The sorting
algorithm in Base SAS, which is used in building an index, is thread-enabled by
default but can be disabled with NOTHREADS. For more information, see SAS
System Options: Reference along with the specific SAS product documentation for
information about the threading technologies used in that product or component.
Thread-Enabled Base SAS Procedures
Certain Base SAS procedures have algorithms that can take advantage of threaded
processing. These procedures are thread-enabled to split parts of the procedure
algorithm so that it executes some parts of the algorithm in threads. For example, the
SORT procedure is thread-enabled so that the sorting takes place in available threads
and each thread sorts a part of the data. The procedure then quickly generates the
data set in sorted order from the multiple threads. These procedures can also read
data in threads.
The number of threads and CPUs available to the procedures is specified by system
or procedure options CPUCOUNT and THREADS|NOTHREADS. NOTHREADS
specifies not to use threaded processing for running SAS applications that support it.
THREADS is the default. When NOTHREADS is in effect, CPUCOUNT is ignored.
Base SAS thread-enabled procedures are the following:
MEANS
REPORT
SORT
Threading in Base SAS 209
SUMMARY
TABULATE
SQL
For details, see “Threaded Processing for Base SAS Procedures” in Base SAS
Procedures Guide. For details of the thread-enabled SQL procedure, see the SAS
SQL Procedure Users Guide. Details of SAS System Options, see the SAS System
Options: Reference.
Some procedures in SAS/STAT software are also thread-enabled and most of them
can run in either SMP or MPP mode. In SMP mode, NOTHREADS and
CPUCOUNT are honored. In MPP mode, the PERFORMANCE statement provides
the options to control threading. These are the thread-enabled SAS/STAT procedures:
ADAPTIVEREG
FMM
GLM
GLMSELECT
LOESS
MIXED
QUANTLIFE
QUANTREG
QUANTSELECT
ROBUSTREG
See the SAS/STAT Procedures Guide for details for each procedure.
SAS Scalable Performance Data Engine
The SAS Scalable Performance Data Engine, which is included in Base SAS, is
engineered to exploit SMP hardware capabilities. The SAS Scalable Performance
Data Engine uses partitioned data sets that are optimized for reading data in threads.
The partition size can be configured with the SAS Scalable Performance Data
Engine PARTSIZE option. THREADNUM and SPDEMAXTHREADS control
threading for optimum threaded reads. The Base SAS NOTHREADS and
CPUCOUNT system options have no effect on SPD Engine threaded reads. They
remain in effect for the SAS thread-enabled procedures executing on the SPD Engine
data set. SPD Engine indexes are also created in threads in parallel automatically
without regard to NOTHREADS, if set. You can use SPDEINDEXSORTSIZE= to
optimize threaded index creation. The SPD Engine is described in the SAS Scalable
Performance Data Engine: Reference.
SAS FedSQL Language
SAS FedSQL is a SAS proprietary SQL implementation based on the ANSI SQL:
1999 standard. It provides support for ANSI SQL data types and other ANSI
compliance features. The core strength of SAS FedSQL is its ability to execute
federated queries across a heterogeneous database environment and return a single
result set. FedSQL queries are automatically optimized with multi-threaded
algorithms in order to resolve large-scale operations. In addition, FedSQL can
execute outside of a SAS session, for example in the SAS Federation Server and
SAS Scalable Performance Data Server environments. The NOTHREADS and
CPUCOUNT options have no effect on FedSQL processing.
The FedSQL procedure, which submits FedSQL programs for execution, is included.
See the SAS FedSQL Language Reference for complete information.
210 Chapter 13 Support for Parallel Processing
SAS DS2 Programming Language
DS2 is a SAS proprietary programming language that is appropriate for advanced
data manipulation and data modeling applications. DS2 is included with Base SAS
and intersects with the SAS DATA step but also supports additional data types, ANSI
SQL types, programming structure elements, user-defined methods, and packages.
The DS2 SET statement accepts embedded FedSQL syntax and the runtime-
generated queries can exchange data interactively between DS2 and any supported
database. This allows SQL preprocessing of input tables which effectively combines
the power of the two languages.
DS2 programs are thread-enabled by using the THREAD statement on a program
coded for parallel execution. The NOTHREADS and CPUCOUNT options have no
effect. See the SAS 9.4 DS2 Language Reference for details about whether your
DATA step programs would benefit from being converted to DS2.
The DS2 procedure, which submits thread-enabled DS2 programs to the SAS
Embedded Process for execution is also included. A high-performance version of the
DS2 procedure, PROC HPDS2, submits DS2 language statements to the separately
licensed High-Performance Analytics Server for processing. See the SAS High-
Performance Analytics Server Usage Guide for documentation on this and other
high-performance versions of certain SAS procedures.
DS2 can execute outside of a SAS session. For example:
SAS Federation Server
SAS Scalable Performance Data Server
MPP computing environments such as the SAS In-Database Scoring Accelerator,
the SAS Embedded Process environment, and SAS High-Performance Analytics
Server distributed environment
SAS Logging
The SAS Logging Facility ignores the NOTHREADS and CPUCOUNT options. It
handles all incoming logging events in threads. The client identity that is associated
with the current thread or task is reported in the log. The logging facility supports
many SAS products and components, but it is included with Base SAS. See the SAS
Logging: Configuration and Programming Reference.
SAS Code Analyzer
The SAS Code Analyzer (SCAPROC procedure) runs an existing SAS program
(executing the program as usual) when generating metadata about the SAS job that
are recorded comments. PROC SCAPROC captures information about the job step,
I/O information such as file dependencies, and macro symbol usage information
from a running SAS job. The output is a SAS program containing comments with the
dependencies described in the comments. An application can read this text and create
SAS metadata or determine a process flow based on these dependencies. For
example, developers for SAS Data Integration Studio can use the information
emitted by the SAS Code Analyzer to reverse engineer legacy SAS jobs. It can also
be used with SAS Grid Manager. When the saved job is run on the grid, SAS Grid
Manager automatically assigns the identified subtasks to a grid node. For more
information, see the SCAPROC procedure documentation in the Base SAS
Procedures Guide.
Threading in Base SAS 211
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.3.175