Array Type

Next: , Previous: Tempmem, Index: Index

The array[T,s...] type is a simple, commonly seen data storage structure available in the majority of languages. T is the type of data to be stored, s is the size and n different sizes will result in n dimensions. As has already been noted, the default is row major allocation, although this can be changed. The communication relating to arrays is detailed in the table below based on the assignment a:=b;

a b Result
multiple multiple Local memory copy from b into a
single[x] single[x] Local memory copy from b into a where x == x
single[x] single[n] P2P communication if x != n
multiple[a] single[] If multiple on all processes the MPI Broadcast, else broadcast in the group.
single multiple Local memory copy from b into a


In addition to this, remember what has already been mentioned about accessing array indexes - the classical way of a[n] is allowed but the prefered method is via a#n as we prefer the conciceness. In order to access the size of an array the programmer can use .high and the lower bounds via .low (which should most likely be zero.)

Important: When accessing the element of an array, the index(s) provided MUST be of type Int, no other type will be accepted

Last Modified: August 2008