<!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 text="#000000" bgcolor="#ffffff">
On 08/19/2011 02:15 PM, David W Noon wrote:<br>
<blockquote cite="mid:20110819131508.79392b93@memphis.local"
type="cite">
<pre wrap="">My experience with OpenMP is that it is difficult to write a loop body
large enough that context switching does not overwhelm the benefits of
parallelism.
</pre>
</blockquote>
Hmmm. <br>
<br>
If you do a multiplication of a 100*100 Matrix you could spawn 10000
threads and this will result in a huge switching overhead. <br>
<br>
But if you have 10 cores and you aggregate the 10000 tasks in 10
groups of 1000 calculations each, spawn 10 threads and have each go
through a loop of calculating 1000 cells, I gather that (in a
perfect world) no task switching overhead at all would be necessary
(but at the beginning and the end of the complete calculation). <br>
<br>
If in Prism you do something like (pseudo-code draft): <br>
<hr size="2" width="100%">m := 100;<br>
n := 100<br>
<br>
for parallel ij := 0 to m*n-1 do begin<br>
i := ij mod m;<br>
j := ij div m;<br>
calccell (i,j);<br>
end; <br>
<hr size="2" width="100%"><br>
I understand that Prism (or rather .NET) on a 10 core machine
automatically would create 10 threads each doing 1000 cells.<br>
<br>
-Michael<br>
</body>
</html>