Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000215ILNumerics[All Projects] Bugspublic2015-01-22 18:302015-01-22 19:35
Reporterho 
Assigned Toho 
PriorityhighSeveritymajorReproducibilityrandom
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000215: Problem with multithreaded managed matrix multiply on certain matrices (large vectors)
DescriptionOn certain machines (with a certain, uneven?) number of true processor cores, certain matrices seem do give wrong results when used with ILMath.multiply().

The problem ocours only occasionally. This may lead to a bug in ManMatMult (multithreaded version).

Workaround: Use MKL instead. Somewhere at the beginning of your code, write:

Settings.ManagedMultiplyMaxElementSize = 1;
Steps To Reproduce* Test on a machine with at least 6 cores.
* set the number of threads to be used explicitly: Settings.MaxNumberThreads = 3
  
        Settings.MaxNumberThreads = 3;
        ILArray<double> B = ILMath.counter(50, 1);
        ILArray<double> R1 = ILMath.multiply(B, B.T);

* May need to re-run several times until R1 does not show the expected image.
Additional Information
The problem shows up clearly in ILNumerics Array Visualizer: use ImageSC output tab. See picture attached.
TagsNo tags attached.
Attached Filespng file icon Array Visualizer Compare Matrices Visually.png [^] (61,070 bytes) 2015-01-22 18:30

- Relationships

-  Notes
(0000211)
ho (administrator)
2015-01-22 19:35

Will be fixed in 4.7.

The reason was a wrong handling of temporary packing buffers in a multithreading context. The parallelized version has been disabled for now. We should decide if it pays off to parallelize at all here, since we delegate multiply() to the MKL for all reasonable large matrices anyway.

If parallelizing: must create copies of CArr, APack, BPack for each thread and merge-add CArr after all threads have finished. (Again: measure in advance, if the overhead pays off!)

- Issue History
Date Modified Username Field Change
2015-01-22 18:30 ho New Issue
2015-01-22 18:30 ho Status new => assigned
2015-01-22 18:30 ho Assigned To => ho
2015-01-22 18:30 ho File Added: Array Visualizer Compare Matrices Visually.png
2015-01-22 19:35 ho Note Added: 0000211
2015-01-22 19:35 ho Status assigned => resolved
2015-01-22 19:35 ho Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker