[Insight-developers] The Memory Consistency Problem, something everyone should know...

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Mar 19 09:15:42 EDT 2012


Hello Gaetan,

I was using SimpleITK to perform some basic operations on images and this filter was taking a significant amount of time by comparison. As I was waiting I looked at the code, and saw this issue.


I have seen talks on Intel Parallel Studio which includes a multi-threading profiling tool which can detect this type of thing, it's only for Visual Studio, and I am unaware of comparable open sour tools to analyze similar multi-threading issue.


Brad

On Mar 19, 2012, at 3:55 AM, Gaetan Lehmann wrote:

> 
> Hi Brad,
> 
> This is very interesting.
> Could you tell us what you have done to identify this problem?
> 
> Thanks,
> 
> Gaëtan
> 
> 
> 
> Le 16 mars 2012 21:59, Bradley Lowekamp <blowekamp at mail.nih.gov> a écrit :
> After digging a little further I think this problem may better be called "False Sharing" and there is a wikipedia page about it:
> http://en.wikipedia.org/wiki/False_sharing
> 
> Additionally the common cache block size for intel processors is 64 words. And the caching protocols should maintain this consistently between processors if shared.
> 
> Brad
> 
> On Mar 16, 2012, at 3:16 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:
> 
>> Hello,
>> 
>> I have just made the StatisticsImageFilter go ~58X faster on my multi-core platform for large data, by fixing the cache thrashing which was going on:
>> 
>> http://review.source.kitware.com/#/c/4771/1
>> 
>> When adjacent memory is modified by different processors, it must maintain consistency across the cores. This is of non-trivial expense then considered on the per-pixel level. If anyone is looking for an example case of bad cache thrashing I think this it about as good as you can do.
>> 
>> I am just sending this e-mail to make sure everyone is on the look out for this type of problem, and will take a note (Jira?) of where similar enhancements can occur.
>> 
>> 
>> Thanks for keeping an eye out,
>> Brad
>> 
>> ========================================================
>> Bradley Lowekamp  
>> Medical Science and Computing for
>> Office of High Performance Computing and Communications
>> National Library of Medicine 
>> blowekamp at mail.nih.gov
>> 
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120319/d86d83d2/attachment.htm>


More information about the Insight-developers mailing list