Main Page | Modules | Data Structures | File List | Data Fields | Globals

Create and Initialize

Functions in this group are used to create and initialize an array descriptor. More...

Functions

void * createArrayDesc_F90Vendor (void *desc, void *hidden, int rank, F90_DescType desc_type)
 Creates an array descriptor by copying an existing array and hidden descriptor pair.

int setArrayDesc_F90Vendor (void *desc, void *base_addr, int rank, F90_DescType desc_type, F90_ArrayDataType data_type, unsigned long element_size, const long *lowerBound, const unsigned long *extent, const long *strideMult)
 Sets the elements of a preallocated array descriptor.

int resetArrayDesc_F90Vendor (void *desc, void *base_addr, int rank, const long *lowerBound, const unsigned long *extent, const long *strideMult)
 Resets the elements of a preallocated array descriptor.


Detailed Description

Functions in this group are used to create and initialize an array descriptor.

Descriptors created by these functions may be permanently stored in C (as long as the array associated with the descriptor has not freed; it is an error to use a descriptor if the associated array has been freed). However, these descriptors cannot be directly used in a procedure call to Fortran as the call may require a hidden descriptor parameter (depending on the Fortran compiler). Descriptors created by these functions must first be converted to a descriptor and hidden descriptor pair by a function in the "Procedure Call" group.


Function Documentation

void* createArrayDesc_F90Vendor void *  desc,
void *  hidden,
int  rank,
F90_DescType  desc_type
 

Creates an array descriptor by copying an existing array and hidden descriptor pair.

This function is used when passing an array from Fortran to C. The array and hidden descriptor input parameters are obtained from the Fortran calling procedure; they must not be otherwise stored or saved.

The returned descriptor cannot be directly used in calls to Fortran because a hidden descriptor may be required by some compilers. The created descriptor may be copied to a descriptor and hidden descriptor pair by either createArrayDescAndHidden_F90Vendor() (for a C call to Fortran) or by copyToArrayDescAndHidden_F90Vendor() (for modifying an array pointer on return from a Fortran call to C). Note, it is the callers responsibility to free the returned descriptor.

See also:
setArrayDesc_F90Vendor()

resetArrayDesc_F90Vendor()

Parameters:
desc the array descriptor (from Fortran call stack) to copy (in parameter).
hidden hidden descriptor (from Fortran call stack; in parameter).
rank the rank of the array (in parameter).
desc_type type of the source descriptor (in parameter).
Returns:
a newly allocated array descriptor.

int resetArrayDesc_F90Vendor void *  desc,
void *  base_addr,
int  rank,
const long *  lowerBound,
const unsigned long *  extent,
const long *  strideMult
 

Resets the elements of a preallocated array descriptor.

The descriptor must have been previously initialized by either setArrayDesc_F90Vendor() or createArrayDesc_F90Vendor(). The rank, data type and element size of the array MUST NOT change. Note, at least, getArrayDescSize_F90Vendor() bytes must have been allocated for the descriptor.

Parameters:
desc a previously initialized array descriptor (memory created and freed by caller; inout parameter).
base_addr the base address of the array (in parameter).
rank the rank of the array (in parameter).
lowerBound array[rank] of lower bounds for the array (in parameter).
extent array[rank] of extents for the array (in elements; in parameter).
strideMult array[rank] of distances between successive elements (in bytes; in parameter).
Returns:
0 if successful (nonzero on error).

int setArrayDesc_F90Vendor void *  desc,
void *  base_addr,
int  rank,
F90_DescType  desc_type,
F90_ArrayDataType  data_type,
unsigned long  element_size,
const long *  lowerBound,
const unsigned long *  extent,
const long *  strideMult
 

Sets the elements of a preallocated array descriptor.

This function is used when memory for an array has been created in C and the C array is to be subsequently passed to a Fortran procedure.

The initialized descriptor cannot be directly used in calls to Fortran because a hidden descriptor parameter may be required by some compilers. The initialized descriptor may be copied to a descriptor and hidden descriptor pair by either createArrayDescAndHidden_F90Vendor() (for a C call to Fortran) or by copyToArrayDescAndHidden_F90Vendor() (for modifying an array pointer on return from a Fortran call to C).

Memory for the descriptor is allocated and freed by the caller. The size of descriptor must be at least getArrayDescSize_F90Vendor() bytes.

See also:
createArrayDesc_F90Vendor()

resetArrayDesc_F90Vendor()

Parameters:
desc an uninitialized array descriptor (memory created and freed by caller; out parameter).
base_addr the base address of the array (in paramemter).
rank the rank of the array (in parameter).
desc_type type of the descriptor (in parameter).
data_type data type of an array element (in parameter).
element_size size of an array element (in parameter).
lowerBound array[rank] of lower bounds for the array (in parameter).
extent array[rank] of extents for the array (in elements; in parameter).
strideMult array[rank] of distances between successive elements (in bytes; in parameter).
Returns:
0 if successful (nonzero on error).


Generated on Mon Sep 29 17:57:07 2003 for Chasm by doxygen 1.3.4