Using SAS Enterprise Guide and SAS Add-In for Microsoft Office with a SAS Grid

Types of Grid Enablement

Jobs generated by SAS Enterprise Guide and SAS Add-In for Microsoft Office can take advantage of a SAS grid using one or a combination of these approaches:
  • Using server-side load balancing through a grid-launched workspace server. When SAS Enterprise Guide or SAS Add-In for Microsoft Office request the use of a workspace server to run a job, the object spawner launches a new workspace server in the grid on a node that meets the criteria of the queue to which the job was submitted. The job then runs on the workspace server.See Using SAS Grid Manager for Server Load Balancing for more information about specifying grid load balancing on a workspace server.
  • Using server-side load balancing through a grid load-balanced workspace server. When SAS Enterprise Guide or SAS Add-In for Microsoft Office request the use of a workspace server to run a job, the object spawner uses SAS Grid Manager to automatically launch the server on the least busy node in the grid. The code from SAS Enterprise Guide or SAS Add-In for Microsoft Office is then run on the workspace server. See Using SAS Grid Manager for Server Load Balancing for more information about specifying grid load balancing on a workspace server.
  • Using SAS Enterprise Guide or SAS Add-In for Microsoft Office’s ability to enable projects or tasks to run on the grid. If you are using SAS Enterprise Guide or SAS Add-In for Microsoft Office 5.1 or later, the code for the project or the task is wrapped in RSUBMIT/ENDRSUBMIT statements and automatically sent to the SAS grid for processing. To specify this type of processing, perform one of the following actions:
    • Specify Use grid if available in the Project Properties window or the Task Properties window.
    • Specify the Initialize Grid (if available) option when connecting to a workspace in the Options dialog box under SAS Programs.
    • Set the EGGridPolicy or the AMOGridPolicy extended attribute on the logical grid server to a value of Force. See Using Extended Attributes to Specify Grid Usage for more information about these attributes.n0clcosbyh7s72n12g7vvnxyztv2
    Note: These options are not needed if you use grid-launched workspace servers.
    If you are using grid-launched workspace servers and do not want the Use grid if available option to be available, set the EGGridPolicy or the AMOGridPolicy to a value of Ignore. The Ignore value is available in the first maintenance release after version 6.1 of SAS Enterprise Guide and SAS Add-In for Microsoft Office.
  • Using SAS Enterprise Guide or SAS Add-In for Microsoft Office’s ability to insert custom code before and after tasks and SAS programs to route the processing to the grid. If you are using SAS Enterprise Guide 4.3 or earlier, you can wrap the code for the project or the task in RSUBMIT/ENDRSUBMIT statements through the use of custom code options that are inserted before and after the code that is submitted with the program. You must also modify the application servers, the SAS Enterprise Guide configuration files, and the SAS Add-In for Microsoft Office options. Download the code and instructions from http://support.sas.com/rnd/scalability/grid/download.html.
    Note: This option is not needed if you use grid-launched workspace servers.
If you use grid-launched workspace servers, you should not specify any of the other grid-related options. If you are using the first maintenance release of version 6.1 of SAS Enterprise Guide or SAS Add-In for Microsoft Office, you can prevent users from using the grid options by specifying a value of Ignore for the EGGridPolicy or the AMOGridPolicy extended attribute on the logical grid server. See Using Extended Attributes to Specify Grid Usage for more information about these attributes.
If you are not using grid-launched workspace servers, you must specify grid load balancing options, and you might have to wrap your code in RSUBMIT/ENDRSUBMIT statements. The statements are required if you are using SAS Enterprise Guide or SAS Add-In for Microsoft Office 4.3 or earlier. If you are using SAS Enterprise Guide or SAS Add-In for Microsoft Office 5.1 or later, the statements are not required.

Parallel Execution and Grid Enablement

The option Allow parallel execution on the same server is not an option to control processing on the grid, but it can affect how grid-enabled jobs are processed. The option causes SAS Enterprise Guide to create a workspace server for each parallel process in a project, regardless of whether the project is grid-enabled or not. The following list explains how this option interacts with the Use grid if available option:
Neither option is selected
All code runs in a single workspace server.
Only Use grid if available option selected
A workspace server starts, performs a grid-enabled SIGNON, and submits code to the grid.
Only Allow parallel execution option selected
Multiple workspace servers are started, one for each parallel code path in a project.
Both options selected
Multiple workspace servers are started. Each server signs on to the grid. Each parallel code path in a project is submitted to the grid.
Selecting both options might cause problems because the GRIDWORK and RMTWORK libraries are duplicated in each workspace server. This causes problems for SAS Enterprise Guide when it tries to read from one of those libraries. Selecting the Allow parallel execution option might cause problems because one execution stream might need to use or write to a data set that is in use by another stream.
If you are using grid-launched workspace servers, you do not need to enable the Use Grid if available option because the workspace server for SAS Enterprise Guide is already running on the grid. The Allow parallel execution option can improve run-time efficiency, but it is more complex because it can run multiple and separate SAS sessions. When possible, perform debug and testing operations with the Allow parallel execution option disabled.

