[Insight-users] multi threading in ITK
Steve M. Robbins
steve at sumost.ca
Thu Jun 14 11:05:46 EDT 2007
On Thu, Jun 14, 2007 at 01:05:22PM +0200, Ruben Schilling wrote:
> Hi,
>
> I just wondered, if anybody knew how exactly I enable multi-threading
> in the multi-threading capable filters of ITK?
From what I can gather you need to do nothing; it is all taken
care of magically. See also this thread:
http://public.kitware.com/pipermail/insight-users/2007-May/022281.html
> I have seen, that
> these capable filters have a SetNumberOfThreads (int t) method to
> specify the number of threads. However when I set it that way and run
> "top" to monitor my system on the command line I never actually saw
> more than one core busy with my program (I have 2 CPUs each having 2
> processor cores, that I can observe from top).
My guess is that you're not using any parallelizable filters.
You should be able to write a simple program that tells you how many
cores ITK detects. Here's one I wrote for the analogous functionality
of VTK.
#include <vtkMultiThreader.h>
#include <iostream>
int main( int ac, char* av[] )
{
vtkMultiThreader* vmt = vtkMultiThreader::New();
vmt->Print( std::cout );
vmt->Delete();
return 0;
}
Cheers,
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://public.kitware.com/pipermail/insight-users/attachments/20070614/7e4a5e21/attachment.pgp
More information about the Insight-users
mailing list