<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Steve Williams wrote:<br>
<blockquote cite="mid44C73582.5010805@kromestudios.com" type="cite">Michael
Van Canneyt wrote:
<br>
<blockquote type="cite">Which is why I think that it's better to have
them as local functions,
<br>
instead of having to introduce a lot of new functions.
<br>
<br>
Local functions are very pascal-ish. C doesn't have it, which is why
they can't use it.
<br>
Let's use the language features to their full extent.
<br>
</blockquote>
*procedure* SubTask(*var* x : *array of* Float);
<br>
*var*
<br>
/// Variables declared here have /|*private*|/ context./
<br>
iam : Integer;
<br>
nt : Integer;
<br>
ipoints : Integer;
<br>
*parallel*
<br>
iam := OMP.Get_Thread_Num; /// OMP library calls./
<br>
nt := OMP.Get_Num_Threads;
<br>
ipoints := Length (x) *div* nt; /// size of partition/
<br>
istart := iam * ipoints; /// starting array index/
<br>
*if* iam = Pred (nt) *then*
<br>
ipoints := Length (x) - istart; /// last thread may do more/
<br>
SubDomain (x, istart, ipoints);
<br>
*end*;
<br>
<br>
</blockquote>
Wouldn't it be better to write it like this:<br>
procedure SubTask(var x: array of Float); <b>parallel</b>;<br>
var<br>
...<br>
begin<br>
...<br>
end;<br>
<br>
</body>
</html>