Sun S3L 3.0 Programming and Reference Guide

S3L_DefineArray

Description

S3L_DefineArray associates an internal S3L array handle to a user-distributed parallel array. The array must be distributed in such a manner that it can be expressed as a block cyclic distribution. The array handle returned by S3L_DefineArray can then be used in subsequent calls by Sun MPI programs to S3L functions.

S3L_DefineArray does not allocate the memory required to store the local (process specific) part on the array. The user must allocate sufficient memory on each process to hold the local part of the parallel array before calling this function.

Syntax

The C and Fortran syntax for S3L_DefineArray are shown below.

C/C++ Syntax


Example 7-9

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
S3L_array_t
S3L_DefineArray(address, rank, type, extents, blocks,
sprocs, p_ext)
    void               address
    int                rank
    int                type
    int                *extents
    int                *blocks
    int                *sprocs
    int                *p_ext

F77/F90 Syntax


Example 7-10

include `s3l/s3l-f.h'
include `s3l/s3l_errno-f.h'
integer*8 function
S3L_DefineArray(address,
rank, type, extents, blocks, sprocs, p_ext)
    <type>             array(1)
    integer*4          rank
    pointer            (addrr_a,array)
    integer*4          rank
    integer*4          type
    integer*4          extents(*)
    integer*4          blocks(*)
    integer*4          sprocs(*)
    integer*4          p_ext(*)

Input

S3L_DefineArray accepts the following arguments as input:

Note that process ordering within the process grid is always column major (F77 major) and that the product of the extents of the process grid must equal the total number of processes participating in the computation (that is, must equal the size of MPI_COMM_WORLD).

Error Handling

On success, S3L_DefineArray returns an S3L array handle that can be used for subsequent calls to other Sun S3L functions.

On error, it returns 0.

Examples

../examples/s3l/api
../examples/s3l/api-f

Related Functions

S3L_UnDefineArray(3)