[Insight-developers] suggestion: use environment variable to limit number of parallel threads

Torsten Rohlfing torsten at synapse.sri.com
Wed Sep 19 19:25:38 EDT 2007


Hi:

I have a suggestion for ITK's multi-threaded processing framework. I 
think it would be useful to be able to set the maximum number of 
parallel threads using an environment variable, for example using

export ITK_MAXIMUM_NUMBER_OF_THREADS=4

(other shells and Windows accordingly).

This would solve a problem I am having when running jobs with ITK-based 
applications in batch mode on my cluster. It is not always beneficial to 
run on all available CPUs, because other steps in a processing pipeline 
may not be parallel, and it may therefore be desirable to run multiple 
copies of the same pipeline on different data instead.

By implementing this through an environment variable, we'd have this 
functionality in every application that uses ITK, without for example 
having to put a separate command line switch into each and every one of 
them.

Also, the solution would be backward compatible, because if the chosen 
variable is not set, ITK can simply behave as it does now and allocate 
one thread per CPU.

Best,
  Torsten

-- 
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"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: torsten.vcf
Type: text/x-vcard
Size: 366 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20070919/cb0a7a0a/torsten.vcf


More information about the Insight-developers mailing list