Difference between revisions of "Isworkernode.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Normalise sequential blank lines)
m (Spot-edit Spinach function page first-line NOTOC and template fields)
Line 1: Line 1:
−
{{DISPLAYTITLE:isworkernode.m}}
+
{{DISPLAYTITLE:isworkernode.m}} __NOTOC__
 
Returns true if executed inside a parfor or spmd block. This function is used in the internal decision making of ''Spinach'' kernel: certain algorithms are switched to their serial versions if the calculation is already running inside some parallel loop.
 
Returns true if executed inside a parfor or spmd block. This function is used in the internal decision making of ''Spinach'' kernel: certain algorithms are switched to their serial versions if the calculation is already running inside some parallel loop.
  
Line 5: Line 5:
  
 
     answer=isworkernode()
 
     answer=isworkernode()
 +
 +
==Arguments==
 +
 +
    none
  
 
==Outputs==
 
==Outputs==

Revision as of 17:28, 5 June 2026

Returns true if executed inside a parfor or spmd block. This function is used in the internal decision making of Spinach kernel: certain algorithms are switched to their serial versions if the calculation is already running inside some parallel loop.

Syntax

    answer=isworkernode()

Arguments

    none

Outputs

    answer - true if running on a parallel worker process

See also

Parallelisation and GPUs

Version 2.2, authors: Ilya Kuprov