Using Extended Attributes to Specify Grid Usage

You can use the EGGridPolicy and AMOGridPolicy attributes on the logical grid server definition to control whether SAS Enterprise Guide or SAS Add-In for Microsoft Office version 5.1 or later uses the grid. These attributes override any other settings in the applications. The following are the possible values for the attributes (values are not case-sensitive):
Noforce
jobs are sent to the grid depending on the setting of the option Use grid if available.
Force
jobs are always sent to the grid, regardless of the value of the option Use grid if available.
Ignore
jobs are never sent to the grid, regardless of the value of the option Use grid if available. This value is supported for the first maintenance release after version 6.1 of SAS Enterprise Guide and SAS Add-In for Microsoft Office.

Assigning Libraries in a Grid

In SAS 9.2 and later versions, SAS sessions on the grid use the METAAUTORESOURCES option by default. This option causes SAS libraries that are defined in metadata and identified as “pre-assigned” to automatically be assigned when the SAS session is started. Using pre-assigned libraries with the METAAUTORESOURCES option ensures that the libraries used in the code generated by SAS Enterprise Guide and SAS Add-In for Microsoft Office are available to the SAS sessions on the grid.
However, if your programs use a large number of libraries, you might not want to make all of these libraries pre-assigned. Automatically assigning a large number of libraries could cause performance problems, and not all libraries are likely to be used for all programs. To minimize the performance overhead, define the libraries in SAS metadata but do not identify them as pre-assigned. When you need to refer to the library, you can then use a LIBNAME statement using the META LIBNAME engine.

Developing SAS Programs Interactively Using a Grid

Maintaining a Connection to the Grid

By default, when you start SAS Enterprise Guide or SAS Add-In for Microsoft Office, it connects to a single workspace server and keeps that connection active for the length of the session. If you interactively develop programs in SAS Enterprise Guide or SAS Add-In for Microsoft Office by highlighting and submitting lines of code, the codes use items such as libraries, WORK files, and SAS global statements on the workspace server.
If you are submitting grid-enabled code from SAS Enterprise Guide or SAS Add-In for Microsoft Office in a grid environment, then items such as libraries and SAS global statements must be accessed through the grid rather than through a single workspace server. To maintain access to these items, you must maintain a connection to the grid while you are developing programs interactively. If you are using grid-launched workspace servers, this is not an issue.

Managing Interactive Workload

When SAS Enterprise Guide or SAS Add-In for Microsoft Office is used for interactive program development, the workload is likely to consist of short bursts of work interspersed with varying periods of inactivity while the user considers their next action. The SAS grid configuration can best support this scenario with these configuration settings:
  • Increase the number of job slots for each machine.
    Increasing the number of job slots increases the number of simultaneous SAS sessions on each grid node. Because the jobs that are run on the grid are not I/O or compute intensive like large batch jobs, more jobs can be run on each machine.
  • Implement CPU utilization thresholds for each machine.
    If all users submit CPU-intensive work at the same time, SAS Grid Manager can suspend some jobs and resume the suspended jobs when resources are available. This capability prevents resources from being overloaded.
The following example shows a sample LSB.HOSTS file that is configured with job slots set to 32 and CPU utilization thresholds set to 80%. The settings needed for a specific site depend on the number of users and the size of the grid nodes.
HOST_NAME MXJ    ut        r1m     pg    ls    tmp  DISPATCH_WINDOW  #Keywords
#default   !     ()         ()     ()    ()     ()     ()            #Example
host01     32    0.7/0/8    ()     ()    ()     ()     ()            # host01
host02     32    0.7/0/8    ()     ()    ()     ()     ()            # host02
host03     32    0.7/0/8    ()     ()    ()     ()     ()            # host03
host04     32    0.7/0/8    ()     ()    ()     ()     ()            # host04
host05     32    0.7/0/8    ()     ()    ()     ()     ()            # host05
End Host