Difference between revisions of "Proc"

From Mesham
Jump to navigationJump to search
m
(Semantics)
Line 11: Line 11:
  
 
This will limit execution of a block to a certain process whose rank is guaranteed to be that specified.<br><br>
 
This will limit execution of a block to a certain process whose rank is guaranteed to be that specified.<br><br>
''Note:'' A variable declared within a proc block and allocated multiple will in fact, by inference, be allocated to the group of processes which contains a single process who's rank is the same as the proc block's.
+
''Note:'' A variable declared within a proc block and allocated multiple will in fact, by inference, be allocated to the group of processes which contains a single process who's rank is the same as the proc block's.<br>
 +
''Note:'' This is a blocking construct and regardless of arguments involves all processes who will either ignore it or execute the block.
  
 
== Example ==
 
== Example ==

Revision as of 13:32, 12 January 2013

Syntax

proc n
{
process body
}

where n is a variable or value known at compile time.

Semantics

This will limit execution of a block to a certain process whose rank is guaranteed to be that specified.

Note: A variable declared within a proc block and allocated multiple will in fact, by inference, be allocated to the group of processes which contains a single process who's rank is the same as the proc block's.
Note: This is a blocking construct and regardless of arguments involves all processes who will either ignore it or execute the block.

Example

#include <io>
proc 0 {
   print("Hello from 0\n");
};

proc 1 {
   print("hello from 1\n");
};

The code example will run on two processes, the first will display the message Hello from 0, whilst the second will output the message hello from 1.