Sun S3L 3.0 Programming and Reference Guide

Deallocating Parallel Arrays

S3L_free

Description

S3L_free deallocates the memory reserved for a parallel S3L array and undefines the associated array handle.


Note -

If memory was allocated for the array by the user rather than by S3L, S3L_free destroys the array handle, but does not deallocate the memory. This situation can arise when S3L_declare_detailed() is invoked with the atype option set to S3L_DONOT_ALLOCATE.


Syntax

The C and Fortran syntax for S3L_free are shown below.

C/C++ Syntax


Example 7-15

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
int
S3L_free(a)
    S3L_array_t        *a

F77/F90 Syntax


Example 7-16

include `s3l/s3l-f.h
include `s3l/s3l_errno-f.h'
subroutine
S3L_free(a, ier)
    integer*8          a
    integer*4          ier

Input

S3L_free accepts the following argument as input:

Output

S3L_free uses the following argument for output:

Error Handling

On success, S3L_free returns S3L_SUCCESS.

On error, the following error code may be returned:

Examples

../examples/s3l/io/ex_print1.c
../examples/s3l/io-f/ex_print1.f

Related Functions

S3L_declare(3)
S3L_declare_detailed(3)

S3L_UnDefineArray

Description

S3L_UnDefineArray frees the array handle and the associated memory that were set up by a previous call to S3L_DefineArray.


Note -

S3L_UnDefineArray does not free the local (process-resident) memory, where the local part of a parallel array is stored. The user is responsible for deallocating local memory assigned to the parallel array before the parallel program exits.


Syntax

The C and Fortran syntax for S3L_UnDefineArray are shown below.

C/C++ Syntax


Example 7-17

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
int
S3L_UnDefineArray(a)
    S3L_array_t         a

F77/F90 Syntax


Example 7-18

include `s3l/s3l-f.h
include `s3l/s3l_errno-f.h'
subroutine
S3L_UnDefineArray(a)
    integer*8          a

Input

S3L_UnDefineArray accepts the following argument as input:

Error Handling

S3L_UnDefineArray does not return any value.

Examples

../examples/s3l/api
../examples/s3l/api.f
../examples/s3l/array_utils

Related Functions

S3L_DefineArray(3)
S3L_declare(3)
S3L_declare_detailed(3)
S3L_free(3)