[Insight-developers] suggestion: use environment variable to limit
number of parallel threads
Torsten Rohlfing
torsten at synapse.sri.com
Thu Sep 20 12:31:09 EDT 2007
Sean:
Two problems with your suggestion:
a) I have to put a command line switch etc. into EVERY application I
build based on ITK to replicate this functionality. That includes all
applications made by other people, so I have to potentially keep
patching other people's code.
b) if I don't have the source code of the application (possible
according to ITK licensing), then I'm screwed.
Does that answer your question?
Cheers!
TR
Sean McBride wrote:
> On 9/20/07 9:11 AM, Torsten Rohlfing said:
>
>
>> Well, no, that's not quite what I meant. See, the function you're
>> referring to allows you to set the number of threads from INSIDE an ITK
>> application, whereas I was suggesting a way of setting it from OUTSIDE
>> the application.
>>
>
> hmmm, perhaps I need more caffeine... :) but ITK is just a big library
> that is linked into an executable. Can't your application just call
> SetGlobalDefaultNumberOfThreads() early on (before you call other ITK
> APIs), based on whatever env var you want?
>
>
--
Torsten Rohlfing, PhD SRI International, Neuroscience Program
Research Scientist 333 Ravenswood Ave, Menlo Park, CA 94025
Phone: ++1 (650) 859-3379 Fax: ++1 (650) 859-2743
torsten at synapse.sri.com http://www.stanford.edu/~rohlfing/
"Though this be madness, yet there is a method in't"
More information about the Insight-developers
mailing list