Difference between revisions of "Single"

From Mesham
Jump to navigationJump to search
m
m (4 revisions imported)
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
== Example ==
 
== Example ==
  
var i:Int :: allocated[single[on[1]]];
+
function void main() {
 +
    var i:Int :: allocated[single[on[1]]];
 +
};
  
 
In this example variable ''i'' is declared as an integer and allocated on process 1.
 
In this example variable ''i'' is declared as an integer and allocated on process 1.
 +
 +
''Since: Version 0.41b''
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
 
[[Category:Compound Types]]
 
[[Category:Compound Types]]
 
[[Category:Allocation Types]]
 
[[Category:Allocation Types]]

Latest revision as of 15:44, 15 April 2019

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

function void main() {
   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