[Insight-users] how to temparaly disable multithreading or limit the # of threads

Bill Lorensen bill.lorensen at gmail.com
Mon Nov 17 16:47:35 EST 2008


Try:

itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1);

Bill

On Mon, Nov 17, 2008 at 4:42 PM, pinpress <sb_ji at yahoo.com> wrote:
>
> Hi,
>
> I built my ITK package with
>
>         ITK_USE_REVIEW
>         ITK_USE_OPTIMIZED_REGISTRATION_METHODS
>
> on in CMake to take advantage of multithreading. However, when I tried to
> run DeformableRegistration14.cxx (basically a BSpline registration program)
> to register two MR images, it used all the CPUs and consumed ALL available
> memory on my Linux computer and eventually caused the computer to be down.
> When the above two options were OFF, the same program runs fine, although
> only with 1 CPU.
>
> It seems clear to me that for this program, I need to temporarily turn off
> multithreading, or at least limit the # of threads that it spawns. My
> question is, how to achieve this without having to re-build ITK package by
> setting those option OFF?
>
> Appreciate any input, as again, I failed to find any relevant info online.
> --
> View this message in context: http://www.nabble.com/how-to-temparaly-disable-multithreading-or-limit-the---of-threads-tp20548844p20548844.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list