S3L_array_op2 applies the operation specified by op to elements of parallel arrays a and b, which must be of the same type and have the same distribution. The parameter op can be one of the following:
S3L_OP_MUL - a equals a .* b
S3L_OP_CMUL - a equals a .* conjg(b)
S3L_OP_DIV - a equals a ./ b
S3L_OP_MINUS - a equals a - b
S3L_OP_PLUS - a equals a + b
The operators ".*" and "./" denote pointwise multiplication and division of the elements in arrays a and b.
S3L_OP_MUL replaces each element in a with the elementwise product of multiplying a and b.
S3L_OP_CMUL performs the same operation as S3L_OP_MUL, except it multiplies each element in a by the conjugate of the corresponding element in b.
S3L_OP_DIV performs elementwise division of a by b, overwriting a with the integer (truncated quotient) results.
S3L_OP_MINUS performs elementwise subtraction of b from a, overwriting a with the differences.
S3L_OP_PLUS performs elementwise addition of a with b, overwriting a with the sum.
The C and Fortran syntax for S3L_array_op2 are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_array_op2(a, b, op) S3L_array_t a S3L_array_t b int op |
include `s3l/s3l-f.h include `s3l/s3l_errno-f.h' subroutine S3L_array_op2(a, b, op, ier) integer*8 a integer*8 b integer*4 op integer*4 ier |
S3L_array_op2 accepts the following arguments as input:
a - S3L array handle for one of two parallel arrays to which the operation will be applied.
b - S3L array handle for the second of two parallel arrays to which the operation will be applied.
op - Predefined constant specifying the operation to be applied. See the Description section for details.
S3L_array_op2 uses the following argument for output:
ier (Fortran only) - When called from a Fortran program, S3L_array_op2 returns error status in ier.
On success, S3L_array_op2 returns S3L_SUCCESS.
S3L_array_op2 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:
S3L_ERR_MATCH_HOME - Both arrays are local but not on the same process.
S3L_ERR_MATCH_ALIGN - The arrays do not have the same subgrid sizes.
S3L_ERR_ARG_OP - An illegal operation was requested.
../examples/s3l/fft/ex_fft1.c ../examples/s3l/fft-f/ex_fft1.f
S3L_array_op1(3) S3L_array_scalar_op2(3) S3L_reduce_scalar(3)