Biowulf High Performance Computing at the NIH
SAS on Biowulf

Base SAS provides a scalable, integrated software environment specially designed for data access, transformation and reporting. It includes a fourth-generation programming language; ready-to-use programs for data manipulation, information storage and retrieval, descriptive statistics and report writing; and a powerful macro facility that reduces programming time and maintenance issues. The Base SAS windowing environment provides a full-screen facility for interacting with all parts of a SAS program. On-line help is also available. With multithreaded capabilities, Base SAS software can take advantage of parallel processing power to maximize use of computing resources. However, the main advantage of using SAS on Biowulf would be to run many SAS jobs simultaneously in batch mode as a 'swarm' of single-threaded jobs. SAS on Biowulf is a limited resource. SLURM keeps track of the SAS resource. Jobs requiring SAS will be started or remain in the queue depending on whether there are SAS resources available. All SAS jobs must therefore specify the resource when the job is submitted, as in the examples below. At present there is a limit of 48 simultaneous SAS processes, but this number is subject to change.

References:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. You should see the SAS logo pop up briefly, and then the menus will appear.
Sample session (user input in bold):

[user@biowulf]$ sinteractive
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load SAS
[+] Loading SAS 9.4  ...

[user@cn3144 ~]$ sas
SAS splash screen

SAS GUI

[user@cn3144 ~]$ exit salloc.exe: Relinquishing job allocation 46116226 [user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. SAS.sh). For example:

#!/bin/bash
#
#SBATCH -J SAS
#SBATCH --mail-type=BEGIN,END

module load SAS
date
sas sasfile.sas 

Submit this job using the Slurm sbatch command.

sbatch --license=sas [--cpus-per-task=#] [--mem=#] SAS.sh
This sbatch command requests one SAS license ('license=sas'), so the job will remain in the queue until a license is available. To use more than one license, append --license=sas with a colon and the number of licenses (max is 48) you need (--license=sas:4). You will receive email when the job is executed and when it ends, because of the line containing --mail-type in the script. The output can be found in the directory from which your script was ran, with the file name slurm-#.out There are other options that you may need to set for your job, specifically walltime and memory. For more information about those options, see the Biowulf User Guide.

Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. SAS.swarm). For example:

sas sasjob1.sas
sas sasjob2.sas
sas sasjob3.sas
sas sasjob4.sas
sas sasjob5.sas
[...]
sas sasjob100.sas

Submit this job using the swarm command.

swarm -f SAS.swarm [-g #] [-t #] --module SAS --sbatch "--license=sas"
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module SAS Loads the SAS module for each subjob in the swarm

Total and free licenses, the resource name, and the per-user license limit can be seen by typing 'licenses' at the Biowulf prompt.