# Element Types

Next: Allocated, Previous: Index, Index: Index

An element type is a basic type of the language, used to describe a variable which holds a single element or each element of a collection. There are a number of different element types, all sharing the same communication behaviour, which allow the programmer to describe a wide variety of data. The size (in bytes) that each element type requires for storage is implementation specific, however according to the C99 standard a character is guaranteed to be 1 byte.

Type | Semantics
--- | ---
Int | A whole number
| Double | A double precision number | Float | A floating point number | Bool | A true or false value | Char | A character | String | A string of characters | File | A file handle

For communication, these element types have specific behaviours when used within an SPMD style of programming. However, if the programmer issues an assignment which would require communication in a MPMD style (e.g. in a par loop) then the compiler will report this as an error (as this operation is not allowed due to the possibility of accidental deadlock.) For the assignment a:=b

a | b | Result
--- | --- | ---
multiple | multiple | local assignment
single[x] | multiple | local on process x only
multiple | single | MPI Broadcast
single[x] | single[x] | Where x==x local
single[x] | single[q] | Where x != q, P2P communication

Last Modified: August 2008