Sun S3L 3.0 Programming and Reference Guide

S3L_set_safety

Description

The S3L safety mechanism offers two types of services:

The S3L safety mechanism can be set to operate at ony one of four levels, which are described in Table 7-2.

Table 7-2 S3L Safety Levels

Safety Level 

Description 

0

Turns the safety mechanism off. Explicit synchronization and errorchecking are not performed. This level is appropriate for productionruns of code that have already been thoroughly tested. 

2

Detects potential race conditions in multithreaded S3L operations on parallel arrays. To avoid race conditions, an S3L function locks all parallel array handles in its argument list before proceeding. This safety level causes warning messages to be generated if more than one S3L function attempts to use the same parallel array at the same time. 

5

In addition to checking for and reporting level 2 errors, performsexplicit synchronization before and after each call and locates eacherror with respect to the synchronization points. This safety level isappropriate during program development or during runs for which a small performance penalty can be tolerated. 

9

Checks for and reports all level 2 and level 5 errors, as well as errorsgenerated by any lower levels of code called from within S3L. Performs explicit synchronization in these lower levels of code and locates each error with respect to the synchronization points. This level is appropriate for detailed debugging following the occurrenceof a problem. 

The S3L safety mechanism can be controlled in either of two ways:

To set the S3L safety level using the S3L_SAFETY environment variable, issue the command:

setenv S3L_SAFETY
{ 0 | 2 | 5 | 9 }

Syntax

The C and Fortran syntax for S3L_set_safety are shown below.

C/C++ Syntax


Example 7-55

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
int
S3L_set_safety(n)
    int                n

F77/F90 Syntax


Example 7-56

include `s3l/s3l-f.h'
include `s3l/s3l_errno-f.h'
subroutine
S3L_set_safety(n, ier)
    integer*4          n
    integer*4          ier

Input

S3L_set_safety accepts the following argument as input:

Output

S3L_set_safety uses the following argument for output:

Error Handling

On success, S3L_set_safety returns S3L_SUCCESS.

On error, the following condition will cause the function to return the associated error code and terminate:

Examples

../examples/s3l/utils/copy_array.c
../examples/s3l/utils-f/copy_array.f

Related Functions

S3L_get_safety(3)