Difference between pages "Template:ElementTypeCommunication" and "Single"
From Mesham
(Difference between pages)
Jump to navigationJump to searchm |
|||
Line 1: | Line 1: | ||
− | + | == Syntax == | |
+ | single[type] | ||
+ | single[on[process]] | ||
+ | where ''type'' is optional | ||
− | + | == Semantics == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Will allocate a variable to a specific process. Most commonly combined with the ''on'' type which specifies the process to allocated to, but not required if this can be inferred. Additionally the programmer will place a distribution type within ''single'' if dealing with distributed arrays. | |
− | + | == Example == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | var i:Int :: allocated[single[on[1]]]; | ||
− | + | In this example variable ''i'' is declared as an integer and allocated on process 1. | |
+ | |||
+ | ''Since: Version 0.41b'' | ||
+ | |||
+ | [[Category:Type Library]] | ||
+ | [[Category:Compound Types]] | ||
+ | [[Category:Allocation Types]] |
Revision as of 18:26, 13 January 2013
Syntax
single[type] single[on[process]]
where type is optional
Semantics
Will allocate a variable to a specific process. Most commonly combined with the on type which specifies the process to allocated to, but not required if this can be inferred. Additionally the programmer will place a distribution type within single if dealing with distributed arrays.
Example
var i:Int :: allocated[single[on[1]]];
In this example variable i is declared as an integer and allocated on process 1.
Since: Version 0.41b