Sun S3L 3.0 Programming and Reference Guide

Creating a Program that Calls Sun S3L Routines

To use Sun S3L routines in a program:
  1. Place calls to Sun S3L routines into your code.

  2. Include the appropriate header file in each program unit that calls Sun S3L routines.

    See " Include the Sun S3L Header File"for details.

  3. Use the appropriate compiler command to compile your code; include the Sun S3L link switch on the command line.

    See " Compiling and Linking"for details.

The remainder of this section describes the steps listed above more fully.

Sun S3L requires the presence of the Sun Performance Library routines and its associated license file. This library is not installed with Sun S3L and other Sun HPC ClusterTools components. Instead, it is included as part of the following compiler suites:

Include the Sun S3L Header File

Place the appropriate include line at the top of any program unit that makes an S3L call. The correct include files are shown below for both C and Fortran language interfaces:

The first line allows the program to access the header file containing prototypes of the routines and defines the symbols and data types required by the interface. The second line includes the header file containing error codes the routines might return.

If the compiler cannot find the Sun S3L include file, verify that a path to the directory does exist. The standard path is

/opt/SUNWhpc/includ/

If the file appears to be missing, consult your system administrator.

Compiling and Linking

Compile your program and link in Sun S3L (along with any other libraries it needs).

The link-line switch -ls3l does more than just link in Sun S3L subroutines. Depending on which compiler has been invoked, it also automatically links any other libraries needed to augment Sun S3L, greatly simplifying the link line.


Note -

The -dalign option is needed because libs3l and libsunperf libraries are compiled with it.


Executing Sun S3L Programs

Execute a program that has been linked with Sun S3L just as you would any other program compiled for running on a Sun HPC System.

To submit such an application to the LSF Batch system, use the LSF bsub command. For example,

% bsub -q hpc -n 4 hpc.job

submits the executable hpc.job to the batch queue hpc and requests that it run on four processors. The LSF Batch system will launch hpc.job as soon as it reaches the top of the queue and all required resources become available.

Refer to the Sun MPI 4.0 User's Guide: With LSF and the LSF Batch User's Guide for complete instructions on submitting Sun HPC jobs to the LSF Batch system.

To submit hpc.job to the Sun HPC Cluster Runtime Environment (CRE), use the mprun command. For example,

% mprun -np 4 hpc.job

submits hpc.job to the CRE and requests that it run on four processes.

Refer to the Sun MPI 4.0 User's Guide: With CRE for additional information.