S3L_free deallocates the memory reserved for a parallel S3L array and undefines the associated array handle.
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.
The C and Fortran syntax for S3L_free are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_free(a) S3L_array_t *a |
include `s3l/s3l-f.h include `s3l/s3l_errno-f.h' subroutine S3L_free(a, ier) integer*8 a integer*4 ier |
S3L_free accepts the following argument as input:
a - Handle for the parallel S3L array that is to be deallocated. This handle was returned by a previous call to S3L_declare, S3L_declare_detailed.
S3L_free uses the following argument for output:
ier (Fortran only) - When called from a Fortran program, S3L_free returns error status in ier.
On success, S3L_free returns S3L_SUCCESS.
On error, the following error code may be returned:
S3L_ERR_ARG_ARRAY - a is a NULL pointer (C/C++) or 0 (F77/F90).
../examples/s3l/io/ex_print1.c ../examples/s3l/io-f/ex_print1.f
S3L_declare(3) S3L_declare_detailed(3)
S3L_UnDefineArray frees the array handle and the associated memory that were set up by a previous call to S3L_DefineArray.
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.
The C and Fortran syntax for S3L_UnDefineArray are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_UnDefineArray(a) S3L_array_t a |
include `s3l/s3l-f.h include `s3l/s3l_errno-f.h' subroutine S3L_UnDefineArray(a) integer*8 a |
S3L_UnDefineArray accepts the following argument as input:
a - Handle for the parallel S3L array that is to be deallocated. This handle was returned by a previous call to S3L_DefineArray.
S3L_UnDefineArray does not return any value.
../examples/s3l/api ../examples/s3l/api.f ../examples/s3l/array_utils
S3L_DefineArray(3) S3L_declare(3) S3L_declare_detailed(3) S3L_free(3)