Sun S3L 3.0 Programming and Reference Guide

S3L_reduce

Description

S3L_reduce performs a predefined reduction function over all elements of a parallel array. The array is described by the S3L array handle argument A. The argument op specifiesthe type of reduction operations, which can be one of the following:

Syntax

The C and Fortran syntax for S3L_reduce are shown below.

C/C++ Syntax


Example 7-29

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
int
S3L_reduce(A, op, res)
    S3L_array_t           A
    S3L_op_type           op
    void                  *res

F77/F90 Syntax


Example 7-30

include `s3l/s3l-f.h'
include `s3l/s3l_errno-f.h'
subroutine
S3L_reduce(A, op, res, ier)
    integer*8              A
    integer*4              op
    <type>                 res
    integer*4              ier

where <type> is one of: real*4, real*8, complex*8, or complex*16.

Input

S3L_reduce accepts the following arguments as input:

Output

S3L_reduce uses the following arguments for output:

Error Handling

On success, S3L_reduce returns S3L_SUCCESS.

S3L_reduce performs generic checking of the validity of the arrays it accepts as arguments. If an array argument contains an invalid or corrupted value, the function terminates and an error code indicating which value of the array handle was invalid is returned. See Appendix A of this manual for a detailed list of these error codes.

In addition, the following conditions will cause the function to terminate and return the associated error code.

Examples

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

Related Functions

S3L_reduce_axis(3)